diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-10-22 20:00:04 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-10-22 20:00:04 (GMT) |
commit | 6ab00dd2a053ebd5e979f255654934c98e35770a (patch) | |
tree | 7a0bdec4df55e848455a0c1e1d7d87741569aeff /config | |
parent | 87919a0ceb90fc270392a69be68fe8a2155eef77 (diff) | |
download | hdf5-6ab00dd2a053ebd5e979f255654934c98e35770a.zip hdf5-6ab00dd2a053ebd5e979f255654934c98e35770a.tar.gz hdf5-6ab00dd2a053ebd5e979f255654934c98e35770a.tar.bz2 |
[svn-r28192] Merge r28188 from trunk
Fix inline/__inline__/__inline detection with CMake after autotools changes
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/H5pubconf.h.in | 15 | ||||
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 26 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFTests.c | 20 |
3 files changed, 24 insertions, 37 deletions
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 874c8f0..13740ea 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -145,6 +145,9 @@ /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine H5_HAVE_GETTIMEOFDAY @H5_HAVE_GETTIMEOFDAY@ +/* Define if the compiler understands inline */ +#cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@ + /* Define if library will contain instrumentation to detect correct optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ @@ -359,6 +362,12 @@ /* Define to 1 if you have the `_scrsize' function. */ #cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@ +/* Define if the compiler understands __inline */ +#cmakedefine H5_HAVE___INLINE @H5_HAVE___INLINE@ + +/* Define if the compiler understands __inline__ */ +#cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@ + /* Define if HDF5's high-level library headers should be included in hdf5.h */ #cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ @@ -604,12 +613,6 @@ /* Define to empty if `const' does not conform to ANSI C. */ #cmakedefine H5_const -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#cmakedefine H5_inline @H5_inline@ -#endif - /* Define to `long int' if <sys/types.h> does not define. */ #cmakedefine H5_off_t diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index d41923e..fd502e5 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -141,10 +141,6 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") endif (CMAKE_REQUIRED_LIBRARIES) - foreach (def ${HDF_EXTRA_TEST_DEFINITIONS}) - set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") - endforeach (def) - foreach (def HAVE_SYS_TIME_H HAVE_UNISTD_H @@ -570,10 +566,6 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") endif (CMAKE_REQUIRED_LIBRARIES) - foreach (def ${HDF_EXTRA_TEST_DEFINITIONS}) - set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") - endforeach (def) - foreach (def HAVE_SYS_TIME_H HAVE_UNISTD_H @@ -696,25 +688,11 @@ endif (WINDOWS) #----------------------------------------------------------------------------- # Determine how 'inline' is used #----------------------------------------------------------------------------- -set (HDF_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) foreach (inline_test inline __inline__ __inline) - set (INLINE_TEST_INLINE ${inline_test}) - HDF_FUNCTION_TEST (INLINE_TEST_${inline_test}) + string (TOUPPER ${inline_test} INLINE_TEST_MACRO) + HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO}) endforeach (inline_test) -set (HDF_EXTRA_TEST_DEFINITIONS) -if (INLINE_TEST___inline__) - set (${HDF_PREFIX}_inline __inline__) -else (INLINE_TEST___inline__) - if (INLINE_TEST___inline) - set (${HDF_PREFIX}_inline __inline) - else (INLINE_TEST___inline) - if (INLINE_TEST_inline) - set (${HDF_PREFIX}_inline inline) - endif (INLINE_TEST_inline) - endif (INLINE_TEST___inline) -endif (INLINE_TEST___inline__) - #----------------------------------------------------------------------------- # Check how to print a Long Long integer #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 5c4d360..8478d1b 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -454,13 +454,19 @@ SIMPLE_TEST(struct text_info w; w.screenwidth=0); #endif /* HAVE_TM_GMTOFF */ - -#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) +#if defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) #ifndef __cplusplus +#if defined( HAVE_INLINE ) +# define INLINE_KW inline +#elif defined ( HAVE___INLINE__ ) +# define INLINE_KW __inline__ +#elif defined ( HAVE___INLINE ) +# define INLINE_KW __inline +#endif /* HAVE_INLINE */ typedef int foo_t; -static INLINE_TEST_INLINE foo_t static_foo () { return 0; } -INLINE_TEST_INLINE foo_t foo () {return 0; } -int main() { return 0; } -#endif +static INLINE_KW foo_t static_foo () { return 0; } +INLINE_KW foo_t foo () {return 0; } +int main(void) { return 0; } +#endif /* __cplusplus */ +#endif /* defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) */ -#endif /* INLINE_TEST */ |