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/cmake_ext_mod | |
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/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 */ |