Browse Source

gis.h: fix for BSD

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55519 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 years ago
parent
commit
765989e4d4
1 changed files with 13 additions and 1 deletions
  1. 13 1
      include/defs/gis.h

+ 13 - 1
include/defs/gis.h

@@ -37,7 +37,19 @@
 # ifdef __MINGW32__
 #  include <malloc.h>
 # else
-#  include <alloca.h>
+#  if (defined(__unix__) || defined(unix)) && !defined(USG)
+#   include <sys/param.h>
+#  endif
+#  if (defined(BSD))
+    /* no malloc.h, no alloca.h ? 
+     * TODO: better 
+     * check if alloca.h exists, 
+     * if not, check if malloc.h exists,
+     * if not use stdlib.h */
+#   include <stdlib.h>
+#  else
+#   include <alloca.h>
+#  endif
 # endif
 # define G__alloca(n) alloca(n)
 # define G__freea(p)