|
||||
File indexing completed on 2025-01-18 10:13:16
0001 /* Decision whether to use 'inline' or not. 0002 Copyright (C) 2006-2023 Free Software Foundation, Inc. 0003 0004 This program is free software: you can redistribute it and/or 0005 modify it under the terms of either: 0006 0007 * the GNU Lesser General Public License as published by the Free 0008 Software Foundation; either version 3 of the License, or (at your 0009 option) any later version. 0010 0011 or 0012 0013 * the GNU General Public License as published by the Free 0014 Software Foundation; either version 2 of the License, or (at your 0015 option) any later version. 0016 0017 or both in parallel, as here. 0018 This program is distributed in the hope that it will be useful, 0019 but WITHOUT ANY WARRANTY; without even the implied warranty of 0020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0021 GNU Lesser General Public License for more details. 0022 0023 You should have received a copy of the GNU Lesser General Public License 0024 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 0025 0026 /* Written by Bruno Haible <bruno@clisp.org>, 2009. */ 0027 0028 #ifndef _UNISTRING_INLINE_H 0029 #define _UNISTRING_INLINE_H 0030 0031 /* This is like the gl_INLINE macro in gnulib/m4/inline.m4, but makes its 0032 decision based on defined preprocessor symbols rather than through 0033 autoconf tests. 0034 See <https://lists.gnu.org/archive/html/bug-gnulib/2006-11/msg00055.html> */ 0035 0036 /* Test for the 'inline' keyword or equivalent. ISO C 99 semantics is not 0037 required, only that 'static inline' works. 0038 Define 'inline' to a supported equivalent, or to nothing if not supported, 0039 like AC_C_INLINE does. Also, define UNISTRING_HAVE_INLINE if 'inline' or an 0040 equivalent is effectively supported, i.e. if the compiler is likely to 0041 drop unused 'static inline' functions. */ 0042 0043 #if defined __GNUC__ || defined __clang__ 0044 /* GNU C/C++ or clang C/C++. */ 0045 # if defined __NO_INLINE__ 0046 /* GCC and clang define __NO_INLINE__ if not optimizing or if -fno-inline is 0047 specified. */ 0048 # define UNISTRING_HAVE_INLINE 0 0049 # else 0050 /* Whether 'inline' has the old GCC semantics or the ISO C 99 semantics, 0051 does not matter. */ 0052 # define UNISTRING_HAVE_INLINE 1 0053 # ifndef inline 0054 # define inline __inline__ 0055 # endif 0056 # endif 0057 #elif defined __cplusplus 0058 /* Any other C++ compiler. */ 0059 # define UNISTRING_HAVE_INLINE 1 0060 #else 0061 /* Any other C compiler. */ 0062 # if defined __osf__ 0063 /* OSF/1 cc has inline. */ 0064 # define UNISTRING_HAVE_INLINE 1 0065 # elif defined _AIX || defined __sgi 0066 /* AIX 4 xlc, IRIX 6.5 cc have __inline. */ 0067 # define UNISTRING_HAVE_INLINE 1 0068 # ifndef inline 0069 # define inline __inline 0070 # endif 0071 # else 0072 /* Some older C compiler. */ 0073 # define UNISTRING_HAVE_INLINE 0 0074 # endif 0075 #endif 0076 0077 #endif /* _UNISTRING_INLINE_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |