)
]
)
+
+dnl is time_t long or long long ?
+AC_DEFINE([TIME_T_IS_LONG], [], [time_t is long])
+AC_DEFINE([TIME_T_IS_LONG_LONG], [], [time_t is long long])
+AC_MSG_CHECKING([the type of time_t])
+AC_RUN_IFELSE(
+ AC_LANG_PROGRAM(
+ [[#include <time.h>]],
+ [[if (sizeof(long) != sizeof(time_t)) return 1; ]]
+ ),
+ [ AC_MSG_RESULT([time_t is long])
+ AC_DEFINE([TIME_T_IS_LONG])
+ ],
+ [ AC_RUN_IFELSE(
+ AC_LANG_PROGRAM(
+ [[#include <time.h>]],
+ [[if (sizeof(long long) != sizeof(time_t)) return 1; ]]
+ ),
+ [
+ AC_MSG_RESULT([time_t is long long])
+ AC_DEFINE([TIME_T_IS_LONG_LONG])
+ ],
+ [AC_MSG_ERROR([can not figure type of time_t])]
+ )
+ ]
+)
+
AC_LANG_POP(C)
CONFIGURE_PART(Find 3rd-Party Libraries)
return -1;
} /* get_xml_ulong */
+#ifndef TIME_T_IS_LONG
static int get_xml_llong(
xmlTextReaderPtr reader,
long long *value)
return -1;
} /* get_xml_llong */
+#endif
+
static int get_xml_double(
xmlTextReaderPtr reader,
double *value)
status = get_xml_ulong(reader,
&rrd->stat_head->pdp_step);
else if (xmlStrcasecmp(element, (const xmlChar *) "lastupdate") == 0) {
+#ifdef TIME_T_IS_LONG
+ status = get_xml_long(reader, &rrd->live_head->last_up);
+#else
+#ifdef TIME_T_IS_LONG_LONG
+ status = get_xml_llong(reader, &rrd->live_head->last_up);
+#else
if (sizeof(time_t) == sizeof(long)) {
status = get_xml_long(reader,
(long *)&rrd->live_head->last_up);
status = get_xml_llong(reader,
(long long *)&rrd->live_head->last_up);
}
+#endif
+#endif
}
else if (xmlStrcasecmp(element, (const xmlChar *) "ds") == 0){
xmlFree(element);
#define snprintf _snprintf\r
#define vsnprintf _vsnprintf\r
#define strftime strftime_ \r
+#define strtoll(p, e, b) _strtoi64(p, e, b)\r
\r
/* realloc does not support NULL as argument */\r
#define NO_NULL_REALLOC 1\r