123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- dnl 'extern inline' a la ISO C99.
- dnl Copyright 2012-2017 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],
- [
- #if (((defined __APPLE__ && defined __MACH__) \
- || defined __DragonFly__ || defined __FreeBSD__) \
- && (defined __header_inline \
- ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
- && ! defined __clang__) \
- : ((! defined _DONT_USE_CTYPE_INLINE_ \
- && (defined __GNUC__ || defined __cplusplus)) \
- || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
- && defined __GNUC__ && ! defined __cplusplus))))
- # define _GL_EXTERN_INLINE_STDHEADER_BUG
- #endif
- #if ((__GNUC__ \
- ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
- : (199901L <= __STDC_VERSION__ \
- && !defined __HP_cc \
- && !defined __PGI \
- && !(defined __SUNPRO_C && __STDC__))) \
- && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
- # define _GL_INLINE inline
- # define _GL_EXTERN_INLINE extern inline
- # define _GL_EXTERN_INLINE_IN_USE
- #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
- && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
- # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
-
- # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
- # else
- # define _GL_INLINE extern inline
- # endif
- # 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
- #endif
- #if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
- # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
- # define _GL_INLINE_HEADER_CONST_PRAGMA
- # else
- # define _GL_INLINE_HEADER_CONST_PRAGMA \
- _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
- # endif
- # define _GL_INLINE_HEADER_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
- _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
- _GL_INLINE_HEADER_CONST_PRAGMA
- # define _GL_INLINE_HEADER_END \
- _Pragma ("GCC diagnostic pop")
- #else
- # define _GL_INLINE_HEADER_BEGIN
- # define _GL_INLINE_HEADER_END
- #endif])
- ])
|