mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[svn-r30204] Move CXX tests to C++ compiler test file
This commit is contained in:
parent
d3b724f86a
commit
a621f5f668
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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 ()
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user