ENH: support STDDEF and cleanup

This commit is contained in:
Andy Cedilnik 2004-05-03 16:35:37 -04:00
parent 0d3bbe8123
commit 575afc8b14
2 changed files with 10 additions and 7 deletions

View File

@ -8,6 +8,10 @@
# include <stdint.h>
#endif /* HAVE_STDINT_H */
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif /* HAVE_STDDEF_H */
#ifdef __CLASSIC_C__
int main(){
int ac;

View File

@ -12,13 +12,12 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}")
IF(HAVE_SYS_TYPES_H)
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -DHAVE_SYS_TYPES_H")
ENDIF(HAVE_SYS_TYPES_H)
IF(HAVE_STDINT_H)
SET(MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -DHAVE_STDINT_H")
ENDIF(HAVE_STDINT_H)
FOREACH(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
IF("${def}")
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
ENDIF("${def}")
ENDFOREACH(def)
MESSAGE(STATUS "Check size of ${TYPE}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_TYPE_SIZE_ADD_LIBRARIES