diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-10-22 16:23:01 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-10-22 16:23:01 (GMT) |
commit | 779154925282f5240e792f9b2e5b242a91005abb (patch) | |
tree | cb0ffbc4e1fb999e65df191058df0d9bbaad5bfa /config/cmake_ext_mod | |
parent | 37ed7e8b5f3fc60a9816c84d1ed71c9ba50ade08 (diff) | |
download | hdf5-779154925282f5240e792f9b2e5b242a91005abb.zip hdf5-779154925282f5240e792f9b2e5b242a91005abb.tar.gz hdf5-779154925282f5240e792f9b2e5b242a91005abb.tar.bz2 |
[svn-r28188] Fix inline/__inline__/__inline detection with CMake after autotools changes
Diffstat (limited to 'config/cmake_ext_mod')
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 26 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFTests.c | 20 |
2 files changed, 15 insertions, 31 deletions
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 */ |