]> Savannah Git Hosting - gnulib.git/commitdiff
Add ‘extern "C"’ to count-one-bits.h etc.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 21 Feb 2020 20:41:33 +0000 (12:41 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 21 Feb 2020 20:42:16 +0000 (12:42 -0800)
This ports these .h files to C++.
Problem reported by Simon Marchi in:
https://lists.gnu.org/r/bug-gnulib/2020-02/msg00110.html
* lib/count-leading-zeros.h, lib/count-one-bits.h:
* lib/count-trailing-zeros.h: Add ‘extern "C"’.

ChangeLog
lib/count-leading-zeros.h
lib/count-one-bits.h
lib/count-trailing-zeros.h

index 8649b911083a0361c2980ce88d641cdb29293bb6..89beae3d7461526b6c4175a05a25cc2250139fe7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-02-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Add ‘extern "C"’ to count-one-bits.h etc.
+       This ports these .h files to C++.
+       Problem reported by Simon Marchi in:
+       https://lists.gnu.org/r/bug-gnulib/2020-02/msg00110.html
+       * lib/count-leading-zeros.h, lib/count-one-bits.h:
+       * lib/count-trailing-zeros.h: Add ‘extern "C"’.
+
 2020-02-19  Bruno Haible  <bruno@clisp.org>
 
        uninorm/decompose-internal: Avoid "no previous prototype" warning.
index b548754e181d1ad6ca95ae9243cab6c2f3fa7265..7e88c8cb9d04f08408c1db71150d9a49e1a3dc64 100644 (file)
@@ -30,6 +30,10 @@ _GL_INLINE_HEADER_BEGIN
 # define COUNT_LEADING_ZEROS_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Assuming the GCC builtin is BUILTIN and the MSC builtin is MSC_BUILTIN,
    expand to code that computes the number of leading zeros of the local
    variable 'x' of type TYPE (an unsigned integer type) and return it
@@ -108,6 +112,10 @@ count_leading_zeros_ll (unsigned long long int x)
                        unsigned long long int);
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* COUNT_LEADING_ZEROS_H */
index 78770e4240d46d46707512d62b6d74a6b9e1a4db..eea56d8591040b73c8e441b41d24a00b5d6eba55 100644 (file)
@@ -30,6 +30,10 @@ _GL_INLINE_HEADER_BEGIN
 # define COUNT_ONE_BITS_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Expand to code that computes the number of 1-bits of the local
    variable 'x' of type TYPE (an unsigned integer type) and return it
    from the current function.  */
@@ -129,6 +133,10 @@ count_one_bits_ll (unsigned long long int x)
   COUNT_ONE_BITS (__builtin_popcountll, __popcnt64, unsigned long long int);
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif /* COUNT_ONE_BITS_H */
index 2169f62625166970477c369028998c5ce7874593..1eb5fb919f4454b43f1cc56031efaa953ebdabe3 100644 (file)
@@ -30,6 +30,10 @@ _GL_INLINE_HEADER_BEGIN
 # define COUNT_TRAILING_ZEROS_INLINE _GL_INLINE
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Assuming the GCC builtin is BUILTIN and the MSC builtin is MSC_BUILTIN,
    expand to code that computes the number of trailing zeros of the local
    variable 'x' of type TYPE (an unsigned integer type) and return it
@@ -100,6 +104,10 @@ count_trailing_zeros_ll (unsigned long long int x)
                         unsigned long long int);
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 _GL_INLINE_HEADER_END
 
 #endif