]> Savannah Git Hosting - gnulib.git/commitdiff
Fix linkage errors when using C++.
authorBruno Haible <bruno@clisp.org>
Wed, 17 Apr 2024 22:28:40 +0000 (00:28 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 17 Apr 2024 22:31:11 +0000 (00:31 +0200)
Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00274.html>.

* lib/acl.h: Add 'extern "C" {' / '}' boilerplate.
* lib/alignalloc.h: Likewise.
* lib/aligned-malloc.h: Likewise.
* lib/allocator.h: Likewise.
* lib/arcfour.h: Likewise.
* lib/arctwo.h: Likewise.
* lib/areadlink.h: Likewise.
* lib/argv-iter.h: Likewise.
* lib/argz.in.h: Likewise.
* lib/binary-io.h: Likewise.
* lib/bitrotate.h: Likewise.
* lib/bitset.h: Likewise.
* lib/bitsetv.h: Likewise.
* lib/c-strcaseeq.h: Likewise.
* lib/canon-host.h: Likewise.
* lib/careadlinkat.h: Likewise.
* lib/chdir-long.h: Likewise.
* lib/check-version.h: Likewise.
* lib/classpath.h: Likewise.
* lib/cloexec.h: Likewise.
* lib/close-stream.h: Likewise.
* lib/crc.h: Likewise.
* lib/csharpcomp.h: Likewise.
* lib/csharpexec.h: Likewise.
* lib/cycle-check.h: Likewise.
* lib/des.h: Likewise.
* lib/dev-ino.h: Likewise.
* lib/di-set.h: Likewise.
* lib/eealloc.h: Likewise.
* lib/exclude.h: Likewise.
* lib/execinfo.in.h: Likewise.
* lib/execute.h: Likewise.
* lib/exitfail.h: Likewise.
* lib/fcntl-safer.h: Likewise.
* lib/file-set.h: Likewise.
* lib/file-type.h: Likewise.
* lib/filenamecat.h: Likewise.
* lib/filevercmp.h: Likewise.
* lib/fpending.h: Likewise.
* lib/fprintftime.h: Likewise.
* lib/fpucw.h: Likewise.
* lib/fsusage.h: Likewise.
* lib/ftoastr.h: Likewise.
* lib/full-read.h: Likewise.
* lib/gc.h: Likewise.
* lib/getndelim2.h: Likewise.
* lib/getnline.h: Likewise.
* lib/getugroups.h: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/hamt.h: Likewise.
* lib/hard-locale.h: Likewise.
* lib/hash-pjw-bare.h: Likewise.
* lib/hash-pjw.h: Likewise.
* lib/hash-triple.h: Likewise.
* lib/hmac.h: Likewise.
* lib/human.h: Likewise.
* lib/i-ring.h: Likewise.
* lib/idcache.h: Likewise.
* lib/idx.h: Likewise.
* lib/ino-map.h: Likewise.
* lib/inttostr.h: Likewise.
* lib/isapipe.h: Likewise.
* lib/javacomp.h: Likewise.
* lib/javaexec.h: Likewise.
* lib/jit/cache.h: Likewise.
* lib/linebuffer.h: Likewise.
* lib/localeinfo.h: Likewise.
* lib/long-options.h: Likewise.
* lib/mbchar.h: Likewise.
* lib/mbfile.h: Likewise.
* lib/mbiter.h: Likewise.
* lib/mbiterf.h: Likewise.
* lib/mbuiter.h: Likewise.
* lib/mbuiterf.h: Likewise.
* lib/mcel.h: Likewise.
* lib/memcasecmp.h: Likewise.
* lib/memcoll.h: Likewise.
* lib/memxor.h: Likewise.
* lib/mgetgroups.h: Likewise.
* lib/mkdir-p.h: Likewise.
* lib/modechange.h: Likewise.
* lib/mountlist.h: Likewise.
* lib/mpsort.h: Likewise.
* lib/msvc-nothrow.h: Likewise.
* lib/nan.h: Likewise.
* lib/openat-priv.h: Likewise.
* lib/openat.h: Likewise.
* lib/opendirat.h: Likewise.
* lib/pagealign_alloc.h: Likewise.
* lib/parse-datetime.h: Likewise.
* lib/parse-duration.h: Likewise.
* lib/physmem.h: Likewise.
* lib/posixtm.h: Likewise.
* lib/posixver.h: Likewise.
* lib/printf-frexp.h: Likewise.
* lib/printf-frexpl.h: Likewise.
* lib/priv-set.h: Likewise.
* lib/quote.h: Likewise.
* lib/quotearg.h: Likewise.
* lib/read-file.h: Likewise.
* lib/readline.h: Likewise.
* lib/readtokens.h: Likewise.
* lib/readtokens0.h: Likewise.
* lib/regex-quote.h: Likewise.
* lib/renameatu.h: Likewise.
* lib/rijndael-alg-fst.h: Likewise.
* lib/rijndael-api-fst.h: Likewise.
* lib/safe-alloc.h: Likewise.
* lib/safe-write.h: Likewise.
* lib/same-inode.h: Likewise.
* lib/same.h: Likewise.
* lib/save-cwd.h: Likewise.
* lib/savedir.h: Likewise.
* lib/savewd.h: Likewise.
* lib/selinux-at.h: Likewise.
* lib/signed-nan.h: Likewise.
* lib/signed-snan.h: Likewise.
* lib/snan.h: Likewise.
* lib/sockets.h: Likewise.
* lib/stdio-safer.h: Likewise.
* lib/stdlib-safer.h: Likewise.
* lib/streq.h: Likewise.
* lib/strerror-override.h: Likewise.
* lib/tmpdir.h: Likewise.
* lib/trim.h: Likewise.
* lib/u64.h: Likewise.
* lib/unicase/casefold.h: Likewise.
* lib/unicase/caseprop.h: Likewise.
* lib/unicase/invariant.h: Likewise.
* lib/unicase/special-casing.in.h: Likewise.
* lib/unicase/unicasemap.h: Likewise.
* lib/unicodeio.h: Likewise.
* lib/unilbrk/lbrktables.h: Likewise.
* lib/unilbrk/ulc-common.h: Likewise.
* lib/uninorm/decompose-internal.h: Likewise.
* lib/unistd-safer.h: Likewise.
* lib/unitypes.in.h: Likewise.
* lib/uniwbrk/wbrktable.h: Likewise.
* lib/unlinkdir.h: Likewise.
* lib/userspec.h: Likewise.
* lib/utimecmp.h: Likewise.
* lib/utimens.h: Likewise.
* lib/windows-spawn.h: Likewise.
* lib/write-any-file.h: Likewise.
* lib/xbinary-io.h: Likewise.
* lib/xgetcwd.h: Likewise.
* lib/xgetdomainname.h: Likewise.
* lib/xgethostname.h: Likewise.
* lib/xmemcoll.h: Likewise.
* lib/xprintf.h: Likewise.
* lib/xreadlink.h: Likewise.
* lib/xsize.h: Likewise.
* lib/xstrndup.h: Likewise.
* lib/xstrtod.h: Likewise.
* lib/xstrtol.h: Likewise.
* lib/yesno.h: Likewise.
* lib/isnand-nolibm.h (isnand): Declare with C linkage.
* lib/isnanf-nolibm.h (isnanf): Likewise.
* lib/isnanl-nolibm.h (isnanl): Likewise.

160 files changed:
ChangeLog
lib/acl.h
lib/alignalloc.h
lib/aligned-malloc.h
lib/allocator.h
lib/arcfour.h
lib/arctwo.h
lib/areadlink.h
lib/argv-iter.h
lib/argz.in.h
lib/binary-io.h
lib/bitrotate.h
lib/bitset.h
lib/bitsetv.h
lib/c-strcaseeq.h
lib/canon-host.h
lib/careadlinkat.h
lib/chdir-long.h
lib/check-version.h
lib/classpath.h
lib/cloexec.h
lib/close-stream.h
lib/crc.h
lib/csharpcomp.h
lib/csharpexec.h
lib/cycle-check.h
lib/des.h
lib/dev-ino.h
lib/di-set.h
lib/eealloc.h
lib/exclude.h
lib/execinfo.in.h
lib/execute.h
lib/exitfail.h
lib/fcntl-safer.h
lib/file-set.h
lib/file-type.h
lib/filenamecat.h
lib/filevercmp.h
lib/fpending.h
lib/fprintftime.h
lib/fpucw.h
lib/fsusage.h
lib/ftoastr.h
lib/full-read.h
lib/gc.h
lib/getndelim2.h
lib/getnline.h
lib/getugroups.h
lib/glthread/tls.h
lib/hamt.h
lib/hard-locale.h
lib/hash-pjw-bare.h
lib/hash-pjw.h
lib/hash-triple.h
lib/hmac.h
lib/human.h
lib/i-ring.h
lib/idcache.h
lib/idx.h
lib/ino-map.h
lib/inttostr.h
lib/isapipe.h
lib/isnand-nolibm.h
lib/isnanf-nolibm.h
lib/isnanl-nolibm.h
lib/javacomp.h
lib/javaexec.h
lib/jit/cache.h
lib/linebuffer.h
lib/localeinfo.h
lib/long-options.h
lib/mbchar.h
lib/mbfile.h
lib/mbiter.h
lib/mbiterf.h
lib/mbuiter.h
lib/mbuiterf.h
lib/mcel.h
lib/memcasecmp.h
lib/memcoll.h
lib/memxor.h
lib/mgetgroups.h
lib/mkdir-p.h
lib/modechange.h
lib/mountlist.h
lib/mpsort.h
lib/msvc-nothrow.h
lib/nan.h
lib/openat-priv.h
lib/openat.h
lib/opendirat.h
lib/pagealign_alloc.h
lib/parse-datetime.h
lib/parse-duration.h
lib/physmem.h
lib/posixtm.h
lib/posixver.h
lib/printf-frexp.h
lib/printf-frexpl.h
lib/priv-set.h
lib/quote.h
lib/quotearg.h
lib/read-file.h
lib/readline.h
lib/readtokens.h
lib/readtokens0.h
lib/regex-quote.h
lib/renameatu.h
lib/rijndael-alg-fst.h
lib/rijndael-api-fst.h
lib/safe-alloc.h
lib/safe-write.h
lib/same-inode.h
lib/same.h
lib/save-cwd.h
lib/savedir.h
lib/savewd.h
lib/selinux-at.h
lib/signed-nan.h
lib/signed-snan.h
lib/snan.h
lib/sockets.h
lib/stdio-safer.h
lib/stdlib-safer.h
lib/streq.h
lib/strerror-override.h
lib/tmpdir.h
lib/trim.h
lib/u64.h
lib/unicase/casefold.h
lib/unicase/caseprop.h
lib/unicase/invariant.h
lib/unicase/special-casing.in.h
lib/unicase/unicasemap.h
lib/unicodeio.h
lib/unilbrk/lbrktables.h
lib/unilbrk/ulc-common.h
lib/uninorm/decompose-internal.h
lib/unistd-safer.h
lib/unitypes.in.h
lib/uniwbrk/wbrktable.h
lib/unlinkdir.h
lib/userspec.h
lib/utimecmp.h
lib/utimens.h
lib/windows-spawn.h
lib/write-any-file.h
lib/xbinary-io.h
lib/xgetcwd.h
lib/xgetdomainname.h
lib/xgethostname.h
lib/xmemcoll.h
lib/xprintf.h
lib/xreadlink.h
lib/xsize.h
lib/xstrndup.h
lib/xstrtod.h
lib/xstrtol.h
lib/yesno.h

index 348c887be0440a827c67ee1ba93de9705976c99e..0890c3c43e745198ee7903ee383a034d03fdcd58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,168 @@
+2024-04-17  Bruno Haible  <bruno@clisp.org>
+
+       Fix linkage errors when using C++.
+       Reported by Miro Palmu <email@miropalmu.cc> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00274.html>.
+       * lib/acl.h: Add 'extern "C" {' / '}' boilerplate.
+       * lib/alignalloc.h: Likewise.
+       * lib/aligned-malloc.h: Likewise.
+       * lib/allocator.h: Likewise.
+       * lib/arcfour.h: Likewise.
+       * lib/arctwo.h: Likewise.
+       * lib/areadlink.h: Likewise.
+       * lib/argv-iter.h: Likewise.
+       * lib/argz.in.h: Likewise.
+       * lib/binary-io.h: Likewise.
+       * lib/bitrotate.h: Likewise.
+       * lib/bitset.h: Likewise.
+       * lib/bitsetv.h: Likewise.
+       * lib/c-strcaseeq.h: Likewise.
+       * lib/canon-host.h: Likewise.
+       * lib/careadlinkat.h: Likewise.
+       * lib/chdir-long.h: Likewise.
+       * lib/check-version.h: Likewise.
+       * lib/classpath.h: Likewise.
+       * lib/cloexec.h: Likewise.
+       * lib/close-stream.h: Likewise.
+       * lib/crc.h: Likewise.
+       * lib/csharpcomp.h: Likewise.
+       * lib/csharpexec.h: Likewise.
+       * lib/cycle-check.h: Likewise.
+       * lib/des.h: Likewise.
+       * lib/dev-ino.h: Likewise.
+       * lib/di-set.h: Likewise.
+       * lib/eealloc.h: Likewise.
+       * lib/exclude.h: Likewise.
+       * lib/execinfo.in.h: Likewise.
+       * lib/execute.h: Likewise.
+       * lib/exitfail.h: Likewise.
+       * lib/fcntl-safer.h: Likewise.
+       * lib/file-set.h: Likewise.
+       * lib/file-type.h: Likewise.
+       * lib/filenamecat.h: Likewise.
+       * lib/filevercmp.h: Likewise.
+       * lib/fpending.h: Likewise.
+       * lib/fprintftime.h: Likewise.
+       * lib/fpucw.h: Likewise.
+       * lib/fsusage.h: Likewise.
+       * lib/ftoastr.h: Likewise.
+       * lib/full-read.h: Likewise.
+       * lib/gc.h: Likewise.
+       * lib/getndelim2.h: Likewise.
+       * lib/getnline.h: Likewise.
+       * lib/getugroups.h: Likewise.
+       * lib/glthread/tls.h: Likewise.
+       * lib/hamt.h: Likewise.
+       * lib/hard-locale.h: Likewise.
+       * lib/hash-pjw-bare.h: Likewise.
+       * lib/hash-pjw.h: Likewise.
+       * lib/hash-triple.h: Likewise.
+       * lib/hmac.h: Likewise.
+       * lib/human.h: Likewise.
+       * lib/i-ring.h: Likewise.
+       * lib/idcache.h: Likewise.
+       * lib/idx.h: Likewise.
+       * lib/ino-map.h: Likewise.
+       * lib/inttostr.h: Likewise.
+       * lib/isapipe.h: Likewise.
+       * lib/javacomp.h: Likewise.
+       * lib/javaexec.h: Likewise.
+       * lib/jit/cache.h: Likewise.
+       * lib/linebuffer.h: Likewise.
+       * lib/localeinfo.h: Likewise.
+       * lib/long-options.h: Likewise.
+       * lib/mbchar.h: Likewise.
+       * lib/mbfile.h: Likewise.
+       * lib/mbiter.h: Likewise.
+       * lib/mbiterf.h: Likewise.
+       * lib/mbuiter.h: Likewise.
+       * lib/mbuiterf.h: Likewise.
+       * lib/mcel.h: Likewise.
+       * lib/memcasecmp.h: Likewise.
+       * lib/memcoll.h: Likewise.
+       * lib/memxor.h: Likewise.
+       * lib/mgetgroups.h: Likewise.
+       * lib/mkdir-p.h: Likewise.
+       * lib/modechange.h: Likewise.
+       * lib/mountlist.h: Likewise.
+       * lib/mpsort.h: Likewise.
+       * lib/msvc-nothrow.h: Likewise.
+       * lib/nan.h: Likewise.
+       * lib/openat-priv.h: Likewise.
+       * lib/openat.h: Likewise.
+       * lib/opendirat.h: Likewise.
+       * lib/pagealign_alloc.h: Likewise.
+       * lib/parse-datetime.h: Likewise.
+       * lib/parse-duration.h: Likewise.
+       * lib/physmem.h: Likewise.
+       * lib/posixtm.h: Likewise.
+       * lib/posixver.h: Likewise.
+       * lib/printf-frexp.h: Likewise.
+       * lib/printf-frexpl.h: Likewise.
+       * lib/priv-set.h: Likewise.
+       * lib/quote.h: Likewise.
+       * lib/quotearg.h: Likewise.
+       * lib/read-file.h: Likewise.
+       * lib/readline.h: Likewise.
+       * lib/readtokens.h: Likewise.
+       * lib/readtokens0.h: Likewise.
+       * lib/regex-quote.h: Likewise.
+       * lib/renameatu.h: Likewise.
+       * lib/rijndael-alg-fst.h: Likewise.
+       * lib/rijndael-api-fst.h: Likewise.
+       * lib/safe-alloc.h: Likewise.
+       * lib/safe-write.h: Likewise.
+       * lib/same-inode.h: Likewise.
+       * lib/same.h: Likewise.
+       * lib/save-cwd.h: Likewise.
+       * lib/savedir.h: Likewise.
+       * lib/savewd.h: Likewise.
+       * lib/selinux-at.h: Likewise.
+       * lib/signed-nan.h: Likewise.
+       * lib/signed-snan.h: Likewise.
+       * lib/snan.h: Likewise.
+       * lib/sockets.h: Likewise.
+       * lib/stdio-safer.h: Likewise.
+       * lib/stdlib-safer.h: Likewise.
+       * lib/streq.h: Likewise.
+       * lib/strerror-override.h: Likewise.
+       * lib/tmpdir.h: Likewise.
+       * lib/trim.h: Likewise.
+       * lib/u64.h: Likewise.
+       * lib/unicase/casefold.h: Likewise.
+       * lib/unicase/caseprop.h: Likewise.
+       * lib/unicase/invariant.h: Likewise.
+       * lib/unicase/special-casing.in.h: Likewise.
+       * lib/unicase/unicasemap.h: Likewise.
+       * lib/unicodeio.h: Likewise.
+       * lib/unilbrk/lbrktables.h: Likewise.
+       * lib/unilbrk/ulc-common.h: Likewise.
+       * lib/uninorm/decompose-internal.h: Likewise.
+       * lib/unistd-safer.h: Likewise.
+       * lib/unitypes.in.h: Likewise.
+       * lib/uniwbrk/wbrktable.h: Likewise.
+       * lib/unlinkdir.h: Likewise.
+       * lib/userspec.h: Likewise.
+       * lib/utimecmp.h: Likewise.
+       * lib/utimens.h: Likewise.
+       * lib/windows-spawn.h: Likewise.
+       * lib/write-any-file.h: Likewise.
+       * lib/xbinary-io.h: Likewise.
+       * lib/xgetcwd.h: Likewise.
+       * lib/xgetdomainname.h: Likewise.
+       * lib/xgethostname.h: Likewise.
+       * lib/xmemcoll.h: Likewise.
+       * lib/xprintf.h: Likewise.
+       * lib/xreadlink.h: Likewise.
+       * lib/xsize.h: Likewise.
+       * lib/xstrndup.h: Likewise.
+       * lib/xstrtod.h: Likewise.
+       * lib/xstrtol.h: Likewise.
+       * lib/yesno.h: Likewise.
+       * lib/isnand-nolibm.h (isnand): Declare with C linkage.
+       * lib/isnanf-nolibm.h (isnanf): Likewise.
+       * lib/isnanl-nolibm.h (isnanl): Likewise.
+
 2024-04-17  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Make an instance variable local to a function.
index a3aeb8fc86ae53e4b0ec5d0639d4579e46650d44..0bf78a654d25d1d70e38bdad426b2ca3e3080cb2 100644 (file)
--- a/lib/acl.h
+++ b/lib/acl.h
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 bool acl_errno_valid (int) _GL_ATTRIBUTE_CONST;
 int file_has_acl (char const *, struct stat const *);
 int qset_acl (char const *, int, mode_t);
@@ -36,4 +41,9 @@ int qcopy_acl (char const *, int, char const *, int, mode_t);
 int copy_acl (char const *, int, char const *, int, mode_t);
 int chmod_or_fchmod (char const *, int, mode_t);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index d33f62e29cefe32ae01f42d94c358ae7cce6342d..0c73bfc4b235c732dfee8ba8b470d91caf830873 100644 (file)
@@ -38,6 +38,11 @@ _GL_INLINE_HEADER_BEGIN
 # define ALIGNALLOC_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Whether aligned_alloc supports any power-of-two alignment,
    returns a nonnull pointer for size-zero allocations,
    and sets errno on failure.  */
@@ -118,6 +123,11 @@ void *xalignalloc (idx_t, idx_t)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((2))
   _GL_ATTRIBUTE_RETURNS_NONNULL /* _GL_ATTRIBUTE_DEALLOC (alignfree, 1) */;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* !ALIGNALLOC_H_ */
index a432512c76bcac6c30a06d598bdbe5c56dd21c11..d7142f5a8c2dd21588f6811e8871e9a284521a9c 100644 (file)
  #error "Please include config.h first."
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #if !defined ALIGNMENT
 # error "ALIGNMENT is not defined"
 #endif
@@ -185,3 +190,8 @@ aligned_malloc (size_t size)
 }
 
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index bb30a3440c2d631b6d130bfd355ee5a79aa7230a..53c8dfcacdf582e81967f7856a39c5ab430ab354 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* An object describing a memory allocator family.  */
 
 struct allocator
@@ -55,4 +60,9 @@ struct allocator
 /* An allocator using the stdlib functions and a null DIE function.  */
 extern struct allocator const stdlib_allocator;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_ALLOCATOR_H */
index 742f4740f76337335d2e19ada6b8acd29972ad16..613a68c15f07f9387bdd6c0c781e2c47923b1b77 100644 (file)
 /* Code from Libgcrypt adapted for gnulib by Simon Josefsson. */
 
 #ifndef ARCFOUR_H
-# define ARCFOUR_H
+#define ARCFOUR_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stddef.h>
-# include <stdint.h>
 
 #define ARCFOUR_SBOX_SIZE 256
 
@@ -45,4 +50,9 @@ arcfour_stream (arcfour_context * context,
 extern void
 arcfour_setkey (arcfour_context * context, const char *key, size_t keylen);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* ARCFOUR_H */
index 0dc0d8a93482510167283e21680921204cc485ee..27453c3c88d62cc39dbc6ce8710deef56cf2d371 100644 (file)
 /* Code from Libgcrypt adapted for gnulib by Simon Josefsson. */
 
 #ifndef ARCTWO_H
-# define ARCTWO_H
+#define ARCTWO_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stddef.h>
-# include <stdint.h>
 
 typedef struct
 {
@@ -58,4 +63,9 @@ extern void
 arctwo_decrypt (arctwo_context *context, const char *inbuf,
                 char *restrict outbuf, size_t length);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* ARCTWO_H */
index d7ffaa2f3c3e055d488ef93bcb88de603c9d0d32..88ad14e8a8281f259c3d8a2c65c98276201ca2d1 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern char *areadlink (char const *filename)
   _GL_ATTRIBUTE_DEALLOC_FREE;
 extern char *areadlink_with_size (char const *filename, size_t size_hint)
@@ -35,3 +40,8 @@ extern char *areadlinkat_with_size (int fd, char const *filename,
                                     size_t size_hint)
   _GL_ATTRIBUTE_DEALLOC_FREE;
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index d75a26416c93528701b1cb2e2bf51a04d9c419c4..8f8823ad5f0b206e85036206d0f91246e827387c 100644 (file)
 /* Definition of _GL_ARG_NONNULL.  */
 #include "arg-nonnull.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct argv_iterator;
 
 enum argv_iter_err
@@ -45,3 +50,8 @@ char *argv_iter (struct argv_iterator *, enum argv_iter_err *)
   _GL_ARG_NONNULL ((1, 2));
 size_t argv_iter_n_args (struct argv_iterator const *)
   _GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1));
+
+
+#ifdef __cplusplus
+}
+#endif
index c3fc8c35610febc2dba7c685b681f6f9775f7133..e37a1fd3062f432dd0cd08546549de7de1aedef9 100644 (file)
 #include <errno.h>
 #include <string.h>             /* Need size_t.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #ifndef __error_t_defined
 typedef int error_t;
 #endif
@@ -127,4 +132,8 @@ extern char *argz_next (const char *restrict /*argz*/, size_t /*argz_len*/,
                         const char *restrict /*entry*/);
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* argz.h */
index 0cc5c11748ca665df77ecdf3422cca5e4d1600f1..1da018fad85669fda555a1d04929f5a7dfad375a 100644 (file)
@@ -55,6 +55,11 @@ __gl_setmode (_GL_UNUSED int fd, _GL_UNUSED int mode)
 }
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Set FD's mode to MODE, which should be either O_TEXT or O_BINARY.
    Return the old mode if successful, -1 (setting errno) on failure.
    Ordinarily this function would be called 'setmode', since that is
@@ -74,6 +79,11 @@ set_binary_mode (int fd, int mode)
 /* This macro is obsolescent.  */
 #define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY))
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _BINARY_H */
index 91744cc5f98dc314fd6f273676b4fd8aa37c16d6..dd3afa6b6af42cae9cc4c481066f476dd0cb867a 100644 (file)
@@ -33,6 +33,11 @@ _GL_INLINE_HEADER_BEGIN
 # define BITROTATE_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #ifdef UINT64_MAX
 /* Given an unsigned 64-bit argument X, return the value corresponding
    to rotating the bits N steps to the left.  N must be between 1 and
@@ -135,6 +140,11 @@ rotr8 (uint8_t x, int n)
   return (((unsigned int) x >> n) | ((unsigned int) x << (8 - n))) & UINT8_MAX;
 }
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _GL_BITROTATE_H */
index 3f6325f83030000221bc9356dab54d3fe65e4713..975f31d54884aa268d950ab9d888b1aa439cb0f6 100644 (file)
 #include "bitset/base.h"
 #include "obstack.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Attributes used to select a bitset implementation.  */
 enum bitset_attr {BITSET_FIXED = 1,    /* Bitset size fixed.  */
                   BITSET_VARIABLE = 2, /* Bitset size variable.  */
@@ -398,4 +403,9 @@ void debug_bitset (bitset);
 /* Function to debug bitset stats from debugger.  */
 void debug_bitset_stats (void);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_BITSET_H  */
index f45030ca292809d1fc6c3e6926ddd2df3584a866..3be6157d50fdb73d3e6cf2dc386ec1be2c5289aa 100644 (file)
 
 #include "bitset.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 typedef bitset * bitsetv;
 
 /* Free vector of bitsets.  Do nothing if NULL.  */
@@ -68,4 +73,9 @@ void debug_bitsetv (bitsetv);
 /* Dump vector of bitsets as a matrix.  */
 void bitsetv_matrix_dump (FILE *, const char *, bitsetv);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif  /* _BITSETV_H  */
index 26e05c93c3338d4f5d20f8997a6e272ae2c21638..0348c559ca9a2d7e13c34b5a9233080c38d35fbe 100644 (file)
 #include "c-strcase.h"
 #include "c-ctype.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* STRCASEEQ allows to optimize string comparison with a small literal string.
      STRCASEEQ (s, "UTF-8", 'U','T','F','-','8',0,0,0,0)
    is semantically equivalent to
@@ -179,3 +184,8 @@ strcaseeq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s
   (c_strcasecmp (s1, s2) == 0)
 
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index 3c7e5785cd295f70070bb9de75015d4f6b47e866..5565bd89a68e5645bffff8e2abc2676c63416fea 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef CANON_HOST_H
-# define CANON_HOST_H 1
+#define CANON_HOST_H 1
 
 /* This file uses _GL_ATTRIBUTE_MALLOC.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stdlib.h>
 
 char *canon_host (char const *host)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
@@ -33,6 +38,11 @@ char *canon_host_r (char const *host, int *cherror)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
 const char *ch_strerror (void);
-# define ch_strerror_r(cherror) gai_strerror (cherror);
+#define ch_strerror_r(cherror) gai_strerror (cherror);
+
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !CANON_HOST_H */
index 473e6531e67acacf02c8ddb8f5b1eff8ab2d635b..2c552b692af7a141eff971a2ac74912840326c1d 100644 (file)
 #include <fcntl.h>
 #include <unistd.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct allocator;
 
 /* Assuming the current directory is FD, get the symbolic link value
@@ -69,4 +74,9 @@ char *careadlinkat (int fd, char const *filename,
 # endif
 #endif
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_CAREADLINKAT_H */
index 2f24fa08ebfb9c02520d20ff8efe93d931af58a8..c679d11f4611043850143c74201e499663c8ba26 100644 (file)
 
 #include "pathmax.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* On systems without PATH_MAX, presume that chdir accepts
    arbitrarily long directory names.  */
 #ifndef PATH_MAX
@@ -28,3 +33,8 @@
 #else
 int chdir_long (char *dir);
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index 43193a7b03c276bc560c23aae8f44f2f4b6cf972..01750eac768cb63884fc59b86eeee88a882ee429 100644 (file)
 #ifndef CHECK_VERSION_H
 # define CHECK_VERSION_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern const char *
 check_version (const char *req_version);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* CHECK_VERSION_H */
index 665dc60c89e5b5eb72320edacb0aa530bfc2b192..d4c199b8c11c556d7b8f1b4c75e458fd487c8a10 100644 (file)
  #error "Please include config.h first."
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Return the new CLASSPATH value.  The given classpaths are prepended to
    the current CLASSPATH value.   If use_minimal_classpath, the current
    CLASSPATH is ignored.  */
@@ -35,3 +40,8 @@ extern char * set_classpath (const char * const *classpaths,
 
 /* Restore CLASSPATH to its previous value.  */
 extern void reset_classpath (char *old_classpath);
+
+
+#ifdef __cplusplus
+}
+#endif
index f52e5f2ec0fbcb862f22751328038866eb9fca0e..a7944d6dd5dd711cb9b432251c098e65af109bc2 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
    or clear the flag if VALUE is false.
    Return 0 on success, or -1 on error with 'errno' set.
@@ -32,3 +37,8 @@ int set_cloexec_flag (int desc, bool value);
    be duplicated.  */
 
 int dup_cloexec (int fd);
+
+
+#ifdef __cplusplus
+}
+#endif
index 8a1b3c7ac2c9da3ca85b2e87906f3d5c6e63161d..3c421dce5137a6817b3e91e909c69403993d283f 100644 (file)
 
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int close_stream (FILE *stream);
+
+
+#ifdef __cplusplus
+}
+#endif
index 7312443794d00b8050b0fbc5fbd0dcf9df8c45d8..4014216cc33489acedefc61ee73def07fa1ce0f9 100644 (file)
--- a/lib/crc.h
+++ b/lib/crc.h
 /* Written by Simon Josefsson.  */
 
 #ifndef CRC_H
-# define CRC_H 1
+#define CRC_H 1
 
 #include <stddef.h>
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compute CRC-32 value of LEN bytes long BUF, and return it. */
 extern uint32_t crc32 (const char *buf, size_t len);
 
@@ -44,4 +49,9 @@ extern uint32_t crc32_no_xor (const char *buf, size_t len);
 extern uint32_t
 crc32_update_no_xor (uint32_t crc, const char *buf, size_t len);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* CRC_H */
index 1bad3d7c482b8f9823738cf15f71f9974a1aacac..4311aa100c822fcacee9d2710be89a287d89a8de 100644 (file)
 #ifndef _CSHARPCOMP_H
 #define _CSHARPCOMP_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compile a set of C# source files to bytecode.
    sources is an array of source file names, including resource files.
    libdirs is a list of directories to be searched for libraries.
@@ -35,4 +40,9 @@ extern bool compile_csharp_class (const char * const *sources,
                                   bool optimize, bool debug,
                                   bool verbose);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _CSHARPCOMP_H */
index 7f798b6318ebb285f7e9b22be092c10e76b49bfe..96b0dcf9c2dae6530a087e9afe6156c871d62d27 100644 (file)
 #ifndef _CSHARPEXEC_H
 #define _CSHARPEXEC_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 typedef bool execute_fn (const char *progname,
                          const char *prog_path, const char * const *prog_argv,
                          void *private_data);
@@ -38,4 +43,9 @@ extern bool execute_csharp_program (const char *assembly_path,
                                     bool verbose, bool quiet,
                                     execute_fn *executer, void *private_data);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _CSHARPEXEC_H */
index 92d385fa0b7f0a1f55d8070423e212fb69d67da6..d0e3d852b55487579b8aee5f60452cc391c5de53 100644 (file)
 /* Written by Jim Meyering */
 
 #ifndef CYCLE_CHECK_H
-# define CYCLE_CHECK_H 1
+#define CYCLE_CHECK_H 1
+
+#include <stdint.h>
+#include "dev-ino.h"
+#include "same-inode.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stdint.h>
-# include "dev-ino.h"
-# include "same-inode.h"
 
 struct cycle_check_state
 {
@@ -34,7 +39,7 @@ struct cycle_check_state
 void cycle_check_init (struct cycle_check_state *state);
 bool cycle_check (struct cycle_check_state *state, struct stat const *sb);
 
-# define CYCLE_CHECK_REFLECT_CHDIR_UP(State, SB_dir, SB_subdir) \
+#define CYCLE_CHECK_REFLECT_CHDIR_UP(State, SB_dir, SB_subdir) \
   do                                                            \
     {                                                           \
       /* You must call cycle_check at least once before using this macro.  */ \
@@ -48,4 +53,9 @@ bool cycle_check (struct cycle_check_state *state, struct stat const *sb);
     }                                                           \
   while (0)
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index c4a1784d5507852795481c9544a891862f5a4707..b8057a4209e05da748147b20b3c7e4ddfb79a13f 100644 (file)
--- a/lib/des.h
+++ b/lib/des.h
 /* Adapted for gnulib by Simon Josefsson, based on Libgcrypt. */
 
 #ifndef DES_H
-# define DES_H
+#define DES_H
 
 #include <stddef.h>
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /*
  * Encryption/Decryption context of DES
  */
@@ -115,4 +120,9 @@ gl_3des_ecb_crypt (gl_3des_ctx *ctx,
 #define gl_3des_ecb_encrypt(ctx, from, to) gl_3des_ecb_crypt(ctx,from,to,0)
 #define gl_3des_ecb_decrypt(ctx, from, to) gl_3des_ecb_crypt(ctx,from,to,1)
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* DES_H */
index 13e500289c59b88c39cf45b2027b143ce572be4d..38cb88deafc12af21235fc42d730141e370dd8ab 100644 (file)
 /* Written by Jim Meyering, 2003.  */
 
 #ifndef DEV_INO_H
-# define DEV_INO_H 1
+#define DEV_INO_H 1
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <sys/types.h>
-# include <sys/stat.h>
 
 struct dev_ino
 {
@@ -28,4 +33,9 @@ struct dev_ino
   dev_t st_dev;
 };
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index aa59a01f4624aedc56a0cbd39cb0dc5bd58652d1..215532fe4b358158602d3cc25b9e6ff2d332ce3f 100644 (file)
 /* Written by Jim Meyering, 2010.  */
 
 #ifndef _GL_DI_SET_H
-# define _GL_DI_SET_H
+#define _GL_DI_SET_H
 
 /* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
    _GL_ATTRIBUTE_NONNULL.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <sys/types.h>
 
 struct di_set;
 
@@ -39,4 +44,9 @@ int di_set_insert (struct di_set *, dev_t, ino_t) _GL_ATTRIBUTE_NONNULL ((1));
 int di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino)
   _GL_ATTRIBUTE_NONNULL ((1));
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 5cb274be8eabfc83a7012d2b29548bfbd8f52b3a..ff31da49cdc4ce37357d6a568793311d98cb3153 100644 (file)
@@ -45,6 +45,11 @@ _GL_INLINE_HEADER_BEGIN
 # define EEALLOC_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #if MALLOC_0_IS_NONNULL
 # define eemalloc malloc
 #else
@@ -95,6 +100,11 @@ eerealloc (void *p, size_t n)
     eenrealloc (void *p, size_t n, size_t s) - like eerealloc (p, n * s)
    If this would be useful in your application. please speak up.  */
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _EEALLOC_H */
index 0783b087326e6b09cc69f45251b70b1a4840c8e4..12743cf74593c2849b4a9d23fcabcc32f26b82a7 100644 (file)
@@ -16,6 +16,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* Written by Paul Eggert <eggert@twinsun.com>
+   and Sergey Poznyakoff <gray@gnu.org> */
+
 #ifndef _GL_EXCLUDE_H
 #define _GL_EXCLUDE_H 1
 
 
 #include <stdio.h>
 
-/* Written by Paul Eggert <eggert@twinsun.com>
-   and Sergey Poznyakoff <gray@gnu.org> */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 /* Exclude options, which can be ORed with fnmatch options.  */
 
@@ -67,4 +72,9 @@ bool excluded_file_name (struct exclude const *, char const *);
 void exclude_add_pattern_buffer (struct exclude *ex, char *buf);
 bool exclude_fnmatch (char const *, char const *, int);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_EXCLUDE_H */
index 0ffb2c386e797861b1ce2307d59b2eb31b81c710..e017947bca4fe28938d3af957fc8fd1fa498ac15 100644 (file)
@@ -30,6 +30,11 @@ _GL_INLINE_HEADER_BEGIN
 # define _GL_EXECINFO_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 _GL_EXECINFO_INLINE int
 backtrace (void **buffer, int size)
 {
@@ -54,6 +59,11 @@ backtrace_symbols_fd (void *const *buffer, int size, int fd)
   (void) fd;
 }
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif
index da50e9224d8945d1ff76d293e65c72a892ce8414..27ac081f5e02c6f6f50b9646ec314da53106eb75 100644 (file)
 #ifndef _EXECUTE_H
 #define _EXECUTE_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Execute a command, optionally redirecting any of the three standard file
    descriptors to /dev/null.  Return its exit code.
    If it didn't terminate correctly, exit if exit_on_error is true, otherwise
@@ -51,4 +56,9 @@ extern int execute (const char *progname,
                     bool slave_process, bool exit_on_error,
                     int *termsigp);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _EXECUTE_H */
index 20ac506b4a55461a98cffe499539f159cb441fb2..fa264b5c8c1a7c139a7b1d951322a165f5274c01 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern int volatile exit_failure;
+
+
+#ifdef __cplusplus
+}
+#endif
index 75f7142e306c0207db5ebb4fb8264a2666bd7bff..347cac0bd153630c7a2cacad5750b79615732a34 100644 (file)
 
 #include <sys/types.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int open_safer (char const *, int, ...);
 int creat_safer (char const *, mode_t);
 
 #if GNULIB_OPENAT_SAFER
 int openat_safer (int, char const *, int, ...);
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index 17e89ca1544a03fa7e74b66eea187247c0ea9006..d4c977b0b08d94f69a4c52e57cf005a3e5e2263c 100644 (file)
 
 #include "hash.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern void record_file (Hash_table *ht, char const *file,
                          struct stat const *stats)
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
@@ -30,3 +35,8 @@ extern void record_file (Hash_table *ht, char const *file,
 
 extern bool seen_file (Hash_table const *ht, char const *file,
                        struct stat const *stats);
+
+
+#ifdef __cplusplus
+}
+#endif
index 7ca0357aef4228021aec2dd3b330506df3ea4504..862c4b493e118c1463efbcd51a6fbb98df427a91 100644 (file)
 /* Written by Paul Eggert and Jim Meyering.  */
 
 #ifndef FILE_TYPE_H
-# define FILE_TYPE_H 1
+#define FILE_TYPE_H 1
 
 /* This file uses _GL_ATTRIBUTE_PURE.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <sys/types.h>
-# include <sys/stat.h>
 
 char const *c_file_type (struct stat const *) _GL_ATTRIBUTE_PURE;
 char const *file_type (struct stat const *) _GL_ATTRIBUTE_PURE;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* FILE_TYPE_H */
index 8c8cf44199d1fcd586ebbe7edcf45987efcb1e7b..618fb314bbee09e6ed010f552e0a85b05b0e13ec 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #if GNULIB_FILENAMECAT
 char *file_name_concat (char const *dir, char const *base,
                         char **base_in_result)
@@ -35,3 +40,8 @@ char *file_name_concat (char const *dir, char const *base,
 char *mfile_name_concat (char const *dir, char const *base,
                          char **base_in_result)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+
+#ifdef __cplusplus
+}
+#endif
index 8c549fcda00730b12e58af1f71b64e87d194c424..81f821d5267bc6902e5e2acf88485f1613c653e6 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compare strings A and B as file names containing version numbers,
    and return an integer that is negative, zero, or positive depending
    on whether A compares less than, equal to, or greater than B.
@@ -80,4 +85,9 @@ int filevercmp (char const *a, char const *b) _GL_ATTRIBUTE_PURE;
 int filenvercmp (char const *a, ptrdiff_t alen, char const *b, ptrdiff_t blen)
   _GL_ATTRIBUTE_PURE;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* FILEVERCMP_H */
index 28db3b403d99760c01981b17573cd89c4198d899..345c0bc71d98562a59fa8fdec0c4e18329401ac8 100644 (file)
 # include <stdio_ext.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #if !HAVE_DECL___FPENDING
 size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE;
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index a36325bf38222822b6efb90e02090bcd6f04711a..0001fef0271848840aefa8487171f5e2eee283dc 100644 (file)
 #include <stdio.h>
 #include <time.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* A cross between fprintf and nstrftime, that prints directly
    to the output stream, without the need for the potentially
    large buffer that nstrftime would require.
@@ -27,3 +32,8 @@
    and NANOSECONDS values.  */
 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
                     timezone_t zone, int nanoseconds);
+
+
+#ifdef __cplusplus
+}
+#endif
index c7387a22992aae67a764c099266ae61eff9c60e1..fdc53b811b16251baa2f90f9c1e3b63acd51ca48 100644 (file)
                                     'long double' safe operation precision
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Inline assembler like this works only with GNU C and clang.  */
 #if (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __clang__)
 
@@ -105,4 +110,9 @@ typedef unsigned int fpucw_t;
 
 #endif
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FPUCW_H */
index d7ae5f63a36c1bec169744869f38a97745a1e817..da87859060caa73bdf2c1a88885d4ccba45940d0 100644 (file)
 /* Space usage statistics for a file system.  Blocks are 512-byte. */
 
 #if !defined FSUSAGE_H_
-# define FSUSAGE_H_
+#define FSUSAGE_H_
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stdint.h>
 
 struct fs_usage
 {
@@ -36,4 +41,9 @@ struct fs_usage
 
 int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index ed43c961a0421441a5a1197251a04b58f5432d61..94554863a1e199576a0a0c9ae25e2766ddc232ac 100644 (file)
 #include <float.h>
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Store into BUF (of size BUFSIZE) an accurate minimal-precision
    string representation of a floating point number.  FLAGS affect the
    formatting of the number.  Pad the output string with spaces as
@@ -149,4 +154,9 @@ enum
 #define  DBL_BUFSIZE_BOUND ( DBL_STRLEN_BOUND + 1)
 #define LDBL_BUFSIZE_BOUND (LDBL_STRLEN_BOUND + 1)
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_FTOASTR_H */
index 5f73a19ae978394d9712bfd7213f60c7f2686373..617702a60b3db97da99d31f589413196ee5e1818 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Read COUNT bytes at BUF to descriptor FD, retrying if interrupted
    or if partial reads occur.  Return the number of bytes successfully
    read, setting errno if that is less than COUNT.  errno = 0 means EOF.  */
 extern size_t full_read (int fd, void *buf, size_t count);
+
+
+#ifdef __cplusplus
+}
+#endif
index 0f28f8356fdd6a77c58e17448494d800ed7834b4..51ad0dd7e1c54c450c1f985788af976d5b81db91 100644 (file)
--- a/lib/gc.h
+++ b/lib/gc.h
  */
 
 #ifndef _GL_GC_H
-# define _GL_GC_H
+#define _GL_GC_H
 
 /* This file uses _GL_ATTRIBUTE_CONST.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
 
 /* Get size_t. */
-# include <stddef.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 enum Gc_rc
 {
@@ -337,4 +342,9 @@ gc_pbkdf2_sha1 (const char *P, size_t Plen,
   Simon
  */
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_GC_H */
index ed50d36ea41037b8f68beab7c084e617391702bd..34cfa2d4f1bf6286495b870d870f1161e2ff7870 100644 (file)
 #include <stdio.h>
 #include <sys/types.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #define GETNLINE_NO_LIMIT ((size_t) -1)
 
 /* Read into a buffer *LINEPTR returned from malloc (or NULL),
@@ -39,4 +44,9 @@ extern ssize_t getndelim2 (char **lineptr, size_t *linesize, size_t offset,
                            size_t nmax, int delim1, int delim2,
                            FILE *stream);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GETNDELIM2_H */
index 0f27e64a4469e9e01ae0d251e4ab798174e4ff76..d16c6ae55390ea37395f54b2713c502246b406f6 100644 (file)
 #include <stdio.h>
 #include <sys/types.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #define GETNLINE_NO_LIMIT ((size_t) -1)
 
 /* Read a line, up to the next newline, from STREAM, and store it in *LINEPTR.
@@ -44,4 +49,9 @@ extern ssize_t getnline (char **lineptr, size_t *linesize, size_t nmax,
 extern ssize_t getndelim (char **lineptr, size_t *linesize, size_t nmax,
                           int delimiter, FILE *stream);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GETNLINE_H */
index 1fa4fd360d26ff4a60ec73ea79dd855b3d3d9ccd..c5cfd314d0a2ab80effaa8490e8e3b088a7cb664 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int getugroups (int maxcount, gid_t *grouplist, char const *username,
                 gid_t gid);
+
+
+#ifdef __cplusplus
+}
+#endif
index 20ec62d2b94a319b3f1392d67bdba02c0c33d107..ab8839f422524f5f474b8a6fa0df890165778d3a 100644 (file)
 
 # include <threads.h>
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* ------------------------- gl_tls_key_t datatype ------------------------- */
 
 typedef tss_t gl_tls_key_t;
@@ -83,6 +87,10 @@ typedef tss_t gl_tls_key_t;
 # define glthread_tls_key_destroy(KEY) \
     (tss_delete (*(KEY)), 0)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -93,6 +101,10 @@ typedef tss_t gl_tls_key_t;
 
 # include <pthread.h>
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 # if PTHREAD_IN_USE_DETECTION_HARD
 
 /* The pthread_in_use() detection needs to be done at runtime.  */
@@ -151,6 +163,10 @@ typedef union
 # define glthread_tls_key_destroy(KEY) \
     (pthread_in_use () ? pthread_key_delete ((KEY)->key) : 0)
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -162,6 +178,10 @@ typedef union
 
 # include "windows-tls.h"
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* ------------------------- gl_tls_key_t datatype ------------------------- */
 
 typedef glwthread_tls_key_t gl_tls_key_t;
@@ -174,6 +194,10 @@ typedef glwthread_tls_key_t gl_tls_key_t;
 # define glthread_tls_key_destroy(KEY) \
     glwthread_tls_key_delete (*(KEY))
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
@@ -182,6 +206,10 @@ typedef glwthread_tls_key_t gl_tls_key_t;
 
 /* Provide dummy implementation if threads are not supported.  */
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* ------------------------- gl_tls_key_t datatype ------------------------- */
 
 typedef struct
@@ -200,6 +228,10 @@ typedef struct
 # define glthread_tls_key_destroy(KEY) \
     0
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 /* ========================================================================= */
index 91d2f15e571213874ffba76ba66b7cefb246b0f1..a25c6127311254889d9104959976a0bd34bae0a7 100644 (file)
@@ -74,6 +74,11 @@ _GL_INLINE_HEADER_BEGIN
 #include <stddef.h>
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Hash values are of type size_t.  For each level of the trie, we use
    5 bits (corresponding to lg2 of the width of a 32-bit word.  */
 #define _GL_HAMT_MAX_DEPTH ((SIZE_WIDTH + 4) / 5)
@@ -259,6 +264,11 @@ extern bool hamt_replace_x (Hamt *hamt, Hamt_entry *elt);
    false.  */
 extern bool hamt_remove_x (Hamt *hamt, Hamt_entry *elt);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _GL_HAMT_H */
index 21c5c546d3667d0e0a0a7da6c86c5297af368a8d..5d40e522a40b2a6a2322a7ee544fd7da217cbd55 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef HARD_LOCALE_H_
-# define HARD_LOCALE_H_ 1
+#define HARD_LOCALE_H_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 /* Return true if the specified CATEGORY of the current locale is hard, i.e.
    different from the C or POSIX locale that has a fixed behavior.
@@ -25,4 +30,9 @@
    per-thread locale.  */
 extern bool hard_locale (int category);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* HARD_LOCALE_H_ */
index ed5e11efc0177d928a4614aee9e360a0568dc621..fe74805def00bf7260cd2328b9285fc937c23219 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compute a hash code for a buffer starting at X and of size N,
    and return the hash code.  Note that unlike hash_pjw(), it does not
    return it modulo a table size.
    The result is platform dependent: it depends on the size of the 'size_t'
    type.  */
 extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
index 7c60d16f58a87071d75df26b52d36598991d7b00..2962dfc4b43b72d85e59e10c418a9fee15d0098d 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compute a hash code for a NUL-terminated string starting at X,
    and return the hash code modulo TABLESIZE.
    The result is platform dependent: it depends on the size of the 'size_t'
    type and on the signedness of the 'char' type.  */
 extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
index 9135e73435f7a950eda0ac5717c3196206ca92ce..b80ea577cc44d01d0c6f54e11ea69254ab22b6f6 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Describe a just-created or just-renamed destination file.  */
 struct F_triple
 {
@@ -47,4 +52,9 @@ extern size_t triple_hash_no_name (void const *x, size_t table_size)
   _GL_ATTRIBUTE_PURE;
 extern bool triple_compare (void const *x, void const *y);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index cf1cd6efb143c07fcfcd37e89ed66fc89390e490..41b27122a23fc7ba7c32367f99999d229d7918a4 100644 (file)
 /* Written by Simon Josefsson.  */
 
 #ifndef HMAC_H
-# define HMAC_H 1
+#define HMAC_H 1
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compute Hashed Message Authentication Code with MD5, as described
    in RFC 2104, over BUFFER data of BUFLEN bytes using the KEY of
    KEYLEN bytes, writing the output to pre-allocated 16 byte minimum
@@ -53,4 +58,9 @@ int
 hmac_sha512 (const void *key, size_t keylen,
              const void *in, size_t inlen, void *restrict resbuf);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* HMAC_H */
index f89e7640b2db13a58efb1cc112c7e58c7bdee23b..6d8a59830a9e2a47794c1a68f2892061c8657777 100644 (file)
 /* Written by Paul Eggert and Larry McVoy.  */
 
 #ifndef HUMAN_H_
-# define HUMAN_H_ 1
+#define HUMAN_H_ 1
 
-# include <limits.h>
-# include <stdint.h>
-# include <unistd.h>
+#include <limits.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include <xstrtol.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <xstrtol.h>
 
 /* A conservative bound on the maximum length of a human-readable string.
    The output can be the square of the largest uintmax_t, so double
@@ -34,7 +39,7 @@
    so multiply by MB_LEN_MAX + 1 and then subtract MB_LEN_MAX.
    Append 1 for a space before the suffix.
    Finally, append 3, the maximum length of a suffix.  */
-# define LONGEST_HUMAN_READABLE \
+#define LONGEST_HUMAN_READABLE \
   ((2 * sizeof (uintmax_t) * CHAR_BIT * 146 / 485 + 1) * (MB_LEN_MAX + 1) \
    - MB_LEN_MAX + 1 + 3)
 
@@ -79,4 +84,9 @@ char *human_readable (uintmax_t, char *, int, uintmax_t, uintmax_t);
 
 enum strtol_error human_options (char const *, int *, uintmax_t *);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* HUMAN_H_ */
index 7a493f670113613c4928aad775cc523ad384b36f..2dfcd40658b5810bddd217c2f70ab9511d0a608d 100644 (file)
  #error "Please include config.h first."
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 enum { I_RING_SIZE = 4 };
 static_assert (1 <= I_RING_SIZE);
 
@@ -45,3 +50,8 @@ void i_ring_init (I_ring *ir, int ir_default_val);
 int i_ring_push (I_ring *ir, int val);
 int i_ring_pop (I_ring *ir);
 bool i_ring_empty (I_ring const *ir) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
index 55f3ab7596f59a42f129e61e40bb0abcfaa8c5d1..89014162a0d515e8ae2267be6b88ee53bb831692 100644 (file)
 /* Written by Jim Meyering, 2007.  */
 
 #ifndef IDCACHE_H
-# define IDCACHE_H 1
+#define IDCACHE_H 1
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <sys/types.h>
 
 extern char *getuser (uid_t uid);
 extern char *getgroup (gid_t gid);
 extern uid_t *getuidbyname (const char *user);
 extern gid_t *getgidbyname (const char *group);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index f9ce0acd57d019a78241c360904bdd3118031e8a..43793f2d6257bc662e6b444ac7af838986500e7f 100644 (file)
--- a/lib/idx.h
+++ b/lib/idx.h
        help producing good code and good warnings.  The type 'idx_t' could
        then be typedef'ed to a range type that is signed after promotion.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* In the future, idx_t could be typedef'ed to a signed range type.
    The clang "extended integer types", supported in Clang 11 or newer
    <https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>,
@@ -131,4 +136,9 @@ typedef ptrdiff_t idx_t;
    Perhaps there should be another macro IDX_VALUE_BITS that does not
    count the sign bit and is therefore one less than PTRDIFF_WIDTH.  */
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _IDX_H */
index 4aa33754e492a1d1585c99c97295c10fee8908dc..06dd4af6caf6a4d28de0e69ab32101731ae95717 100644 (file)
 /* Written by Paul Eggert, 2010.  */
 
 #ifndef _GL_INO_MAP_H
-# define _GL_INO_MAP_H
+#define _GL_INO_MAP_H
 
 /* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
    _GL_ATTRIBUTE_NONNULL.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <sys/types.h>
 
-# define INO_MAP_INSERT_FAILURE ((size_t) -1)
+#define INO_MAP_INSERT_FAILURE ((size_t) -1)
 
 struct ino_map;
 
@@ -38,4 +43,9 @@ struct ino_map *ino_map_alloc (size_t)
 
 size_t ino_map_insert (struct ino_map *, ino_t) _GL_ATTRIBUTE_NONNULL ((1));
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 51cadf42e85ea7b3e91b4de939d2b11507df1090..8f1bb36e686cdbd3f000fcb91882569e9930705f 100644 (file)
 
 #include "intprops.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 _GL_ATTRIBUTE_NODISCARD char *imaxtostr (intmax_t, char *);
 _GL_ATTRIBUTE_NODISCARD char *inttostr (int, char *);
 _GL_ATTRIBUTE_NODISCARD char *offtostr (off_t, char *);
 _GL_ATTRIBUTE_NODISCARD char *uinttostr (unsigned int, char *);
 _GL_ATTRIBUTE_NODISCARD char *umaxtostr (uintmax_t, char *);
+
+
+#ifdef __cplusplus
+}
+#endif
index affdca8a9612a8da61e0fb62fc8a988979be3862..b86cf26367840dd7a4bb1f2424160f926cb6fa7a 100644 (file)
  #error "Please include config.h first."
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Whether pipes are FIFOs; -1 if not known.  */
 #ifndef HAVE_FIFO_PIPES
 # define HAVE_FIFO_PIPES (-1)
 #endif
 
 int isapipe (int fd);
+
+
+#ifdef __cplusplus
+}
+#endif
index 4d8b0e8f53a60e049d43c006e00bd5b4d8fdd6b1..925e71d17ab69c37abb3864cad943b2fc617bd00 100644 (file)
@@ -34,5 +34,9 @@
 /* Test whether X is a NaN.  */
 # undef isnand
 # define isnand rpl_isnand
-extern int isnand (double x);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int isnand (double x);
 #endif
index 520b8147d27064b05440f58331ccb925528362d7..06f0cbb70d1082cc9c118589293f42bd87193b7b 100644 (file)
 #  if defined __sgi
    /* We can't include <ieeefp.h>, because it conflicts with our definition of
       isnand.  Therefore declare isnanf separately.  */
-extern int isnanf (float x);
+extern
+#   ifdef __cplusplus
+"C"
+#   endif
+int isnanf (float x);
 #  endif
 # endif
 #else
 /* Test whether X is a NaN.  */
 # undef isnanf
 # define isnanf rpl_isnanf
-extern int isnanf (float x);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int isnanf (float x);
 #endif
index 3ea82f7d7d0c3220eb3fac48d0b944859eb18d3b..0b6755cd820f4f6bc7595f5633a7a3cd0980f56a 100644 (file)
@@ -35,5 +35,9 @@
 /* Test whether X is a NaN.  */
 # undef isnanl
 # define isnanl rpl_isnanl
-extern int isnanl (long double x);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int isnanl (long double x);
 #endif
index 84e5b24481c71404eac3810d63aa18a91b7e2918..af42f000eadb30c228b05f5f1cbac045c0a5dd1e 100644 (file)
 #ifndef _JAVACOMP_H
 #define _JAVACOMP_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compile a Java source file to bytecode.
    java_sources is an array of source file names.
    classpaths is a list of pathnames to be prepended to the CLASSPATH.
@@ -85,4 +90,9 @@ extern bool compile_java_class (const char * const *java_sources,
                                 bool use_minimal_classpath,
                                 bool verbose);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _JAVACOMP_H */
index 6d67b741b5b68fa61d2d8926b0400acd4ac77bce..671f87289aad90ac6c49e203f4499246eb1ef792 100644 (file)
 #ifndef _JAVAEXEC_H
 #define _JAVAEXEC_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 typedef bool execute_fn (const char *progname,
                          const char *prog_path, const char * const *prog_argv,
                          void *private_data);
@@ -45,4 +50,9 @@ extern bool execute_java_class (const char *class_name,
                                 bool verbose, bool quiet,
                                 execute_fn *executer, void *private_data);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _JAVAEXEC_H */
index db00627ee32a3c4d0797efbcef0722535de379ea..94aef3052695486099db307f967183cf22ec19db 100644 (file)
 # include <stddef.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Clears the instruction cache for addresses
    start <= address < end.
    We need this because some CPUs have separate data cache and instruction
@@ -186,3 +191,8 @@ clear_cache (void *start, void *end)
 # error "Don't know how to implement clear_cache on this platform."
 #endif
 }
+
+
+#ifdef __cplusplus
+}
+#endif
index ae0d55dd02610ee960679ffd883ad72fcd5bd87a..9be2eca8eb7d63caeb4d78046b8dc94c25ef8148 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if !defined LINEBUFFER_H
-# define LINEBUFFER_H
+#define LINEBUFFER_H
+
+#include "idx.h"
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include "idx.h"
-# include <stdio.h>
 
 /* A 'struct linebuffer' holds a line of text. */
 
@@ -51,4 +56,9 @@ struct linebuffer *readlinebuffer (struct linebuffer *linebuffer, FILE *stream);
 /* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */
 void freebuffer (struct linebuffer *);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LINEBUFFER_H */
index c75d75f8366cc9ee3ffa3fdf6cde695789a9250f..f8863edf53d0021817ee041d9ff0a728ba0724e7 100644 (file)
 # include <uchar.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct localeinfo
 {
   /* MB_CUR_MAX > 1.  */
@@ -64,3 +69,8 @@ extern void init_localeinfo (struct localeinfo *);
 enum { CASE_FOLDED_BUFSIZE = 32 };
 
 extern int case_folded_counterparts (wint_t, char32_t[CASE_FOLDED_BUFSIZE]);
+
+
+#ifdef __cplusplus
+}
+#endif
index 61e90f9ebf4d4eca74ff9f9dd1180bfc33405baa..a32a13024d091e82191da4a23cd1c32c38215418 100644 (file)
 #ifndef LONG_OPTIONS_H_
 # define LONG_OPTIONS_H_ 1
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 void parse_long_options (int _argc,
                          char **_argv,
                          const char *_command_name,
@@ -37,4 +42,9 @@ void parse_gnu_standard_options_only (int argc,
                                       void (*usage_func) (int),
                                       /* const char *author1, ...*/ ...);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LONG_OPTIONS_H_ */
index c06ef11b14bda0423c96fe6d9e21bfb74a328551..5a1529ddcbb0fa2a24251d7420dc1d20d467ce07 100644 (file)
@@ -157,6 +157,11 @@ _GL_INLINE_HEADER_BEGIN
 # define MBCHAR_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* The longest multibyte characters, nowadays, are 4 bytes long.
    Regardless of the values of MB_CUR_MAX and MB_LEN_MAX.  */
 #define MBCHAR_BUF_SIZE 4
@@ -368,6 +373,11 @@ is_basic (char c)
 
 #endif
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _MBCHAR_H */
index bea5513f996f947bf6a4ffde1f5aa9227a0cec83..fe83eb648b1debe9af9df9137001394bee8779ed 100644 (file)
@@ -64,6 +64,11 @@ _GL_INLINE_HEADER_BEGIN
 # define MBFILE_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct mbfile_multi {
   FILE *fp;
   bool eof_seen;
@@ -262,6 +267,11 @@ typedef mbchar_t mbf_char_t;
 
 #define mb_iseof(mbc) ((mbc).bytes == 0)
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _MBFILE_H */
index cb7950df416c712dd6df5c453ba42f4f121c0457..bee76d2f81f73180a4a9558595d3b20da06551de 100644 (file)
@@ -101,6 +101,11 @@ _GL_INLINE_HEADER_BEGIN
 # define MBITER_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct mbiter_multi
 {
   const char *limit;    /* pointer to end of string */
@@ -263,6 +268,11 @@ typedef struct mbiter_multi mbi_iterator_t;
 /* Copying an iterator.  */
 #define mbi_copy mbiter_multi_copy
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _MBITER_H */
index 28d2f8ce0255d0c95daa58da5a75bf55c96141b6..c57815c5b01ef509d057c03c73e5a633ff752496 100644 (file)
@@ -92,6 +92,11 @@ _GL_INLINE_HEADER_BEGIN
 # define MBITERF_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct mbif_state
 {
   #if !GNULIB_MBRTOC32_REGULAR
@@ -199,6 +204,11 @@ typedef struct mbif_state mbif_state_t;
 #define mbif_next(st, iter, endptr) \
   mbiterf_next (&(st), (iter), (endptr))
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _MBITERF_H */
index 9af3c98e73f7e769d95f79ede13c9a1f898495c3..1860311d4c5c87d8697eed408da6eb6cd80f0413 100644 (file)
@@ -110,6 +110,11 @@ _GL_INLINE_HEADER_BEGIN
 # define MBUITER_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct mbuiter_multi
 {
   #if !GNULIB_MBRTOC32_REGULAR
@@ -262,6 +267,11 @@ typedef struct mbuiter_multi mbui_iterator_t;
 /* Copying an iterator.  */
 #define mbui_copy mbuiter_multi_copy
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _MBUITER_H */
index 22e84627d7b3932d3bff1f934705aecd12415f2d..1814e35b9d1f0ca284a16ecb5fc897e75442e47d 100644 (file)
@@ -101,6 +101,11 @@ _GL_INLINE_HEADER_BEGIN
 # define MBUITERF_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct mbuif_state
 {
   #if !GNULIB_MBRTOC32_REGULAR
@@ -208,6 +213,11 @@ typedef struct mbuif_state mbuif_state_t;
 #define mbuif_next(st, iter) \
   mbuiterf_next (&(st), (iter))
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _MBUITERF_H */
index f6f006c90097c0cd2ddd7cf7025c7ee27dc66e8b..7d92d2460152bca6edb43db07a8d7a60c13f45f0 100644 (file)
 #include <stddef.h>
 #include <uchar.h>
 
+_GL_INLINE_HEADER_BEGIN
+#ifndef MCEL_INLINE
+# define MCEL_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Pacify GCC re type limits.  */
 #if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
 # pragma GCC diagnostic ignored "-Wtype-limits"
@@ -147,11 +157,6 @@ static_assert (CHAR_BIT == 8);
 # define _GL_UNLIKELY(cond) __builtin_expect ((cond), 0)
 #endif
 
-_GL_INLINE_HEADER_BEGIN
-#ifndef MCEL_INLINE
-# define MCEL_INLINE _GL_INLINE
-#endif
-
 /* mcel_t constructors.  */
 MCEL_INLINE mcel_t
 mcel_ch (char32_t ch, size_t len)
@@ -291,6 +296,11 @@ mcel_scanz (char const *p)
   return mcel_scant (p, '\0');
 }
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _MCEL_H */
index 185552850a6104cea9f6de8552a9bcbb4fa7bbfe..992768cf4adaa5fd11cf82ed35cfeceea6dc86c7 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int memcasecmp (const void *vs1, const void *vs2, size_t n) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
index db180b08db17f636701fdc93d3dd982ea6bcb71b..587a6c234b2b7f1042b02ed01200cbad9fa1a6ae 100644 (file)
 /* Contributed by Paul Eggert <eggert@twinsun.com>.  */
 
 #ifndef MEMCOLL_H_
-# define MEMCOLL_H_ 1
+#define MEMCOLL_H_ 1
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stddef.h>
 
 int memcoll (char *restrict, size_t, char *restrict, size_t);
 int memcoll0 (char const *, size_t, char const *, size_t);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* MEMCOLL_H_ */
index b250c62ee74cb134698660698677c983be4e8996..9d0c1f13c04445f7481fccf4f0e833a9161b696a 100644 (file)
    in Niels Möller's Nettle. */
 
 #ifndef MEMXOR_H
-# define MEMXOR_H
+#define MEMXOR_H
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compute binary exclusive OR of memory areas DEST and SRC, putting
    the result in DEST, of length N bytes.  Returns a pointer to
    DEST. */
 void *memxor (void *restrict dest, const void *restrict src, size_t n);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* MEMXOR_H */
 
 /*
index 58fd1a61c479045ec5b5f36cc2ff8fb7564144c4..2cfdfe9e3f41de8ba149e56fadbfc5554b3b7489 100644 (file)
 
 #include <sys/types.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int mgetgroups (const char *username, gid_t gid, gid_t **groups);
 #if GNULIB_XGETGROUPS
 int xgetgroups (const char *username, gid_t gid, gid_t **groups);
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index 1a10bc308a119c83a11bd178c11cec90282c2323..92850560c36815906bf98f21f6ba215ba2c43b2e 100644 (file)
 
 #include <sys/types.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct savewd;
 bool make_dir_parents (char *dir,
                        struct savewd *wd,
@@ -32,3 +37,8 @@ bool make_dir_parents (char *dir,
                        uid_t owner,
                        gid_t group,
                        bool preserve_existing);
+
+
+#ifdef __cplusplus
+}
+#endif
index 3ee0bdec9d524dff5d78467336f179299cd8449a..633a72620cdb592542fe33397f2a752f0fe71577 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if ! defined MODECHANGE_H_
-# define MODECHANGE_H_
+#define MODECHANGE_H_
 
 /* This file uses _GL_ATTRIBUTE_MALLOC.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <stdlib.h>
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stdlib.h>
-# include <sys/types.h>
 
 struct mode_change *mode_compile (const char *)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
@@ -35,4 +40,9 @@ mode_t mode_adjust (mode_t, bool, mode_t, struct mode_change const *,
                     mode_t *)
   _GL_ATTRIBUTE_PURE;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 70b572a6982b5e630e95ac25030c98097f7e52f2..9728e38b7778f216bd5b3b52b7b4de6ef2f4df51 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef MOUNTLIST_H_
-# define MOUNTLIST_H_
+#define MOUNTLIST_H_
 
 /* This file uses _GL_ATTRIBUTE_MALLOC.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <sys/types.h>
 
 /* A mount table entry. */
 struct mount_entry
@@ -45,4 +50,9 @@ struct mount_entry *read_file_system_list (bool need_fs_type)
   _GL_ATTRIBUTE_MALLOC;
 void free_mount_entry (struct mount_entry *entry);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 6d135a5e0e539a9d501d0c8b3e094e4a48c9d12c..0e0b5f7a200ce0d338b5d3b18da576a44a618d89 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 void mpsort (void const **, size_t, int (*) (void const *, void const *));
+
+
+#ifdef __cplusplus
+}
+#endif
index dc6dd35d58e863f6d18b4e60e012cd7a581c9fb2..121773d1a79e35d2a45949c0d6844b7ff3dd8cef 100644 (file)
 /* Get original declaration of _get_osfhandle.  */
 # include <io.h>
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 # if HAVE_MSVC_INVALID_PARAMETER_HANDLER
 
 /* Override _get_osfhandle.  */
@@ -43,6 +47,10 @@ extern intptr_t _gl_nothrow_get_osfhandle (int fd);
 
 # endif
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 #endif /* _MSVC_NOTHROW_H */
index d540a0bb84301438a5ee81ed632f24fd1b5e002d..70fe813757ac9bd2cd8fe018d8f9d3deb49dfa28 100644 (file)
--- a/lib/nan.h
+++ b/lib/nan.h
@@ -17,7 +17,6 @@
 #ifndef _GL_NAN_H
 #define _GL_NAN_H
 
-
 /* IBM z/OS supports both hexadecimal and IEEE floating-point formats. The
    former does not support NaN and its isnan() implementation returns zero
    for all values.  */
 # error "NaN is not supported with IBM's hexadecimal floating-point format; please re-compile with -qfloat=ieee"
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* NaNf () returns a 'float' not-a-number.  */
 
 /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
@@ -94,4 +98,8 @@ NaNl ()
 #endif
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_NAN_H */
index 7fd4beb5a73a9e5750036472a43c0a673e63bbec..63093f4597e28a7c6b1048ea4f2dd48a8bfaa8e0 100644 (file)
 #include <limits.h>
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Maximum number of bytes that it is safe to allocate as a single
    array on the stack, and that is known as a compile-time constant.
    The assumption is that we'll touch the array very quickly, or a
@@ -61,4 +66,9 @@ int at_func2 (int fd1, char const *file1,
               int fd2, char const *file2,
               int (*func) (char const *file1, char const *file2));
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_HEADER_OPENAT_PRIV */
index dc34092bb3f1b48e7b5f72aad2a2d22819545abb..b6b94f68c75d8aa996b0eab8060f786a65d0cfbb 100644 (file)
 
 _GL_INLINE_HEADER_BEGIN
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #if !HAVE_OPENAT
 
 int openat_permissive (int fd, char const *file, int flags, mode_t mode,
@@ -122,6 +127,11 @@ lstatat (int fd, char const *name, struct stat *st)
    wrappers are not provided for accessat or euidaccessat, so as to
    avoid dragging in -lgen on some platforms.  */
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _GL_HEADER_OPENAT */
index f34291902d4d773c6f3ca8da251f42333efc48d7..618fc00829a46bf9b5b4eb7f51b94267e4ffbfbf 100644 (file)
 
 #include <dirent.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 DIR *opendirat (int, char const *, int, int *)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1);
+
+
+#ifdef __cplusplus
+}
+#endif
index b45796c31ddca7fb1d230be8a80e0296e52ec747..5460d79cc411b7bf10ca7989675b333405b208bc 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _PAGEALIGN_ALLOC_H
-# define _PAGEALIGN_ALLOC_H
+#define _PAGEALIGN_ALLOC_H
 
 /* This file uses _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_DEALLOC,
    _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NONNULL,
    _GL_ATTRIBUTE_RETURNS_NONNULL.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stddef.h>
 
 /* Free a memory block.
    PTR must be a non-NULL pointer returned by pagealign_alloc or
@@ -49,4 +54,9 @@ extern void *pagealign_xalloc (size_t size)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (pagealign_free, 1)
   _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _PAGEALIGN_ALLOC_H */
index 9a980f5baac64ade75b14f076f29fa1c91ebd7a8..784041f7b02aa93c2d7c262e006bce3b79cfbb3e 100644 (file)
 
 #include <time.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 bool parse_datetime (struct timespec *restrict,
                      char const *, struct timespec const *);
 
@@ -28,3 +33,8 @@ bool parse_datetime (struct timespec *restrict,
 bool parse_datetime2 (struct timespec *restrict,
                       char const *, struct timespec const *,
                       unsigned int flags, timezone_t, char const *);
+
+
+#ifdef __cplusplus
+}
+#endif
index b49a3dcb88b08c869ef4299493ffe35aa28907a7..bdd3dcb3aa15540d5de324633770ca223c9f0021 100644 (file)
 
 #include <time.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Return value when a valid duration cannot be parsed.  */
 #define BAD_TIME        ((time_t)~0)
 
@@ -87,4 +92,9 @@
    and errno is set to either EINVAL (bad syntax) or ERANGE (out of range).  */
 extern time_t parse_duration (char const * in_pz);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GNULIB_PARSE_DURATION_H */
index e471e82f5b2fc65e90013623285b13bcd778b008..957e6291807f6b3623787c57f045e91389ff9033 100644 (file)
 #ifndef PHYSMEM_H_
 # define PHYSMEM_H_ 1
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 double physmem_total (void);
 double physmem_available (void);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* PHYSMEM_H_ */
index f6b677da7ec03a1f2fff9b0d3f65bb3011fc23f7..74b4abea8f1d18c98422feb0445f7cadbe8fcd0f 100644 (file)
    Rewritten by Jim Meyering.  */
 
 #ifndef POSIXTM_H_
-# define POSIXTM_H_
+#define POSIXTM_H_
+
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <time.h>
 
 /* POSIX Date Syntax flags.  */
-# define PDS_TRAILING_YEAR 1
-# define PDS_CENTURY 2
-# define PDS_SECONDS 4
-# define PDS_PRE_2000 8
+#define PDS_TRAILING_YEAR 1
+#define PDS_CENTURY 2
+#define PDS_SECONDS 4
+#define PDS_PRE_2000 8
 
 /* For compatibility with older versions of this header, in which
    PDS_LEADING_YEAR had its own bit.  */
-# define PDS_LEADING_YEAR 0
+#define PDS_LEADING_YEAR 0
 
 bool posixtime (time_t *p, const char *s, unsigned int syntax_bits);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index c02be4605d6da44d664bfa4d36c28918f8aa089d..91ecf15dee84b54e04287e110d5ed8a4b3426034 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int posix2_version (void);
+
+
+#ifdef __cplusplus
+}
+#endif
index 4970c137271b638a91c04c1a43fa8270c806ac05..8467f98bc261ca8e26a93a04c4f5f26b15bfde6d 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Write a finite, positive number x as
      x = mantissa * 2^exp
    where exp >= DBL_MIN_EXP - 1,
@@ -21,3 +26,8 @@
          if x is not a denormalized number then mantissa >= 1.0.
    Store exp in *EXPPTR and return mantissa.  */
 extern double printf_frexp (double x, int *expptr);
+
+
+#ifdef __cplusplus
+}
+#endif
index b1adfd7f2767f8a2e7765db2e24eb291e1b1e154..11562ed373bfdfcb766fce3bb2ceee6b955a97ed 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Write a finite, positive number x as
      x = mantissa * 2^exp
    where exp >= LDBL_MIN_EXP - 1,
@@ -21,3 +26,8 @@
          if x is not a denormalized number then mantissa >= 1.0.
    Store exp in *EXPPTR and return mantissa.  */
 extern long double printf_frexpl (long double x, int *expptr);
+
+
+#ifdef __cplusplus
+}
+#endif
index 3f040e9e274fb4cb0af5b8a08ec612617deb72a2..6201b74180fe45bcbf215cf9e5703d0a8bb5266d 100644 (file)
@@ -32,6 +32,11 @@ _GL_INLINE_HEADER_BEGIN
 
 # include <priv.h>
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+
 int priv_set_ismember (const char *priv);
 int priv_set_remove (const char *priv);
 int priv_set_restore (const char *priv);
@@ -62,6 +67,11 @@ priv_set_restore_linkdir (void)
   return -1;
 }
 
+
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 _GL_INLINE_HEADER_END
index 2a1c58131bd2d5a71b8638e435cf751dec256ee4..f087a8548a844ada0aaacee13afbdd321db9ac75 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef QUOTE_H_
-# define QUOTE_H_ 1
+#define QUOTE_H_ 1
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stddef.h>
 
 /* The quoting options used by quote_n and quote.  Its type is incomplete,
    so it's useful only in expressions like '&quote_quoting_options'.  */
@@ -43,4 +48,9 @@ char const *quote_n (int n, char const *arg);
    diagnostics.  */
 char const *quote (char const *arg);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !QUOTE_H_ */
index 202b79f33ef9ed10ecaab2c52840e12816daefe3..e525b9a01d5e6ee639904ccffc05952d624b9ec7 100644 (file)
 /* Written by Paul Eggert <eggert@twinsun.com> */
 
 #ifndef QUOTEARG_H_
-# define QUOTEARG_H_ 1
+#define QUOTEARG_H_ 1
 
 /* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stdlib.h>
 
 /* Basic quoting styles.  For each style, an example is given on the
    input strings "simple", "\0 \t\n'\"\033?""?/\\", and "a:b", using
@@ -270,9 +275,9 @@ enum quoting_flags
   };
 
 /* For now, --quoting-style=literal is the default, but this may change.  */
-# ifndef DEFAULT_QUOTING_STYLE
-#  define DEFAULT_QUOTING_STYLE literal_quoting_style
-# endif
+#ifndef DEFAULT_QUOTING_STYLE
+# define DEFAULT_QUOTING_STYLE literal_quoting_style
+#endif
 
 /* Names of quoting styles and their corresponding values.  */
 extern char const *const quoting_style_args[];
@@ -439,4 +444,9 @@ char *quotearg_custom_mem (char const *left_quote,
 /* Free any dynamically allocated memory.  */
 void quotearg_free (void);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !QUOTEARG_H_ */
index 97909ea7944dd5919a5cb9c1cbbdc731f48ebd71..e91699f550cfdf1ff39a31e396ca91ec0c218e63 100644 (file)
 /* Get FILE.  */
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Indicate that the file is treated as binary.  */
 #define RF_BINARY 0x1
 
@@ -41,4 +46,9 @@ extern char *fread_file (FILE * stream, int flags, size_t * length)
 extern char *read_file (const char *filename, int flags, size_t * length)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* READ_FILE_H */
index 8e099659e627f8dffe273d913a0a2a9f7907a34d..b4941df015dd7ecb06af349ecd6b12ca4e174dd4 100644 (file)
 # include <readline/readline.h>
 #else
 # include <stdlib.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* Prints a prompt PROMPT and then reads and returns a single line of
    text from the user.  If PROMPT is NULL or the empty string, no
    prompt is displayed.  The returned line is allocated with malloc;
    the caller should free the line when it has finished with it. */
 extern char *readline (const char *prompt)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+# ifdef __cplusplus
+}
+# endif
+
 #endif
 
 #endif /* GL_READLINE_H */
index e0dcc19e1889d83508fcec84b6cf3e8d4c88b106..7514308114f617e16103fe130620424f01b85037 100644 (file)
 
 # include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* FIXME: This header should use idx_t, not size_t.  */
 
 struct tokenbuffer
@@ -42,4 +47,9 @@ size_t
               const char *delim, size_t n_delim,
               char ***tokens_out, size_t **token_lengths);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* not READTOKENS_H */
index 8c80bcae90c0d3994d76380be1cccc26d8543627..e135dfcb7b11364484a55def2957dd3f5fee2ada 100644 (file)
    Written by Jim Meyering. */
 
 #ifndef READTOKENS0_H
-# define READTOKENS0_H 1
+#define READTOKENS0_H 1
+
+#include <stdio.h>
+#include <sys/types.h>
+#include "obstack.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stdio.h>
-# include <sys/types.h>
-# include "obstack.h"
 
 struct Tokens
 {
@@ -38,4 +43,9 @@ void readtokens0_init (struct Tokens *t);
 void readtokens0_free (struct Tokens *t);
 bool readtokens0 (FILE *in, struct Tokens *t);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 017915ec013b2b9a3319bac3f4704eda1ce1a1fe..fe271e303d868342b6d4962eb7b7f4869883c4a6 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Specifies a quotation task for converting a fixed string to a regular
    expression pattern.  */
 struct regex_quote_spec
@@ -90,4 +95,8 @@ extern char *
        _GL_ATTRIBUTE_RETURNS_NONNULL;
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _REGEX_QUOTE_H */
index 1be335b63bc6c2f061bd416bf534b13526e6a498..cf97b7136f7593c348045f6b2d4030897e39ba8c 100644 (file)
 /* Get RENAME_* macros from <stdio.h> if present, otherwise supply
    the traditional Linux values.  */
 #include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #ifndef RENAME_NOREPLACE
 # define RENAME_NOREPLACE  (1 << 0)
 # define RENAME_EXCHANGE   (1 << 1)
@@ -26,3 +32,8 @@
 #endif
 
 extern int renameatu (int, char const *, int, char const *, unsigned int);
+
+
+#ifdef __cplusplus
+}
+#endif
index 47c4d24cc8936b83d3390b9c7daee80157c8aeb6..780c9fcca35e5e06ae7ab3ba681744bfbc073653 100644 (file)
 #include <stdint.h>
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #define RIJNDAEL_MAXKC (256/32)
 #define RIJNDAEL_MAXKB (256/8)
 #define RIJNDAEL_MAXNR 14
@@ -62,4 +67,9 @@ void rijndaelEncrypt (const uint32_t rk[ /*4*(Nr + 1) */ ], size_t Nr,
 void rijndaelDecrypt (const uint32_t rk[ /*4*(Nr + 1) */ ], size_t Nr,
                       const char ct[16], char pt[16]);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __RIJNDAEL_ALG_FST_H */
index 2d6a2accdd321ca74027f3fb0c550b2845e35b7c..002fc5834ef63582ba9322451806644c452854d3 100644 (file)
 
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Default number of bits in a cipher block */
 #define RIJNDAEL_BITSPERBLOCK 128
 
@@ -202,4 +207,9 @@ rijndaelPadDecrypt (rijndaelCipherInstance *cipher,
                     const char *input, size_t inputOctets,
                     char *restrict outBuffer);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __RIJNDAEL_API_FST_H */
index f7b0e5fb5153c38a71d9c2c1dce5e4bbc48d5ed3..bee973ed4d0e452f67ccbc44d5f38500bdbb75c6 100644 (file)
@@ -36,6 +36,11 @@ _GL_INLINE_HEADER_BEGIN
 # define SAFE_ALLOC_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Don't call these directly - use the macros below.  */
 SAFE_ALLOC_INLINE void *
 safe_alloc_realloc_n (void *ptr, size_t count, size_t size)
@@ -121,6 +126,11 @@ safe_alloc_check (void *ptr)
  */
 #define FREE(ptr) ((void) (free (ptr), (ptr) = NULL))
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* SAFE_ALLOC_H_ */
index c10a9ae45517b1f7fd2084107843d241923b5ff6..4415dd05131a44f2c1dd537ebf823da0b646f340 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #define SAFE_WRITE_ERROR ((size_t) -1)
 
 /* Write up to COUNT bytes at BUF to descriptor FD, retrying if interrupted.
    Return the actual number of bytes written, zero for EOF, or SAFE_WRITE_ERROR
    upon error.  */
 extern size_t safe_write (int fd, const void *buf, size_t count);
+
+
+#ifdef __cplusplus
+}
+#endif
index 62dd088e538e1134365b7992357e696c1ed9a653..13ae24b71bb54b824d4f9bc904a9294787534d09 100644 (file)
@@ -30,6 +30,11 @@ _GL_INLINE_HEADER_BEGIN
 # define SAME_INODE_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* True if A and B point to structs with st_dev and st_ino members
    that are known to represent the same file.
 
@@ -80,6 +85,11 @@ psame_inode (struct stat const *a, struct stat const *b)
   return PSAME_INODE (a, b);
 }
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif
index efd2433f9695d80b88a3bec4b6deaf94057de3fd..87ef6fec562d79042cd37832cdf9732163e9bd45 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef SAME_H_
-# define SAME_H_ 1
+#define SAME_H_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 bool same_name (const char *source, const char *dest);
 bool same_nameat (int, char const *, int, char const *);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* SAME_H_ */
index 692e4b97be2e7ef71072226163119df0af1a2243..9d314c2cf454d00f4d07d0669411521aff7fc7fd 100644 (file)
 /* Written by Jim Meyering.  */
 
 #ifndef SAVE_CWD_H
-# define SAVE_CWD_H 1
+#define SAVE_CWD_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 struct saved_cwd
   {
@@ -31,4 +36,9 @@ int save_cwd (struct saved_cwd *cwd);
 int restore_cwd (const struct saved_cwd *cwd);
 void free_cwd (struct saved_cwd *cwd);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* SAVE_CWD_H */
index c292b270f07dd72e329587f3536e30d805719590..02f21576f7231f9c54bb9466bde7d632d6cd01a6 100644 (file)
 #include <dirent.h>
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 enum savedir_option
   {
     SAVEDIR_SORT_NONE,
@@ -46,4 +51,9 @@ char *streamsavedir (DIR *, enum savedir_option)
 char *savedir (char const *, enum savedir_option)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index b79fcec3eb495b5d213a39ab00a1509b6183e8ae..e74ba82d9412e905b4c340ff97f21020ffc73d47 100644 (file)
@@ -32,6 +32,11 @@ _GL_INLINE_HEADER_BEGIN
 # define SAVEWD_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* A saved working directory.  The member names and constants defined
    by this structure are private to the savewd module.  */
 struct savewd
@@ -149,6 +154,11 @@ int savewd_process_files (int n_files, char **file,
                           int (*act) (char *, struct savewd *, void *),
                           void *options);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif
index 5cb00e3c0feaf4928737852421b122edbbc51f8c..c25e362c5dd683a46c64f2b19590eb5f99cd99b9 100644 (file)
 #include <selinux/selinux.h>
 #include <selinux/context.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* These are the dir-fd-relative variants of the functions without the
    "at" suffix.  For example, getfileconat (AT_FDCWD, file, &c) is usually
    equivalent to getfilecon (file, &c).  The emulation is accomplished
@@ -50,3 +55,8 @@ int  setfileconat (int dir_fd, char const *file, char const *con);
    except when DIR_FD and FILE specify a symlink:  lsetfileconat operates on
    the symlink, while setfileconat operates on the referent of the symlink.  */
 int lsetfileconat (int dir_fd, char const *file, char const *con);
+
+
+#ifdef __cplusplus
+}
+#endif
index 18a550a7515e0b26e1ecda2772fe99d910a13cff..14d2c525f5c80806d22b7fe6c6c64a3958100ae7 100644 (file)
 
 #include "nan.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 /* Returns a quiet 'float' NaN with sign bit == 0.  */
 _GL_UNUSED static float
@@ -85,4 +89,8 @@ negative_NaNl ()
 }
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _SIGNED_NAN_H */
index 7e6483a7618e0a91772d0a1a68bca135d74bafd6..89ba72100912d1578dc6ec30e68f09cba313807c 100644 (file)
 #include "signed-nan.h"
 #include "snan.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 #if HAVE_SNANF
 
@@ -139,4 +143,8 @@ negative_SNaNl ()
 #endif
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _SIGNED_SNAN_H */
index 95235040461c51169c3b750ea090b87401f39c24..c7312e259f9f8dcc3609fbacdbd04f30f31eeb3b 100644 (file)
 
 #include "nan.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 /* The bit that distinguishes a quiet NaN from a signalling NaN is, according to
    <https://en.wikipedia.org/wiki/NaN#Encoding>, the most significant bit of the
@@ -273,4 +277,8 @@ SNaNl ()
 #undef NWORDS
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _SNAN_H */
index 99d6efca5216034eccc3e349f4f280e5048012fe..55077ae98ac6b1b1c92b591ab7c2c8f604fffaa1 100644 (file)
  #error "Please include config.h first."
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define SOCKETS_1_0 0x0001
 #define SOCKETS_1_1 0x0101
 #define SOCKETS_2_0 0x0002
@@ -43,6 +47,11 @@ int gl_sockets_cleanup (void)
 #endif
   ;
 
+#ifdef __cplusplus
+}
+#endif
+
+
 /* This function is useful it you create a socket using gnulib's
    Winsock wrappers but needs to pass on the socket handle to some
    other library that only accepts sockets. */
index 03d1545667e41168f251a4e4eebebcea8c30bb18..8e2e777d6f4bb33649601deba70d2dfcce2b4c71 100644 (file)
 
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #if GNULIB_FOPEN_SAFER
 FILE *fopen_safer (char const *, char const *)
   _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1);
@@ -43,3 +48,8 @@ FILE *popen_safer (char const *, char const *)
 FILE *tmpfile_safer (void)
   _GL_ATTRIBUTE_DEALLOC (fclose, 1);
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index d47d1640eda98170a1b13769f1beffa9aa57449b..07357d91167a16bb5999417138c810a199f0057e 100644 (file)
 
 /* Written by Paul Eggert.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int mkstemp_safer (char *);
 
 #if GNULIB_MKOSTEMP
@@ -30,3 +35,8 @@ int mkostemps_safer (char *, int, int);
 #if GNULIB_MKSTEMPS
 int mkstemps_safer (char *, int);
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index 123434637f5b6f2e9cdcf62b84c084eacb19c78a..8593de6dffe73d4b98f0e77ab1056bcfeda6b41d 100644 (file)
 
 #include <string.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* STREQ_OPT allows to optimize string comparison with a small literal string.
      STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
    is semantically equivalent to
@@ -173,4 +178,9 @@ streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23,
 
 #endif
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_STREQ_H */
index 872fa7d6c78d6aac0aff7e3a03c85f9db2cb6510..a1734a242e6639e4f204dbc172e87a90a82cd629 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_STRERROR_OVERRIDE_H
-# define _GL_STRERROR_OVERRIDE_H
+#define _GL_STRERROR_OVERRIDE_H
 
 /* This file uses _GL_ATTRIBUTE_CONST.  */
-# if !_GL_CONFIG_H_INCLUDED
-#  error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <errno.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <errno.h>
-# include <stddef.h>
 
 /* Reasonable buffer size that should never trigger ERANGE; if this
    proves too small, we intentionally abort(), to remind us to fix
    this value.  */
-# define STACKBUF_LEN 256
+#define STACKBUF_LEN 256
 
 /* If ERRNUM maps to an errno value defined by gnulib, return a string
    describing the error.  Otherwise return NULL.  */
-# if REPLACE_STRERROR_0 \
-     || GNULIB_defined_ESOCK \
-     || GNULIB_defined_ESTREAMS \
-     || GNULIB_defined_EWINSOCK \
-     || GNULIB_defined_ENOMSG \
-     || GNULIB_defined_EIDRM \
-     || GNULIB_defined_ENOLINK \
-     || GNULIB_defined_EPROTO \
-     || GNULIB_defined_EMULTIHOP \
-     || GNULIB_defined_EBADMSG \
-     || GNULIB_defined_EOVERFLOW \
-     || GNULIB_defined_ENOTSUP \
-     || GNULIB_defined_ENETRESET \
-     || GNULIB_defined_ECONNABORTED \
-     || GNULIB_defined_ESTALE \
-     || GNULIB_defined_EDQUOT \
-     || GNULIB_defined_ECANCELED \
-     || GNULIB_defined_EOWNERDEAD \
-     || GNULIB_defined_ENOTRECOVERABLE \
-     || GNULIB_defined_EILSEQ
+#if REPLACE_STRERROR_0 \
+    || GNULIB_defined_ESOCK \
+    || GNULIB_defined_ESTREAMS \
+    || GNULIB_defined_EWINSOCK \
+    || GNULIB_defined_ENOMSG \
+    || GNULIB_defined_EIDRM \
+    || GNULIB_defined_ENOLINK \
+    || GNULIB_defined_EPROTO \
+    || GNULIB_defined_EMULTIHOP \
+    || GNULIB_defined_EBADMSG \
+    || GNULIB_defined_EOVERFLOW \
+    || GNULIB_defined_ENOTSUP \
+    || GNULIB_defined_ENETRESET \
+    || GNULIB_defined_ECONNABORTED \
+    || GNULIB_defined_ESTALE \
+    || GNULIB_defined_EDQUOT \
+    || GNULIB_defined_ECANCELED \
+    || GNULIB_defined_EOWNERDEAD \
+    || GNULIB_defined_ENOTRECOVERABLE \
+    || GNULIB_defined_EILSEQ
 extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
-# else
-#  define strerror_override(ignored) NULL
-#  define GNULIB_defined_strerror_override_macro 1
-# endif
+#else
+# define strerror_override(ignored) NULL
+# define GNULIB_defined_strerror_override_macro 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _GL_STRERROR_OVERRIDE_H */
index ffbf34088b5d23d8d02f217672d72eba9d9f6cf8..f5493aed77b0596541cff95a4c96fc79e5f4d6d7 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
    non-null and exists, uses it; otherwise uses the first of $TMPDIR,
    P_tmpdir, /tmp that exists.  Copies into TMPL a template suitable
@@ -23,3 +28,8 @@
    doesn't exist, none of the searched dirs exists, or there's not
    enough space in TMPL. */
 extern int path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, bool try_tmpdir);
+
+
+#ifdef __cplusplus
+}
+#endif
index 5a0cdf3d22847df9eae60786bb013251ba6db91a..33a5feef532beff46da831e9bf6bad3388905495 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Trim mode. */
 #define TRIM_TRAILING 0
 #define TRIM_LEADING 1
@@ -40,3 +45,8 @@
 char *trim2 (const char *, int)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
   _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+
+#ifdef __cplusplus
+}
+#endif
index 63339cca0fca41a095ece3e1e59bb9a95f41d681..4eca03e985ea7f945dcac310701ded0059fb6068 100644 (file)
--- a/lib/u64.h
+++ b/lib/u64.h
@@ -29,6 +29,11 @@ _GL_INLINE_HEADER_BEGIN
 # define _GL_U64_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Return X rotated left by N bits, where 0 < N < 64.  */
 #define u64rol(x, n) u64or (u64shl (x, n), u64shr (x, 64 - n))
 
@@ -178,4 +183,9 @@ u64shr (u64 x, int n)
 
 #endif
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
index 647e05fc996db9a93ff7b9ffda44311108d463b8..bb320678c40b2b9e1c1a071f6fed62f54aafef0d 100644 (file)
 
 #include "unitypes.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Return the casefold mapping of a Unicode character.  */
 extern ucs4_t
        uc_tocasefold (ucs4_t uc);
+
+
+#ifdef __cplusplus
+}
+#endif
index ac7646890c97041bda7097a6763214282c7cb7dd..d6b95bd1e547ddaaf0a8d0538604ffe5737cb48f 100644 (file)
 
 #include "unitypes.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Determine whether a character is "cased" according to the Unicode Standard,
    <https://www.unicode.org/versions/Unicode5.0.0/ch03.pdf>, section 3.13,
    definition D120.  */
@@ -39,3 +44,8 @@ extern bool
 extern bool
        uc_is_case_ignorable (ucs4_t uc)
        _UC_ATTRIBUTE_CONST;
+
+
+#ifdef __cplusplus
+}
+#endif
index e0ec3a33e91f9f4b1a432378cda44a28316f9fc6..136c63019833e05e81d7cee1641c65b03ce1ed01 100644 (file)
 #include "unitypes.h"
 #include "uninorm.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Return true if mapping NFD(S) to via MAPPING is a no-op.  */
 extern int
        u8_is_invariant (const uint8_t *s, size_t n,
@@ -50,3 +55,8 @@ extern int
                                                 uint32_t *resultbuf, size_t *lengthp),
                          const char *iso639_language,
                          bool *resultp);
+
+
+#ifdef __cplusplus
+}
+#endif
index 5683a45278693994223623ba2fe7dac53577bbd3..db8b8438473514a4c2ca64d714b98f8b7e0ef34d 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* A special casing context.
    A context is negated through x -> -x.  */
 enum
@@ -67,3 +72,8 @@ struct special_casing_rule
 
 extern const struct special_casing_rule *
        gl_unicase_special_lookup (const char *str, size_t len);
+
+
+#ifdef __cplusplus
+}
+#endif
index 783b3930303ea224bc7c4ff6d7ba22fef1edd958..6783b9b340123caa33aabf980b101a94b54cd52b 100644 (file)
 #include "unicase.h"
 #include "uninorm.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern uint8_t *
        u8_casemap (const uint8_t *s, size_t n,
                    casing_prefix_context_t prefix_context,
@@ -58,3 +63,8 @@ extern uint32_t *
                     size_t offset_in_rule, /* offset in 'struct special_casing_rule' */
                     uninorm_t nf,
                     uint32_t *resultbuf, size_t *lengthp);
+
+
+#ifdef __cplusplus
+}
+#endif
index 3c36d08e677d512300d31f9e231cc68c46406750..0db1d35f52b42ba7e102336cfe3e9a9b1de6ec5b 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef UNICODEIO_H
-# define UNICODEIO_H
+#define UNICODEIO_H
+
+#include <stddef.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <stddef.h>
-# include <stdio.h>
 
 /* Converts the Unicode character CODE to its multibyte representation
    in the current locale and calls the SUCCESS callback on the resulting
@@ -45,4 +50,9 @@ extern void print_unicode_char (FILE *stream, unsigned int code,
 extern long fwrite_success_callback (const char *buf, size_t buflen,
                                      void *callback_arg);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 85116575c68b6f6c43091d12a58ddef82398ba4d..5166d430302060e65872c201f7016ea9ae721e71 100644 (file)
 
 #include "unitypes.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Line breaking classification.  */
 
 enum
@@ -119,3 +124,8 @@ extern const unsigned char unilbrk_table[40][40];
 
 /* We don't support line breaking of complex-context dependent characters
    (Thai, Lao, Myanmar, Khmer) yet, because it requires dictionary lookup. */
+
+
+#ifdef __cplusplus
+}
+#endif
index d2d9f2ec12a92e579d1b12fc6223fd1baba510b3..a3f713d9a4c3cdf8b96597d2b5faef4b6b76c4b5 100644 (file)
 
 #include "c-ctype.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #define is_utf8_encoding unilbrk_is_utf8_encoding
 extern int is_utf8_encoding (const char *encoding);
 
@@ -37,3 +42,8 @@ extern int is_utf8_encoding (const char *encoding);
 extern int is_all_ascii (const char *s, size_t n);
 
 #endif /* C_CTYPE_ASCII */
+
+
+#ifdef __cplusplus
+}
+#endif
index b96404041a7c394f472c5605e0c2f51759a14729..c68671e56cbc5cce7f2b9a9081f4452475b4f53c 100644 (file)
 
 #include "unitypes.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Variant of uc_decomposition that does not produce the 'tag'.  */
 extern int
        uc_compat_decomposition (ucs4_t uc, ucs4_t *decomposition);
@@ -34,3 +39,8 @@ struct ucs4_with_ccc
 extern void
        gl_uninorm_decompose_merge_sort_inplace (struct ucs4_with_ccc *src, size_t n,
                                                 struct ucs4_with_ccc *tmp);
+
+
+#ifdef __cplusplus
+}
+#endif
index c1179267061cc9bc839ee8db7aeb6a9768975953..70562c919a42a30d047ee43542f208af75a439f4 100644 (file)
 
 /* Written by Paul Eggert and Eric Blake.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int dup_safer (int);
 int fd_safer (int);
 int pipe_safer (int[2]);
@@ -29,3 +34,8 @@ int fd_safer_flag (int, int);
 #if GNULIB_PIPE2_SAFER
 int pipe2_safer (int[2], int);
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index 1b14d3b631d2ee2fab2b44c151b056261163113a..16010d37962616b10808912fcef824dde40604ef 100644 (file)
 /* Get uint8_t, uint16_t, uint32_t.  */
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Type representing a Unicode character.  */
 typedef uint32_t ucs4_t;
 
@@ -58,4 +63,9 @@ typedef uint32_t ucs4_t;
 # endif
 #endif
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _UNITYPES_H */
index 05374f679cb81b41073138c10ae15cfce2f837dc..d24d3caee5627935ca8077cbd605803f3c4e30c2 100644 (file)
    License and of the GNU General Public License along with this
    program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern const int uniwbrk_prop_index[23];
 extern const unsigned char uniwbrk_table[12][12];
+
+#ifdef __cplusplus
+}
+#endif
index 955ea48b860c4d60bfcfb8b99d721370d80eb393..a142f2368916279085c2eed8b004b8a439158507 100644 (file)
 
 /* Written by Paul Eggert and Jim Meyering.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if UNLINK_CANNOT_UNLINK_DIR
 # define cannot_unlink_dir() true
 #else
 bool cannot_unlink_dir (void);
 #endif
+
+#ifdef __cplusplus
+}
+#endif
index edf911e3f1308534302563d3a661a9d3d4b5a6b6..dff2309a6131f5fa48d968476891c9017245898f 100644 (file)
 /* Written by Jim Meyering, 2003.  */
 
 #ifndef USERSPEC_H
-# define USERSPEC_H 1
+#define USERSPEC_H 1
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-# include <sys/types.h>
 
 char const *
 parse_user_spec (char const *spec_arg, uid_t *uid, gid_t *gid,
@@ -28,4 +33,9 @@ char const *
 parse_user_spec_warn (char const *spec_arg, uid_t *uid, gid_t *gid,
                       char **username_arg, char **groupname_arg, bool *pwarn);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index bf730cb07c180379067bab363db2a5add757c193..6af5b0bcbc77b80a3f29bcd8b8c8759a90d29aa1 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Options for utimecmp.  */
 enum
 {
@@ -36,4 +41,9 @@ int utimecmp (char const *, struct stat const *, struct stat const *, int);
 int utimecmpat (int, char const *, struct stat const *, struct stat const *,
                 int);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 7c740afd36d064cc1b877b64e39e5f88275cdf49..b20d4f4f7ee4a17b4170eca158d036b109f28ee1 100644 (file)
 #endif
 
 #include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int fdutimens (int, char const *, struct timespec const [2]);
 int utimens (char const *, struct timespec const [2]);
 int lutimens (char const *, struct timespec const [2]);
 
+#ifdef __cplusplus
+}
+#endif
+
+
 #if GNULIB_FDUTIMENSAT
+
 # include <fcntl.h>
 # include <sys/stat.h>
 
@@ -36,6 +47,10 @@ _GL_INLINE_HEADER_BEGIN
 # define _GL_UTIMENS_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int fdutimensat (int fd, int dir, char const *name, struct timespec const [2],
                  int atflag);
 
@@ -46,6 +61,10 @@ lutimensat (int dir, char const *file, struct timespec const times[2])
   return utimensat (dir, file, times, AT_SYMLINK_NOFOLLOW);
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif
index a48b97653037ef6a940d64658e25378b89c4586b..9f18ab2a64e6ae65a5bea4c9d0ad377b8b681365 100644 (file)
 #include <windows.h>
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Prepares an argument vector before calling spawn().
 
    Note that spawn() does not by itself call the command interpreter
@@ -187,4 +192,9 @@ extern intptr_t spawnpvech (int mode,
                             HANDLE stdin_handle, HANDLE stdout_handle,
                             HANDLE stderr_handle);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _WINDOWS_SPAWN_H */
index 959fe267b3b6381580c321ebbdfafcb8fcbe4711..412b981f1741556b29f7fa2c5445313a78f2a9c9 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 bool can_write_any_file (void);
+
+
+#ifdef __cplusplus
+}
+#endif
index 67d3334ce2e6bb6c9b818ec78cc70abc15b96f6e..52310e0de14279ecb338263788744b770506a32e 100644 (file)
@@ -29,6 +29,11 @@ _GL_INLINE_HEADER_BEGIN
 # define XBINARY_IO_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #if O_BINARY
 extern _Noreturn void xset_binary_mode_error (void);
 #else
@@ -45,6 +50,11 @@ xset_binary_mode (int fd, int mode)
     xset_binary_mode_error ();
 }
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _XBINARY_IO_H */
index 425ea16fdf8e471cb5257685cb5f62259ac1ec3b..67749af7ad78975730ed9437cae96e74bba2b6b0 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern char *xgetcwd (void)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+
+#ifdef __cplusplus
+}
+#endif
index 28db1ea581cb53e6474b42d8819f12e745d9b873..526d1a71c72a79824fdd7dd6999f1a3c5ffbea1d 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Return the NIS domain name of the machine, in malloc'd storage.
    WARNING! The NIS domain name is unrelated to the fully qualified host name
             of the machine.  It is also unrelated to email addresses.
@@ -35,4 +40,9 @@
 extern char *xgetdomainname (void)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _XGETDOMAINNAME_H */
index 6f0d6b00590b588c1649ed7c0c2445a7f0e6a6cd..4e293dc1a1c422fcb1be5bf4243de45cef59ba0c 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 char *xgethostname (void)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+
+#ifdef __cplusplus
+}
+#endif
index 13b6a02cb9b3ed1126ebd7cbd8b18b6c0a69ba45..9a5994885f67b07690b01f231fd4576476f9d859 100644 (file)
 
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 int xmemcoll (char *restrict, size_t, char *restrict, size_t);
 int xmemcoll0 (char const *, size_t, char const *, size_t);
+
+
+#ifdef __cplusplus
+}
+#endif
index 9e7d1e802a1e9d7d2363e6f3b039b4316d93fc2e..202dbd20227ad741eedaba87b88fa11f590b4cff 100644 (file)
 #include <stdarg.h>
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern int xprintf (char const *restrict format, ...)
 #if GNULIB_VPRINTF_POSIX
      _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 1, 2))
@@ -58,4 +63,9 @@ extern int xvfprintf (FILE *restrict stream, char const *restrict format,
 #endif
      ;
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 6dce9bcc29b7f767e6acdbba1fd322728b32a0de..bfce10a3bd5e04505516e0f8c025b264107f3dd3 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 extern char *xreadlink (char const *filename)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
@@ -32,3 +37,8 @@ extern char *xreadlink (char const *filename)
 extern char *xreadlinkat (int fd, char const *filename)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 #endif
+
+
+#ifdef __cplusplus
+}
+#endif
index 71c9c07322e5b7e10dcb6e536e02d7f8a85a173c..619c0edc2b98ab87af27027e76969487cad71da8 100644 (file)
@@ -40,6 +40,11 @@ _GL_INLINE_HEADER_BEGIN
 # define XSIZE_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* The size of memory objects is often computed through expressions of
    type size_t. Example:
       void* p = malloc (header_size + n * element_size).
@@ -105,6 +110,11 @@ xmax (size_t size1, size_t size2)
 #define size_in_bounds_p(SIZE) \
   ((SIZE) != SIZE_MAX)
 
+
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* _XSIZE_H */
index d54d5bb0fa7cdc9c197e587c2680d60093f98691..272265e66d128c78d241c8d3cd129e9a3fecd6e6 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Return a newly allocated copy of at most N bytes of STRING.
    In other words, return a copy of the initial segment of length N of
    STRING.  */
 extern char *xstrndup (const char *string, size_t n)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
   _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+
+#ifdef __cplusplus
+}
+#endif
index 0780f5fe1483c779cb1750438ed481e20c9bddca..9ae4be13da90eef62313d47709b027087658d46e 100644 (file)
 /* Written by Jim Meyering.  */
 
 #ifndef XSTRTOD_H
-# define XSTRTOD_H 1
+#define XSTRTOD_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 bool xstrtod (const char *str, const char **ptr, double *result,
               double (*convert) (char const *, char **));
 bool xstrtold (const char *str, const char **ptr, long double *result,
                long double (*convert) (char const *, char **));
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* not XSTRTOD_H */
index 44b1cb47a3fc40d884c0de5dd0ca234704ac4cd6..280c1f3a43fbcbe86e6408408382c5ab4bc3e9ed 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef XSTRTOL_H_
-# define XSTRTOL_H_ 1
+#define XSTRTOL_H_ 1
 
 /* Get intmax_t, uintmax_t.  */
-# include <stdint.h>
+#include <stdint.h>
 
-# ifndef _STRTOL_ERROR
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifndef _STRTOL_ERROR
 enum strtol_error
   {
     LONGINT_OK = 0,
@@ -37,9 +42,9 @@ enum strtol_error
     LONGINT_INVALID = 4
   };
 typedef enum strtol_error strtol_error;
-# endif
+#endif
 
-# define _DECLARE_XSTRTOL(name, type) \
+#define _DECLARE_XSTRTOL(name, type) \
   strtol_error name (const char *, char **, int, type *, const char *);
 _DECLARE_XSTRTOL (xstrtol, long int)
 _DECLARE_XSTRTOL (xstrtoul, unsigned long int)
@@ -48,4 +53,9 @@ _DECLARE_XSTRTOL (xstrtoull, unsigned long long int)
 _DECLARE_XSTRTOL (xstrtoimax, intmax_t)
 _DECLARE_XSTRTOL (xstrtoumax, uintmax_t)
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* not XSTRTOL_H_ */
index 14a86585dd94c0a7ba1417264d1e29475d0da3fd..81c0eca2e9603250fa018240c2fe6e7ea9916efb 100644 (file)
 #ifndef YESNO_H_
 # define YESNO_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 bool yesno (void);
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif