[geos-commits] r3794 - in trunk: . src src/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Tue Apr 2 02:20:36 PDT 2013


Author: mloskot
Date: 2013-04-02 02:20:36 -0700 (Tue, 02 Apr 2013)
New Revision: 3794

Modified:
   trunk/nmake.opt
   trunk/src/Makefile.vc
   trunk/src/geom/Geometry.cpp
Log:
Add Visual Leak Detector (VLD) support to GEOS core
* Add MSVC_VLD_DIR option to nmake.opt to enable/disable VLD
* Add optional #include <vld.h> to Geometry.cpp

Modified: trunk/nmake.opt
===================================================================
--- trunk/nmake.opt	2013-03-15 18:48:16 UTC (rev 3793)
+++ trunk/nmake.opt	2013-04-02 09:20:36 UTC (rev 3794)
@@ -113,6 +113,22 @@
 !ENDIF
 
 ###############################################################################
+# Optional use of Visual Leak Detector (VLD) http://vld.codeplex.com/
+# Uncomment this line to use VLD in debug configuration only:
+!IF "$(BUILD_DEBUG)" == "YES"
+MSVC_VLD_DIR=$(EXTLIBDIR)\Source\vld\vld
+!ENDIF
+
+!IFDEF MSVC_VLD_DIR
+MSVC_VLD_FLAGS=-DMSVC_USE_VLD=1 -I$(MSVC_VLD_DIR)\include
+!IFDEF WIN64
+MSVC_VLD_LIB=/LIBPATH:$(MSVC_VLD_DIR)/lib/Win64
+!ELSE
+MSVC_VLD_LIB=/LIBPATH:$(MSVC_VLD_DIR)/lib/Win32
+!ENDIF
+!ENDIF
+
+###############################################################################
 # Include directories
 
 GEOS_INCLUDE = -I..\include -I..\capi
@@ -124,7 +140,7 @@
 # Compilation flags for Release and Debug modes
 
 GEOS_CPPFLAGS = /D "NOMINMAX" /D "WIN32_LEAN_AND_MEAN" /D "NOGDI"
-GEOS_CPPFLAGS = $(GEOS_CPPFLAGS) /D "GEOS_DLL_EXPORT"
+GEOS_CPPFLAGS = $(GEOS_CPPFLAGS) /D "GEOS_DLL_EXPORT" $(MSVC_VLD_FLAGS)
 
 !IF "$(BUILD_DEBUG)" == "YES"
 BUILD_PREFIX=_d
@@ -185,6 +201,7 @@
 # - Static Libraries (use of lib.exe wrapper is not portable, see VC++ Toolkit 2003)
 # $(LINK) /lib
 LINK = link.exe
+LINKER_FLAGS = $(MSVC_VLD_LIB)
 
 !MESSAGE **********************************************************************
 # EOF

Modified: trunk/src/Makefile.vc
===================================================================
--- trunk/src/Makefile.vc	2013-03-15 18:48:16 UTC (rev 3793)
+++ trunk/src/Makefile.vc	2013-04-02 09:20:36 UTC (rev 3794)
@@ -332,11 +332,11 @@
 	$(LINK) /lib /out:$(LIBNAME) $(OBJ)
 
 $(DLLNAME):	$(OBJ)
-	$(LINK) /dll /debug $(OBJ) /out:$(DLLNAME) /implib:$(SLIBNAME)
+	$(LINK) /dll /debug $(LINKER_FLAGS) $(OBJ) /out:$(DLLNAME) /implib:$(SLIBNAME)
 	if exist $(DLLNAME).manifest mt -manifest $(DLLNAME).manifest -outputresource:$(DLLNAME);2
 
 $(CDLLNAME): ..\capi\geos_c.obj ..\capi\geos_ts_c.obj $(DLLNAME)
-	$(LINK) /dll /debug ..\capi\geos_c.obj ..\capi\geos_ts_c.obj $(LIBNAME) /out:$(CDLLNAME) /implib:$(CLIBNAME)
+	$(LINK) /dll /debug $(LINKER_FLAGS) ..\capi\geos_c.obj ..\capi\geos_ts_c.obj $(LIBNAME) /out:$(CDLLNAME) /implib:$(CLIBNAME)
 	if exist $(CDLLNAME).manifest mt -manifest $(CDLLNAME).manifest -outputresource:$(CDLLNAME);2
   
 $(GEOS_ROOT)\include\geos\platform.h: $(GEOS_ROOT)\include\geos\platform.h.vc

Modified: trunk/src/geom/Geometry.cpp
===================================================================
--- trunk/src/geom/Geometry.cpp	2013-03-15 18:48:16 UTC (rev 3793)
+++ trunk/src/geom/Geometry.cpp	2013-04-02 09:20:36 UTC (rev 3794)
@@ -60,6 +60,12 @@
 #include <cassert>
 #include <memory>
 
+#ifdef _MSC_VER
+#  ifdef MSVC_USE_VLD
+#    include <vld.h>
+#  endif
+#endif
+
 #define SHORTCIRCUIT_PREDICATES 1
 
 using namespace std;



More information about the geos-commits mailing list