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.verplant.org/?a=commitdiff_plain;h=fff2d8655192db3a32c5f9623832ed3ed1e1f912;p=rrdtool.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/program@559 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/getopt.c b/src/getopt.c index 81a8e89..c1fd726 100644 --- a/src/getopt.c +++ b/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/src/rrd_afm.c b/src/rrd_afm.c index 0e3109c..01c0dce 100644 --- a/src/rrd_afm.c +++ b/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/src/rrd_cgi.c b/src/rrd_cgi.c index eab3414..ed0f837 100644 --- a/src/rrd_cgi.c +++ b/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/src/rrd_graph.c b/src/rrd_graph.c index f508cf5..dbf418d 100644 --- a/src/rrd_graph.c +++ b/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/src/rrd_nan_inf.c b/src/rrd_nan_inf.c index f40555d..22886c4 100644 --- a/src/rrd_nan_inf.c +++ b/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/src/rrd_restore.c b/src/rrd_restore.c index ad53adf..31df89f 100644 --- a/src/rrd_restore.c +++ b/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/src/rrd_rpncalc.c b/src/rrd_rpncalc.c index 73d5dde..43deb6d 100644 --- a/src/rrd_rpncalc.c +++ b/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/src/rrd_tool.c b/src/rrd_tool.c index f3b7341..6724982 100644 --- a/src/rrd_tool.c +++ b/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/src/rrd_tool.h b/src/rrd_tool.h index 53bf50a..ed08c79 100644 --- a/src/rrd_tool.h +++ b/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/src/rrd_update.c b/src/rrd_update.c index 8fd951d..a6b5983 100644 --- a/src/rrd_update.c +++ b/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/src/rrd_xport.c b/src/rrd_xport.c index ef63196..5c6ae14 100644 --- a/src/rrd_xport.c +++ b/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