summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-12-21 15:10:25 +0100
committerBruno Haible <bruno@clisp.org>2021-12-21 15:10:25 +0100
commitf60cf6564aaea54df034c5c5664d9c13664ee372 (patch)
treef15f5bdd7202d5c9f6778a7cbb1212113228325e /lib
parent83a0d5891db50c00e283e70df694b6003b1f485d (diff)
downloadgnulib-f60cf6564aaea54df034c5c5664d9c13664ee372.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/warn-on-use.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/warn-on-use.h b/lib/warn-on-use.h
index 612937abb0..3984294616 100644
--- a/lib/warn-on-use.h
+++ b/lib/warn-on-use.h
@@ -84,20 +84,20 @@
# 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) \