Ver código fonte

Windows fixes

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40881 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 15 anos atrás
pai
commit
4b5e00a46c

+ 1 - 0
gui/wxpython/nviz/Makefile

@@ -46,6 +46,7 @@ $(SHLIB): $(LIB_NAME).i
 	WXWIDGETSLIB="$(WXWIDGETSLIB)" \
 	OPENGL_X11="$(OPENGL_X11)" \
 	XCFLAGS="$(XCFLAGS)" \
+	CXXFLAGS="$(COMPILE_FLAGS_CXX)" \
 	$(PYTHON) setup.py build_ext --swig=$(SWIG) --swig-opts=-c++ --build-lib=$(OBJDIR) --build-temp=$(OBJDIR)
 
 .NOTPARALLEL: $(LIB_NAME).py $(LIB_NAME)_wrap.cpp

+ 2 - 1
gui/wxpython/nviz/setup.py

@@ -26,7 +26,8 @@ libs = ['grass_gis',
         'grass_g3d']
 extras = []
 
-for flag in ['GDALCFLAGS',
+for flag in ['CXXFLAGS',
+	     'GDALCFLAGS',
              'GDALLIBS',
              'WXWIDGETSCXXFLAGS',
              'OPENGLINC',

+ 1 - 0
gui/wxpython/vdigit/Makefile

@@ -41,6 +41,7 @@ $(SHLIB): $(LIB_NAME).i cats.cpp digit.cpp driver.cpp driver_draw.cpp \
 	GEOSCFLAGS="$(GEOSCFLAGS)" \
 	WXWIDGETSCXXFLAGS="$(WXWIDGETSCXXFLAGS)" \
 	WXWIDGETSLIB="$(WXWIDGETSLIB)" \
+	CXXFLAGS="$(COMPILE_FLAGS_CXX)" \
 	$(PYTHON) setup.py build_ext --swig=$(SWIG) --swig-opts=-c++ --build-lib=$(OBJDIR) --build-temp=$(OBJDIR)
 
 .NOTPARALLEL: $(LIB_NAME).py $(LIB_NAME)_wrap.cpp

+ 2 - 1
gui/wxpython/vdigit/setup.py

@@ -27,7 +27,8 @@ libs = ['grass_dbmibase',
         'grass_vedit']
 extras = []
 
-for flag in ['GDALCFLAGS',
+for flag in ['CXXFLAGS',
+	     'GDALCFLAGS',
              'GDALLIBS',
              'GEOSCFLAGS',
              'WXWIDGETSLIB',

+ 6 - 0
lib/gis/popen.c

@@ -6,6 +6,12 @@
 #include <grass/gis.h>
 #include <grass/spawn.h>
 
+#ifdef __MINGW32__
+#include <io.h>
+#include <fcntl.h>
+#define pipe(fds) _pipe(fds, 4096, O_BINARY)
+#endif
+
 static FILE *do_popen(struct Popen *state, int wr,
 		      const char *program, const char **args)
 {

+ 5 - 2
visualization/wximgview/main.cc

@@ -189,11 +189,13 @@ void MyApp::map_file()
 #ifdef __MINGW32__
     ptr = MapViewOfFile((HANDLE) _get_osfhandle(fd),
 			FILE_MAP_READ, 0, 0, size);
+    if (!ptr)
+	G_fatal_error(_("Unable to map image file"));
 #else
     ptr = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, (off_t) 0);
-#endif
     if (ptr == MAP_FAILED)
 	G_fatal_error(_("Unable to map image file"));
+#endif
 
     imgbuf = (unsigned char *)ptr + HEADER_SIZE;
 
@@ -208,13 +210,14 @@ static void dummy_handler(int sig)
 
 static void set_handler(void)
 {
+#ifndef __MINGW32__
     struct sigaction act;
 
     act.sa_handler = &dummy_handler;
     sigemptyset(&act.sa_mask);
     act.sa_flags = 0;
     sigaction(SIGUSR1, &act, NULL);
-
+#endif
 }
 
 bool MyApp::OnInit()