|
||||
File indexing completed on 2025-01-30 10:11:10
0001 /* gsl_inline.h 0002 * 0003 * Copyright (C) 2008, 2009 Brian Gough 0004 * 0005 * This program is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 3 of the License, or (at 0008 * your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, but 0011 * WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 * General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program; if not, write to the Free Software 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef __GSL_INLINE_H__ 0021 #define __GSL_INLINE_H__ 0022 0023 /* In recent versiions of GCC, the inline keyword has two different 0024 forms: GNU and C99. 0025 0026 In GNU mode we can use 'extern inline' to make inline functions 0027 work like macros. The function is only inlined--it is never output 0028 as a definition in an object file. 0029 0030 In the new C99 mode 'extern inline' has a different meaning--it 0031 causes the definition of the function to be output in each object 0032 file where it is used. This will result in multiple-definition 0033 errors on linking. The 'inline' keyword on its own (without 0034 extern) has the same behavior as the original GNU 'extern inline'. 0035 0036 The C99 style is the default with -std=c99 in GCC 4.3. 0037 0038 This header file allows either form of inline to be used by 0039 redefining the macros INLINE_DECL and INLINE_FUN. These are used 0040 in the public header files as 0041 0042 INLINE_DECL double gsl_foo (double x); 0043 #ifdef HAVE_INLINE 0044 INLINE_FUN double gsl_foo (double x) { return x+1.0; } ; 0045 #endif 0046 0047 */ 0048 0049 #ifdef HAVE_INLINE 0050 # if defined(__GNUC_STDC_INLINE__) || defined(GSL_C99_INLINE) || defined(HAVE_C99_INLINE) 0051 # define INLINE_DECL inline /* use C99 inline */ 0052 # define INLINE_FUN inline 0053 # else 0054 # define INLINE_DECL /* use GNU extern inline */ 0055 # define INLINE_FUN extern inline 0056 # endif 0057 #else 0058 # define INLINE_DECL /* */ 0059 #endif 0060 0061 /* Range checking conditions in headers do not require any run-time 0062 tests of the global variable gsl_check_range. They are enabled or 0063 disabled in user code at compile time with GSL_RANGE_CHECK macro. 0064 See also build.h. */ 0065 #define GSL_RANGE_COND(x) (x) 0066 0067 #endif /* __GSL_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 |