From: brarcher Date: Wed, 25 Dec 2013 03:04:14 +0000 (+0000) Subject: add clock_t & timer_t to configure.ac and CMakeLists.txt instead X-Git-Tag: 0.10.0~279 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fbaede278a7ad76a1c42672bac1ff8d98742c7e2;p=check add clock_t & timer_t to configure.ac and CMakeLists.txt instead git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@937 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f23f594..08271c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,6 +246,12 @@ check_type_size(uint32_t UINT32_T) check_type_size(uint64_t UINT64_T) check_type_size(uintmax_t UINTMAX_T) +# +check_type_size(clock_t CLOCK_T) +if(NOT HAVE_CLOCK_T) + set(clock_t int) +endif(NOT HAVE_CLOCK_T) +# check_type_size(dev_t DEV_T) if(NOT HAVE_DEV_T) if(MSVC) @@ -321,6 +327,11 @@ if(NOT HAVE_PID_T) endif(WIN32) endif(NOT HAVE_PID_T) # +check_type_size(timer_t TIMER_T) +if(NOT HAVE_TIMER_T) + set(timer_t int) +endif(NOT HAVE_TIMER_T) +# check_type_size(intptr_t INTPTR_T) if(NOT HAVE_INTPTR_T) if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) diff --git a/cmake/config.h.in b/cmake/config.h.in index a710a0b..0f8f30c 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -571,6 +571,9 @@ typedef uint64_t uintmax_t; /* Define to empty if `const' does not conform to ANSI C. */ #cmakedefine const ${const} +/* Define to `int' if doesn't define. */ +#cmakedefine clockid_t ${clockid_t} + /* Define to `int' if doesn't define. */ #cmakedefine gid_t ${gid_t} @@ -592,6 +595,9 @@ typedef uint64_t uintmax_t; /* Define to `int' if does not define. */ #cmakedefine ssize_t ${ssize_t} +/* Define to `int' if does not define. */ +#cmakedefine timer_t ${timer_t} + /* Define to `int' if doesn't define. */ #cmakedefine uid_t ${uid_t} diff --git a/configure.ac b/configure.ac index c047949..9812a4b 100644 --- a/configure.ac +++ b/configure.ac @@ -239,6 +239,9 @@ AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(long, 4) +AC_CHECK_TYPE(clockid_t, int) +AC_CHECK_TYPE(timer_t, int) + # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC diff --git a/lib/libcompat.h b/lib/libcompat.h index 2537555..c07c8e1 100644 --- a/lib/libcompat.h +++ b/lib/libcompat.h @@ -199,18 +199,6 @@ struct itimerspec }; #endif /* STRUCT_ITIMERSPEC_DEFINITION_MISSING */ -/* - * As the functions which use timer_t are not defined on the system, - * the timer_t type probably also is not defined. - */ -typedef int timer_t; - -/* - * As the functions which use clockid_t are not defined on the system, - * the clockid_t type probably also is not defined. - */ -typedef int clockid_t; - /* * Do a simple forward declaration in case the struct is not defined. * In the versions of timer_create in libcompat, sigevent is never