]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fix rc compiler redefinition warnings (nmake)
authorWolfgang Stöggl <c72578@yahoo.de>
Fri, 25 Jan 2019 10:08:18 +0000 (11:08 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Fri, 25 Jan 2019 12:49:59 +0000 (13:49 +0100)
- 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

index a0f6a1006086f4b3988d4095c01b926e01d9b3c2..b2bd7c91b1adc76ed6a312958ddd5c31bbf6c0c5 100644 (file)
 
 #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) ))