]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fix macro redefinition warnings, update win32 build tips, .gitignore (#831)
authorWolfgang Stöggl <c72578@yahoo.de>
Mon, 9 Oct 2017 18:55:55 +0000 (20:55 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Mon, 9 Oct 2017 18:55:55 +0000 (20:55 +0200)
* Add /contrib-x64 to .gitignore

* Add gettext dependency to WIN32-BUILD-TIPS.txt

- Provides intl.dll

* Use /MD instead of /MT for Windows builds

- Change "Use Run-Time Library" to /MD like in the .vcxproj files
- This fixes png display issues of "rrdtool.exe graph" within Cacti

* Fix macro redefinition warnings (MSVC)

- Move inclusion of errno.h before the redefinition of ENOBUFS and ENOTCONN
  undef ENOBUFS and ENOTCONN before redefinition
- undef PATH_MAX before definition or redefinition
- Make definition of isinf, isnan and snprintf conditional
  if _MSC_VER < 1900
  These are supported since Visual Studio 2015
- Add comments and Visual Studio 2015 version details

.gitignore
WIN32-BUILD-TIPS.txt
win32/Makefile.msc
win32/rrd_config.h

index 50a027f8e429bfac512ef309293dc92759da8b67..4d4c315983aea3a312e10ae51131b092c98f297b 100644 (file)
@@ -66,6 +66,7 @@ Makefile
 # Windows build files
 /bindings/dotnet/*.suo
 /contrib
+/contrib-x64
 /win32/*.VC.db
 /win32/*.VC.opendb
 /win32/*.opensdf
index b4ef50e51e52d872e038c3364d50c7e1ee34cd39..5b8ced348e882d92e5ff5c60cc8cf6589954a6f8 100644 (file)
@@ -35,6 +35,8 @@ version 1.4.5 and newer with Microsoft Visual Studio 2013 (12.0.x) and newer.
     
     - expat:    http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/expat_2.1.0-1_win32.zip
 
+    - gettext:  http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
+
     - pcre:     https://downloads.sourceforge.net/project/gnuwin32/pcre/7.0/pcre-7.0-bin.zip
                 https://downloads.sourceforge.net/project/gnuwin32/pcre/7.0/pcre-7.0-lib.zip
 
index 3cb3e5fc20e945d5adca1f0ae287e198eb0137b9..1728736f5df9526813b4856b427e35a3393493ec 100644 (file)
@@ -102,14 +102,14 @@ clean:
 $(TOP)/win32/$(RRD_LIB_NAME).dll $(TOP)/win32/$(RRD_LIB_NAME).lib: \\r
         $(TOP)/win32/$(RRD_LIB_NAME).def $(TOP)/win32/$(RRD_LIB_NAME).res \\r
         $(RRD_LIB_OBJ_LIST)\r
-    cl /nologo /MT /LD /Zi /Fe$(TOP)/win32/$(RRD_LIB_NAME).dll \\r
+    cl /nologo /MD /LD /Zi /Fe$(TOP)/win32/$(RRD_LIB_NAME).dll \\r
         /Fd$(TOP)/win32/$(RRD_LIB_NAME).pdb \\r
         $(TOP)/win32/$(RRD_LIB_NAME).def $(TOP)/win32/$(RRD_LIB_NAME).res \\r
         $(RRD_LIB_OBJ_LIST) /link $(THIRD_PARTY_LIB) $(LD_FLAGS)\r
 \r
 $(TOP)/win32/rrdtool.exe: $(TOP)/win32/rrdtool.res $(TOP)/src/rrd_tool.obj \\r
         $(TOP)/win32/$(RRD_LIB_NAME).lib\r
-    cl /nologo /MT /Zi /Fe$@ $(TOP)/win32/rrdtool.res $(TOP)/src/rrd_tool.obj \\r
+    cl /nologo /MD /Zi /Fe$@ $(TOP)/win32/rrdtool.res $(TOP)/src/rrd_tool.obj \\r
         $(TOP)/win32/$(RRD_LIB_NAME).lib /link $(LD_FLAGS)\r
 #Just waiting for antivirus program to finished check tasks\r
     -@ping 1.1.1.1 -n 1 -w 1000 > NUL\r
@@ -117,7 +117,7 @@ $(TOP)/win32/rrdtool.exe: $(TOP)/win32/rrdtool.res $(TOP)/src/rrd_tool.obj \
 \r
 $(TOP)/win32/rrdupdate.exe: $(TOP)/win32/rrdupdate.res $(TOP)/src/rrdupdate.obj \\r
         $(TOP)/src/plbasename.obj $(TOP)/win32/$(RRD_LIB_NAME).lib\r
-    cl /nologo /MT /Zi /Fe$@ $(TOP)/win32/rrdupdate.res $(TOP)/src/rrdupdate.obj \\r
+    cl /nologo /MD /Zi /Fe$@ $(TOP)/win32/rrdupdate.res $(TOP)/src/rrdupdate.obj \\r
         $(TOP)/src/plbasename.obj $(TOP)/win32/$(RRD_LIB_NAME).lib /link $(LD_FLAGS)\r
 #Just waiting for antivirus program to finished check tasks\r
     -@ping 1.1.1.1 -n 1 -w 1000 > NUL\r
@@ -126,7 +126,7 @@ $(TOP)/win32/rrdupdate.exe: $(TOP)/win32/rrdupdate.res $(TOP)/src/rrdupdate.obj
 $(TOP)/win32/rrdcgi.exe: $(TOP)/win32/rrdcgi.res $(TOP)/src/rrd_cgi.obj \\r
         $(TOP)/src/optparse.obj \\r
         $(TOP)/win32/$(RRD_LIB_NAME).lib\r
-    cl /nologo /MT /Zi /Fe$@ $(TOP)/win32/rrdcgi.res $(TOP)/src/rrd_cgi.obj \\r
+    cl /nologo /MD /Zi /Fe$@ $(TOP)/win32/rrdcgi.res $(TOP)/src/rrd_cgi.obj \\r
         $(TOP)/src/optparse.obj \\r
         $(TOP)/win32/$(RRD_LIB_NAME).lib /link $(LD_FLAGS)\r
 #Just waiting for antivirus program to finished check tasks\r
@@ -134,10 +134,10 @@ $(TOP)/win32/rrdcgi.exe: $(TOP)/win32/rrdcgi.res $(TOP)/src/rrd_cgi.obj \
     -mt -manifest $(TOP)/win32/uac.manifest -outputresource:$(TOP)/win32/rrdcgi.exe;#1\r
 \r
 {$(TOP)/src}.c{$(TOP)/src}.obj:\r
-    cl /nologo /MT /DWIN32 /c $(CPPFLAGS) /Fo$@ $<\r
+    cl /nologo /MD /DWIN32 /c $(CPPFLAGS) /Fo$@ $<\r
 \r
 {$(TOP)/win32}.rc{$(TOP)/win32}.res:\r
     rc /nologo /I./src /fo$@ $<\r
 \r
 {$(TOP)/win32}.c{$(TOP)/win32}.obj:\r
-    cl /nologo /MT /DWIN32 /c $(CPPFLAGS) /Fo$@ $<\r
+    cl /nologo /MD /DWIN32 /c $(CPPFLAGS) /Fo$@ $<\r
index 783377ad98b8432708273849f0e1e24c0acf47df..cc56052187b7379f299a16a997e6ce284871148c 100644 (file)
 #define HAVE_TZSET 1
 
 /* Misc Missing Windows defines */
+#undef PATH_MAX /* PATH_MAX is defined in win32/dirent.h too. Relevant, if included before rrd_config.h */
 #define PATH_MAX 1024
 
-/*
- * Windows Sockets errors redefined as regular Berkeley error constants.
- */
-#define ENOBUFS WSAENOBUFS
-#define ENOTCONN WSAENOTCONN
-
 
 #include <ctype.h>
 #include <direct.h>
 #include <stdlib.h>
 #include <WinSock.h>
 
+#include <errno.h>  /* errno.h has to be included before the redefinitions of ENOBUFS and ENOTCONN below */
+/*
+ * Windows Sockets errors redefined as regular Berkeley error constants.
+ */
+#undef ENOBUFS  /* undefine first, because this is defined in errno.h and redefined here */
+#define ENOBUFS WSAENOBUFS
+#undef ENOTCONN /* undefine first, because this is defined in errno.h and redefined here */
+#define ENOTCONN WSAENOTCONN
 
-#include <errno.h>
 #include "mkstemp.h"
 
-
+#if _MSC_VER < 1900
 #define isinf(a) (_fpclass(a) == _FPCLASS_NINF || _fpclass(a) == _FPCLASS_PINF)
 #define isnan _isnan
-#define finite _finite
 #define snprintf _snprintf
+#endif
+
+#define finite _finite
 #define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) ))
 #define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
 #define strcasecmp _stricmp
 
 // in MSVC++ 12.0 / Visual Studio 2013 is a definition of round in math.h
 // some values of _MSC_VER
+//MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015)
 //MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013)
 //MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012)
 //MSVC++ 10.0 _MSC_VER == 1600 (Visual Studio 2010)