summaryrefslogtreecommitdiff
path: root/m4/extern-inline.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/extern-inline.m4')
-rw-r--r--m4/extern-inline.m428
1 files changed, 22 insertions, 6 deletions
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index a2acf126c..8a12bddd5 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -1,13 +1,28 @@
dnl 'extern inline' a la ISO C99.
-dnl Copyright 2012-2021 Free Software Foundation, Inc.
+dnl Copyright 2012-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_EXTERN_INLINE],
[
- AH_VERBATIM([extern_inline],
+ AC_CACHE_CHECK([whether ctype.h defines __header_inline],
+ [gl_cv_have___header_inline],
+ [AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE([[#include <ctype.h>
+ #ifndef __header_inline
+ #error "<ctype.h> does not define __header_inline"
+ #endif
+ ]])],
+ [gl_cv_have___header_inline=yes],
+ [gl_cv_have___header_inline=no])])
+ if test "$gl_cv_have___header_inline" = yes; then
+ AC_DEFINE([HAVE___HEADER_INLINE], [1],
+ [Define to 1 if ctype.h defines __header_inline.])
+ fi
+
+ AH_VERBATIM([HAVE___HEADER_INLINE_1],
[/* Please see the Gnulib manual for how to use these macros.
Suppress extern inline with HP-UX cc, as it appears to be broken; see
@@ -17,7 +32,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
mishandles inline functions that call each other. E.g., for 'inline void f
(void) { } inline void g (void) { f (); }', c99 incorrectly complains
'reference to static identifier "f" in extern inline function'.
- This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+ This bug was observed with Oracle Developer Studio 12.6
+ (Sun C 5.15 SunOS_sparc 2017/05/30).
Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
on configurations that mistakenly use 'static inline' to implement
@@ -53,7 +69,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
*/
#if (((defined __APPLE__ && defined __MACH__) \
|| defined __DragonFly__ || defined __FreeBSD__) \
- && (defined __header_inline \
+ && (defined HAVE___HEADER_INLINE \
? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
&& ! defined __clang__) \
: ((! defined _DONT_USE_CTYPE_INLINE_ \
@@ -83,8 +99,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
# define _GL_EXTERN_INLINE extern
# define _GL_EXTERN_INLINE_IN_USE
#else
-# define _GL_INLINE static _GL_UNUSED
-# define _GL_EXTERN_INLINE static _GL_UNUSED
+# define _GL_INLINE _GL_UNUSED static
+# define _GL_EXTERN_INLINE _GL_UNUSED static
#endif
/* In GCC 4.6 (inclusive) to 5.1 (exclusive),