summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 67ffbb3)
raw | patch | inline | side by side (parent: 67ffbb3)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 5 Jul 2009 08:41:47 +0000 (08:41 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 5 Jul 2009 08:41:47 +0000 (08:41 +0000) |
program/configure.ac | patch | blob | history | |
program/src/rrd_restore.c | patch | blob | history | |
program/win32/rrd_config.h.msvc | patch | blob | history |
diff --git a/program/configure.ac b/program/configure.ac
index cc033195802179a2722266e7c4b60698e518e319..f624a0d45755408f98eef4afbacd9748874c4f39 100644 (file)
--- a/program/configure.ac
+++ b/program/configure.ac
)
]
)
+
+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)
index 52c738ba5a1f36264cef2333fd12e42781dcfddd..4cbc37adc45ebc08de59ab2fb80822055d2c7cfd 100644 (file)
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);
index 8a839239cec8726f00b32a717d828a500af5d161..7c55d5a0ce1ca39dc57cd76da8f9ce342d7d8328 100644 (file)
#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