]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Use #ifdef instead of #if for HAVE_... (#846)
authorWolfgang Stöggl <c72578@yahoo.de>
Thu, 30 Nov 2017 07:55:16 +0000 (08:55 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Thu, 30 Nov 2017 07:55:16 +0000 (08:55 +0100)
- Harmonizes usage of #ifdef also for:
  HAVE_STRFTIME, HAVE_STDARG_H, HAVE_GETRUSAGE
- Fixes compiler warnings like:
  rrd_tool.c:468:5: warning: "HAVE_GETRUSAGE" is not defined,
  evaluates to 0 [-Wundef]

src/rrd_dump.c
src/rrd_graph.c
src/rrd_snprintf.c
src/rrd_tool.c

index e975bf5a8d4aad32fbf4f3e5bc5123f350d88b4c..9412a8f12f5846dfa3f24f9ce5ff2c66304c99c6 100644 (file)
@@ -415,7 +415,7 @@ int rrd_dump_cb_r(
                 + (timer * (long)rrd.rra_def[i].pdp_cnt * (long)rrd.stat_head->pdp_step);
 
             timer++;
-#if HAVE_STRFTIME
+#ifdef HAVE_STRFTIME
             localtime_r(&now, &tm);
             strftime(somestring, 255, "%Y-%m-%d %H:%M:%S %Z", &tm);
 #else
index 2e7d7fc1e425579bc7e70362ff74e4c17c73e292..c69881d11bcc04886c7f1e43ead654887c20a2f8 100644 (file)
@@ -3035,7 +3035,7 @@ void vertical_grid(
         /* are we inside the graph ? */
         if (tilab < im->start || tilab > im->end)
             continue;
-#if HAVE_STRFTIME
+#ifdef HAVE_STRFTIME
         localtime_r(&tilab, &tm);
         strftime(graph_label, 99, im->xlab_user.stst, &tm);
 #else
index 8c882a4dca58c2f14662c22b8ddee40ad53d0de4..125ebb8371ed50ac02425f28c62b40b4aad332a2 100644 (file)
 #ifdef VA_SHIFT
 #undef VA_SHIFT
 #endif /* defined(VA_SHIFT) */
-#if HAVE_STDARG_H
+#ifdef HAVE_STDARG_H
 #include <stdarg.h>
 #define VA_START(ap, last) va_start(ap, last)
 #define VA_SHIFT(ap, value, type) /* No-op for ANSI C. */
index 38871d0694fe4b2e1eecfda7c0d596d2a787dfd1..025c2237f7ac6a8f260fe20a84dbfabe52c29e08 100644 (file)
@@ -465,7 +465,7 @@ int main(
     }
 
     if (((argc == 2) || (argc == 3)) && !strcmp("-", argv[1])) {
-#if HAVE_GETRUSAGE
+#ifdef HAVE_GETRUSAGE
         struct rusage myusage;
         struct timeval starttime;
         struct timeval currenttime;
@@ -520,7 +520,7 @@ int main(
                 printf("ERROR: creating arguments\n");
             } else {
                 if ( HandleInputLine(argc, myargv, stdout) == 0 ){
-#if HAVE_GETRUSAGE
+#ifdef HAVE_GETRUSAGE
                     getrusage(RUSAGE_SELF, &myusage);
                     gettimeofday(&currenttime, NULL);
                     printf("OK u:%1.2f s:%1.2f r:%1.2f\n",