diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-07-20 14:45:25 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-07-20 14:45:25 (GMT) |
commit | a621f5f668eedb07f44be8da11ff6cbfb697b77e (patch) | |
tree | af88946133c0313717b33d406ec10f85440d287f /config/cmake_ext_mod | |
parent | d3b724f86aa2bc0f7a9333c3e3ce95cc2e5e0092 (diff) | |
download | hdf5-a621f5f668eedb07f44be8da11ff6cbfb697b77e.zip hdf5-a621f5f668eedb07f44be8da11ff6cbfb697b77e.tar.gz hdf5-a621f5f668eedb07f44be8da11ff6cbfb697b77e.tar.bz2 |
[svn-r30204] Move CXX tests to C++ compiler test file
Diffstat (limited to 'config/cmake_ext_mod')
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 10 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFCXXTests.cpp | 35 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFMacros.cmake | 10 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFTests.c | 49 |
4 files changed, 60 insertions, 44 deletions
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 33bb5b3..5a14990 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -484,6 +484,13 @@ if (NOT WINDOWS) endif (NOT CYGWIN AND NOT MINGW) CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ) CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGETD) + + # ---------------------------------------------------------------------- + # cygwin user credentials are different then on linux + # + if (NOT CYGWIN AND NOT MINGW) + CHECK_FUNCTION_EXISTS (getpwuid ${HDF_PREFIX}_HAVE_GETPWUID) + endif (NOT CYGWIN AND NOT MINGW) endif (NOT WINDOWS) #----------------------------------------------------------------------------- @@ -497,7 +504,6 @@ CHECK_FUNCTION_EXISTS (frexpf ${HDF_PREFIX}_HAVE_FREXPF) CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL) CHECK_FUNCTION_EXISTS (gethostname ${HDF_PREFIX}_HAVE_GETHOSTNAME) -CHECK_FUNCTION_EXISTS (getpwuid ${HDF_PREFIX}_HAVE_GETPWUID) CHECK_FUNCTION_EXISTS (getrusage ${HDF_PREFIX}_HAVE_GETRUSAGE) CHECK_FUNCTION_EXISTS (llround ${HDF_PREFIX}_HAVE_LLROUND) CHECK_FUNCTION_EXISTS (llroundf ${HDF_PREFIX}_HAVE_LLROUNDF) @@ -560,7 +566,6 @@ if (NOT WINDOWS) HAVE_C99_DESIGNATED_INITIALIZER SYSTEM_SCOPE_THREADS HAVE_SOCKLEN_T - CXX_HAVE_OFFSETOF ) HDF_FUNCTION_TEST (${test}) endforeach (test) @@ -624,6 +629,7 @@ if (CMAKE_CXX_COMPILER_LOADED) ${HDF_PREFIX}_NO_STD BOOL_NOTDEFINED NO_STATIC_CAST + CXX_HAVE_OFFSETOF ) HDF_CXX_FUNCTION_TEST (${test}) endforeach (test) diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp index 6b47421..f5f6644 100644 --- a/config/cmake_ext_mod/HDFCXXTests.cpp +++ b/config/cmake_ext_mod/HDFCXXTests.cpp @@ -54,3 +54,38 @@ int main(void) { } #endif + +#ifdef CXX_HAVE_OFFSETOF + +#include <stdio.h> +#include <stddef.h> + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + + ; + return 0; +} + +#endif diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index b2c4997..1d6b49a 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -279,3 +279,13 @@ macro (HDF_README_PROPERTIES target_fortran) ${CMAKE_BINARY_DIR}/README.txt @ONLY ) endmacro (HDF_README_PROPERTIES) + +macro (HDFTEST_COPY_FILE src dest target) + add_custom_command( + OUTPUT "${dest}" + COMMAND "${CMAKE_COMMAND}" + ARGS -E copy_if_different "${src}" "${dest}" + DEPENDS "${src}" + ) + list (APPEND ${target}_list "${dest}") +endmacro () diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 8478d1b..648f795 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -389,55 +389,20 @@ int main(void) } #endif -#ifdef CXX_HAVE_OFFSETOF - -#include <stdio.h> -#include <stddef.h> - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus -extern "C" -# endif -int FC_DUMMY_MAIN() -{ return 1;} -#endif -#endif -int -main () -{ - - struct index_st - { - unsigned char type; - unsigned char num; - unsigned int len; - }; - typedef struct index_st index_t; - int x,y; - x = offsetof(struct index_st, len); - y = offsetof(index_t, num) - - ; - return 0; -} - -#endif - #ifdef HAVE_IOEO #include <windows.h> typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); int main () { - PGNSI pGNSI; - pGNSI = (PGNSI) GetProcAddress( - GetModuleHandle(TEXT("kernel32.dll")), + PGNSI pGNSI; + pGNSI = (PGNSI) GetProcAddress( + GetModuleHandle(TEXT("kernel32.dll")), "InitOnceExecuteOnce"); - if(NULL == pGNSI) - return 1; - else - return 0; + if(NULL == pGNSI) + return 1; + else + return 0; } #endif /* HAVE_IOEO */ |