summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-05-03 20:35:37 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-05-03 20:35:37 (GMT)
commit575afc8b141851edff8cacbacf1c8c83975b799f (patch)
tree3626afb103c13a51e9af3fb1c31782eea0f558cf /Modules
parent0d3bbe81231e8c6ba66bb9000181f751fe14b9f0 (diff)
downloadCMake-575afc8b141851edff8cacbacf1c8c83975b799f.zip
CMake-575afc8b141851edff8cacbacf1c8c83975b799f.tar.gz
CMake-575afc8b141851edff8cacbacf1c8c83975b799f.tar.bz2
ENH: support STDDEF and cleanup
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CheckTypeSize.c4
-rw-r--r--Modules/CheckTypeSize.cmake13
2 files changed, 10 insertions, 7 deletions
diff --git a/Modules/CheckTypeSize.c b/Modules/CheckTypeSize.c
index f814289..07fe62b 100644
--- a/Modules/CheckTypeSize.c
+++ b/Modules/CheckTypeSize.c
@@ -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;
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 2f3f107..dcd9149 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -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