]> granicus.if.org Git - graphviz/commitdiff
Use #ifdef instead of #if in gvloadimage_core.c
authorErwin Janssen <erwinjanssen@outlook.com>
Tue, 14 Mar 2017 21:14:46 +0000 (22:14 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Fri, 24 Mar 2017 10:30:11 +0000 (11:30 +0100)
Replace `#if HAVE_SYS_MMAN_H` with `#ifdef HAVE_SYS_MMAN_H`. Using the
former causes problems is HAVE_SYS_MMAN_H is defined without a value.

plugin/core/gvloadimage_core.c

index eb85c3c6ca2fb0c24f22eb260647d85469820f73..d9bbc0b108ea96677cbc41510d7af1c7481f1ba0 100644 (file)
@@ -16,7 +16,7 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if HAVE_SYS_MMAN_H
+#ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
 #ifdef _MSC_VER
@@ -140,7 +140,7 @@ static void core_loadimage_vrml(GVJ_t * job, usershape_t *us, boxf b, boolean fi
 
 static void ps_freeimage(usershape_t *us)
 {
-#if HAVE_SYS_MMAN_H
+#ifdef HAVE_SYS_MMAN_H
     munmap(us->data, us->datasize);
 #else
     free(us->data);
@@ -175,7 +175,7 @@ static void core_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean fill
             case FT_EPS:
                fstat(fd, &statbuf);
                us->datasize = statbuf.st_size;
-#if HAVE_SYS_MMAN_H
+#ifdef HAVE_SYS_MMAN_H
                us->data = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
 #else
                us->data = malloc(statbuf.st_size);