)
]
)
+AC_LANG_POP(C)
dnl is time_t 32 of 64 bit ?
-AC_DEFINE([TIME_T_IS_32BIT], [], [time_t is 32bit])
-AC_DEFINE([TIME_T_IS_64BIT], [], [time_t is 64bit])
-AC_MSG_CHECKING([the type of time_t])
AC_CHECK_SIZEOF([time_t])
-if test "x$ac_cv_sizeof_time_t" = "x4"; then
- AC_MSG_RESULT([time_t is 32 bit])
- AC_DEFINE([TIME_T_IS_32BIT])
-elif test "x$ac_cv_sizeof_time_t" = "x8"; then
- AC_MSG_RESULT([time_t is 64 bit])
- AC_DEFINE([TIME_T_IS_64BIT])
-else
- AC_MSG_ERROR([can not figure type of time_t])
-fi
-
-AC_LANG_POP(C)
CONFIGURE_PART(Find 3rd-Party Libraries)
time_t temp;
if ((text = get_xml_text(reader)) != NULL){
errno = 0;
-#ifdef TIME_T_IS_32BIT
+#if SIZEOF_TIME_T == 4
temp = strtol((char *)text,NULL, 0);
-#else
-#ifdef TIME_T_IS_64BIT
+#elif SIZEOF_TIME_T == 8
temp = strtoll((char *)text,NULL, 0);
#else
- if (sizeof(time_t) == 4){
- temp = strtol((char *)text,NULL, 0);
- } else {
- temp = strtoll((char *)text,NULL, 0);
- }
-#endif
+#error "Don't know how to deal with TIME_T other than 4 or 8 bytes"
#endif
if (errno>0){
rrd_set_error("ling %d: get_xml_time_t from '%s' %s",