From 43e65d7745d8ee0e4a7d02c58ab6f59f13cdb4c7 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 5 Jul 2009 07:53:28 +0000 Subject: [PATCH] make this code windows save ??? git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3/program@1865 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_restore.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/rrd_restore.c b/src/rrd_restore.c index cc95f72..56b8e7a 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -151,6 +151,16 @@ static int get_ulong_from_node( return (0); } /* int get_ulong_from_node */ + +#ifdef WIN32 +/* Gross Hack Alert */ +#if _MSC_VER < 1300 +#define strtoll(p, e, b) ((*(e) = (char*)(p) + (((b) == 10) ? strspn((p), "0123456789") : 0)), _atoi64(p)) +#else +#define strtoll(p, e, b) _strtoi64(p, e, b) +#endif +#endif + static int get_llong_from_node( xmlDoc * doc, xmlNode * node, @@ -167,7 +177,7 @@ static int get_llong_from_node( } end_ptr = NULL; - temp = strtoll(str_ptr, &end_ptr, 0); + temp = strtoll(str_ptr, &end_ptr, 10); xmlFree(str_ptr); if (str_ptr == end_ptr) { -- 2.30.2