[GRASS-SVN] r31858 - grass/trunk/lib/cairodriver

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 27 08:35:50 EDT 2008


Author: glynn
Date: 2008-06-27 08:35:50 -0400 (Fri, 27 Jun 2008)
New Revision: 31858

Modified:
   grass/trunk/lib/cairodriver/Graph.c
Log:
Portability fixes; respect USE_X11 and CAIRO_HAS_XLIB_SURFACE


Modified: grass/trunk/lib/cairodriver/Graph.c
===================================================================
--- grass/trunk/lib/cairodriver/Graph.c	2008-06-27 01:43:43 UTC (rev 31857)
+++ grass/trunk/lib/cairodriver/Graph.c	2008-06-27 12:35:50 UTC (rev 31858)
@@ -2,17 +2,19 @@
 #include <cairo-ps.h>
 #include <cairo-pdf.h>
 #include <cairo-svg.h>
+#if defined(USE_X11) && CAIRO_HAS_XLIB_SURFACE
 #include <cairo-xlib.h>
+#endif
 
+#include <unistd.h>
 #ifndef __MINGW32__
-#include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
 #endif
 
-#if CAIRO_HAS_XLIB_SURFACE
+#if defined(USE_X11) && CAIRO_HAS_XLIB_SURFACE
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -39,7 +41,7 @@
 static int ends_with(const char *string, const char *suffix);
 static void map_file(void);
 
-#if CAIRO_HAS_XLIB_SURFACE
+#if defined(USE_X11) && CAIRO_HAS_XLIB_SURFACE
 static int init_xlib(void)
 {
 	Display *dpy;
@@ -228,7 +230,7 @@
 	p = getenv("GRASS_AUTO_WRITE");
 	auto_write = p && strcmp(p, "TRUE") == 0;
 
-#if CAIRO_HAS_XLIB_SURFACE
+#if defined(USE_X11) && CAIRO_HAS_XLIB_SURFACE
 	p = getenv("GRASS_CAIRO_DRAWABLE");
 	if (p)
 		return init_xlib();



More information about the grass-commit mailing list