From: oetiker Date: Sat, 14 May 2005 21:57:46 +0000 (+0000) Subject: it seems that _WIN32 is more commonly defined thatn WIN32 on win32 ... (gifford.heske... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ab533f8aa838fadcfd13fbea1846590b0d8ae5d2;p=rrdtool-all.git it seems that _WIN32 is more commonly defined thatn WIN32 on win32 ... (gifford.hesketh on gmail.com) git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@559 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/getopt.c b/program/src/getopt.c index 81a8e89b..c1fd726b 100644 --- a/program/src/getopt.c +++ b/program/src/getopt.c @@ -79,7 +79,7 @@ #endif #endif -#if defined (WIN32) && !defined (__CYGWIN32__) +#if defined (_WIN32) && !defined (__CYGWIN32__) /* It's not Unix, really. See? Capital letters. */ #include #define getpid() GetCurrentProcessId() diff --git a/program/src/rrd_afm.c b/program/src/rrd_afm.c index 0e3109c4..01c0dcef 100644 --- a/program/src/rrd_afm.c +++ b/program/src/rrd_afm.c @@ -4,7 +4,7 @@ * rrd_afm.h Parsing afm tables to find width of strings. ****************************************************************************/ -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include "../confignt/config.h" #else #include "config.h" diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c index eab34144..ed0f8373 100644 --- a/program/src/rrd_cgi.c +++ b/program/src/rrd_cgi.c @@ -445,7 +445,7 @@ char* rrdgetenv(long argc, const char **args) { if (envvar) { return stralloc(envvar); } else { -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) _snprintf(buf, sizeof(buf), "[ERROR:_getenv_'%s'_failed", args[0]); #else snprintf(buf, sizeof(buf), "[ERROR:_getenv_'%s'_failed", args[0]); @@ -465,7 +465,7 @@ char* rrdgetvar(long argc, const char **args) { if (value) { return stralloc(value); } else { -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) _snprintf(buf, sizeof(buf), "[ERROR:_getvar_'%s'_failed", args[0]); #else snprintf(buf, sizeof(buf), "[ERROR:_getvar_'%s'_failed", args[0]); diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index f508cf53..dbf418df 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -9,7 +9,7 @@ #include "rrd_tool.h" -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include #include #endif @@ -2634,7 +2634,7 @@ graph_paint(image_desc_t *im, char ***calcpr) if (strcmp(im->graphfile,"-")==0) { fo = im->graphhandle ? im->graphhandle : stdout; -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) /* Change translation mode for stdout to BINARY */ _setmode( _fileno( fo ), O_BINARY ); #endif @@ -2839,7 +2839,7 @@ rrd_graph_init(image_desc_t *im) for(i=0;igraph_col[i]=graph_col[i]; -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) { char *windir; char rrd_win_default_font[1000]; diff --git a/program/src/rrd_nan_inf.c b/program/src/rrd_nan_inf.c index f40555d2..22886c4b 100644 --- a/program/src/rrd_nan_inf.c +++ b/program/src/rrd_nan_inf.c @@ -1,6 +1,6 @@ #include "rrd_nan_inf.h" -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index ad53adf4..31df89f8 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -8,7 +8,7 @@ #include "rrd_rpncalc.h" #include -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include #define open _open #define close _close @@ -421,7 +421,7 @@ rrd_write(char *file_name, rrd_t *rrd, char force_overwrite) if (strcmp("-",file_name)==0){ rrd_file= stdout; } else { -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) fdflags = O_RDWR|O_BINARY|O_CREAT; #else fdflags = O_WRONLY|O_CREAT; diff --git a/program/src/rrd_rpncalc.c b/program/src/rrd_rpncalc.c index 73d5dde7..43deb6da 100644 --- a/program/src/rrd_rpncalc.c +++ b/program/src/rrd_rpncalc.c @@ -97,7 +97,7 @@ void rpn_compact2str(rpn_cdefds_t *rpnc,ds_def_t *ds_def,char **str) if (rpnc[i].op == OP_NUMBER) { /* convert a short into a string */ -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) _itoa(rpnc[i].val,buffer,10); #else sprintf(buffer,"%d",rpnc[i].val); diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c index f3b73415..6724982a 100644 --- a/program/src/rrd_tool.c +++ b/program/src/rrd_tool.c @@ -23,7 +23,7 @@ void PrintUsage(char *cmd) char help_main[] = "RRDtool 1.2.6 Copyright 1997-2005 by Tobias Oetiker \n" -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) " Compiled " __DATE__ " " __TIME__ "\n\n" #else " Compiled " MAKE_TIMESTAMP "\n\n" diff --git a/program/src/rrd_tool.h b/program/src/rrd_tool.h index 53bf50a5..ed08c79c 100644 --- a/program/src/rrd_tool.h +++ b/program/src/rrd_tool.h @@ -11,7 +11,7 @@ extern "C" { #ifndef _RRD_TOOL_H #define _RRD_TOOL_H -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include "../confignt/config.h" #else #ifdef HAVE_CONFIG_H @@ -95,7 +95,7 @@ extern int getrusage(int, struct rusage *); #include "rrd.h" -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) /* Win32 only includes */ diff --git a/program/src/rrd_update.c b/program/src/rrd_update.c index 8fd951da..a6b59832 100644 --- a/program/src/rrd_update.c +++ b/program/src/rrd_update.c @@ -13,7 +13,7 @@ #include #endif -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include #include #include @@ -25,7 +25,7 @@ #include "rrd_is_thread_safe.h" #include "unused.h" -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) /* * WIN32 does not have gettimeofday and struct timeval. This is a quick and dirty * replacement. @@ -1433,7 +1433,7 @@ LockRRD(FILE *rrdfile) rrd_fd = fileno(rrdfile); { -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) struct _stat st; if ( _fstat( rrd_fd, &st ) == 0 ) { diff --git a/program/src/rrd_xport.c b/program/src/rrd_xport.c index ef63196b..5c6ae142 100644 --- a/program/src/rrd_xport.c +++ b/program/src/rrd_xport.c @@ -11,7 +11,7 @@ #include "rrd_xport.h" #include "unused.h" -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include #include #endif