prepare for the release of rrdtool-1.2.16
[rrdtool.git] / src / rrd_gfx.c
index 38d188e..8f21cd5 100644 (file)
@@ -1,16 +1,21 @@
 /****************************************************************************
- * RRDtool 1.2.12  Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2.16  Copyright by Tobi Oetiker, 1997-2006
  ****************************************************************************
  * rrd_gfx.c  graphics wrapper for rrdtool
   **************************************************************************/
 
 /* #define DEBUG */
 
-#ifdef DEBUG
-# define DPRINTF(...)  fprintf(stderr, __VA_ARGS__);
-#else
-# define DPRINTF(...)
-#endif
+/* stupid MSVC doesnt support variadic macros = no debug for now! */
+#ifdef _MSC_VER
+# define DPRINTF()
+#else 
+# ifdef DEBUG
+#  define DPRINTF(...)  fprintf(stderr, __VA_ARGS__);
+# else
+#  define DPRINTF(...)
+# endif /* DEBUG */
+#endif /* _MSC_VER */
 #include "rrd_tool.h"
 #include <png.h>
 #include <ft2build.h>
@@ -1062,7 +1067,9 @@ static void svg_write_text(FILE *fp, const char *text)
        text_count = mbstowcs(cstr, "Enc-Err", 6);
     p = cstr;
 #else
-    unsigned char *p = text, ch;
+    unsigned char *p = text;
+    unsigned char *cstr;
+    char ch;
     if (!p)
        return;
 #endif
@@ -1747,7 +1754,8 @@ static void eps_write_text(eps_state *state, gfx_node_t *node)
        text_count = mbstowcs(cstr, "Enc-Err", 6);
     p = cstr;
 #else
-    unsigned char *p = node->text, ch;
+    const unsigned char *p = node->text;
+    unsigned char ch;
     if (!p)
        return;
 #endif