From e82476ab1a798168b1c39c27337918e431ab6de6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wolfgang=20St=C3=B6ggl?= Date: Fri, 25 Jan 2019 11:08:18 +0100 Subject: [PATCH] Fix rc compiler redefinition warnings (nmake) - Surround code in win32/rrd_config.h that causes warnings by rc with #ifndef RC_INVOKED and #endif. Remark: _MSC_VER is unknown to rc - Fixes the following warnings for .rc files, e.g.: rc /nologo /I./src /fo./win32/rrdtool.res ./win32\rrdtool.rc ./win32\rrd_config.h(130) : warning RC4005: 'isinf' : redefinition ./win32\rrd_config.h(131) : warning RC4005: 'isnan' : redefinition - This concerns: librrd-4.rc, rrdtool.rc, rrdupdate.rc, rrdcgi.rc, when using the resource compiler (rc) via nmake under Windows --- win32/rrd_config.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/win32/rrd_config.h b/win32/rrd_config.h index a0f6a100..b2bd7c91 100644 --- a/win32/rrd_config.h +++ b/win32/rrd_config.h @@ -126,11 +126,17 @@ #include "mkstemp.h" +/* _MSC_VER is not defined, when using the resource compiler (rc). + * See: https://docs.microsoft.com/en-us/windows/desktop/menurc/predefined-macros + * for how to conditionally compile the code with the RC compiler using RC_INVOKED +*/ +#ifndef RC_INVOKED #if _MSC_VER < 1900 #define isinf(a) (_fpclass(a) == _FPCLASS_NINF || _fpclass(a) == _FPCLASS_PINF) #define isnan _isnan #define snprintf _snprintf #endif +#endif #define finite _finite #define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) )) -- 2.47.2