]> Savannah Git Hosting - gnulib.git/commitdiff
snippet/warn-on-use: Fix compilation error in C++ mode on OpenBSD 7.0.
authorBruno Haible <bruno@clisp.org>
Tue, 21 Dec 2021 14:10:25 +0000 (15:10 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 21 Dec 2021 14:10:25 +0000 (15:10 +0100)
* lib/warn-on-use.h (_GL_WARN_ON_USE): In C++ mode, declare function
with "C" linkage.

ChangeLog
lib/warn-on-use.h

index 2fb6603c8daf6579944feaef4be97d61e87b0fd0..1d4432ab71b64a7769fa7421026fa1cab08c7899 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-12-21  Bruno Haible  <bruno@clisp.org>
+
+       snippet/warn-on-use: Fix compilation error in C++ mode on OpenBSD 7.0.
+       * lib/warn-on-use.h (_GL_WARN_ON_USE): In C++ mode, declare function
+       with "C" linkage.
+
 2021-12-21  Bruno Haible  <bruno@clisp.org>
 
        Optimize redundant 'mkdir -p .' invocations.
index 612937abb02dc368fd52ea80cbe3e2c947689750..398429461606f7faae996d838be3c3333eed23e2 100644 (file)
 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
 #  define _GL_WARN_ON_USE(function, message) \
-extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
   __attribute__ ((__warning__ (message)))
 # elif __clang_major__ >= 4
 /* Another compiler attribute is available in clang.  */
 #  define _GL_WARN_ON_USE(function, message) \
-extern __typeof__ (function) function \
+_GL_WARN_EXTERN_C __typeof__ (function) function \
   __attribute__ ((__diagnose_if__ (1, message, "warning")))
 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
   __attribute__ ((__diagnose_if__ (1, message, "warning")))
 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
 /* Verify the existence of the function.  */
 #  define _GL_WARN_ON_USE(function, message) \
-extern __typeof__ (function) function
+_GL_WARN_EXTERN_C __typeof__ (function) function
 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
 # else /* Unsupported.  */
 #  define _GL_WARN_ON_USE(function, message) \