Browse Source

Win32 fixes.

Brucey 8 months ago
parent
commit
247943d84d

+ 4 - 0
expat.mod/expat.bmx

@@ -25,3 +25,7 @@ Module Text.Expat
 ModuleInfo "CC_OPTS: -std=c99"
 
 Import "common.bmx"
+
+'
+' Tweaked expat_config.h for win32.
+'

+ 6 - 0
expat.mod/expat/expat_config.h

@@ -14,7 +14,9 @@
 /* #undef HAVE_ARC4RANDOM */
 
 /* Define to 1 if you have the `arc4random_buf' function. */
+#ifndef __WIN32__
 #define HAVE_ARC4RANDOM_BUF 1
+#endif
 
 /* define if the compiler supports basic C++11 syntax */
 #define HAVE_CXX11 1
@@ -29,7 +31,9 @@
 #define HAVE_GETPAGESIZE 1
 
 /* Define to 1 if you have the `getrandom' function. */
+#ifndef __WIN32__
 #define HAVE_GETRANDOM 1
+#endif
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
@@ -56,7 +60,9 @@
 #define HAVE_STRING_H 1
 
 /* Define to 1 if you have `syscall' and `SYS_getrandom'. */
+#ifndef __WIN32__
 #define HAVE_SYSCALL_GETRANDOM 1
+#endif
 
 /* Define to 1 if you have the <sys/param.h> header file. */
 #define HAVE_SYS_PARAM_H 1

+ 4 - 0
graphviz.mod/graphviz.bmx

@@ -15,6 +15,10 @@ ModuleInfo "History: Graphviz 12.2.1"
 
 Import "common.bmx"
 
+'
+' Renamed tree_map() to gv_tree_map() to avoid conflict with BlitzMax's tree_map() function.
+'
+
 Rem
 bbdoc: A Graphviz context.
 about: 

+ 2 - 2
graphviz.mod/graphviz/lib/patchwork/patchwork.c

@@ -164,7 +164,7 @@ static void layoutTree(treenode_t * tree)
 	areas_sorted[i] = nodes[i]->area;
     }
     if (tree->area == tree->child_area)
-	recs = tree_map(nc, areas_sorted, tree->r);
+	recs = gv_tree_map(nc, areas_sorted, tree->r);
     else {
 	rectangle crec;
 	double disc, delta, m, h = tree->r.size[1], w = tree->r.size[0];
@@ -175,7 +175,7 @@ static void layoutTree(treenode_t * tree)
 	m = (h + w - disc)/2.0;
 	crec.size[0] = w - m;
 	crec.size[1] = h - m;
-	recs = tree_map(nc, areas_sorted, crec);
+	recs = gv_tree_map(nc, areas_sorted, crec);
     }
     if (Verbose)
 	fprintf (stderr, "rec %f %f %f %f\n", tree->r.x[0], tree->r.x[1], tree->r.size[0], tree->r.size[1]);

+ 1 - 1
graphviz.mod/graphviz/lib/patchwork/tree_map.c

@@ -99,7 +99,7 @@ static void squarify(size_t n, double *area, rectangle *recs, size_t nadded, dou
  *  fillred - rectangle to be filled
  *  return array of rectangles 
  */
-rectangle* tree_map(size_t n, double *area, rectangle fillrec){
+rectangle* gv_tree_map(size_t n, double *area, rectangle fillrec){
   /* fill a rectangle rec with n items, each item i has area[i] area. */
   double total = 0, minarea = 1., maxarea = 0., asp = 1, totalarea = 0;
 

+ 1 - 1
graphviz.mod/graphviz/lib/patchwork/tree_map.h

@@ -18,4 +18,4 @@ typedef struct {
   double size[2]; /* total width/height*/
 } rectangle;
 
-extern rectangle* tree_map(size_t n, double *area, rectangle fillrec);
+extern rectangle* gv_tree_map(size_t n, double *area, rectangle fillrec);

+ 8 - 0
graphviz.mod/include/config.h

@@ -87,7 +87,9 @@
 /* #undef HAVE_DL_ITERATE_PHDR */
 
 /* Define to 1 if you have the `drand48' function. */
+#ifndef __WIN32__
 #define HAVE_DRAND48 1
+#endif
 
 /* Define if you have the _dyld_func_lookup function. */
 /* #undef HAVE_DYLD */
@@ -204,7 +206,9 @@
 #define HAVE_SELECT 1
 
 /* Define to 1 if you have the `setenv' function. */
+#ifndef __WIN32__
 #define HAVE_SETENV 1
+#endif
 
 /* Define to 1 if you have the `setmode' function. */
 #define HAVE_SETMODE 1
@@ -213,7 +217,9 @@
 /* #undef HAVE_SHL_LOAD */
 
 /* Define to 1 if you have the `srand48' function. */
+#ifndef __WIN32__
 #define HAVE_SRAND48 1
+#endif
 
 /* Define to 1 if you have the <stdint.h> header file. */
 #define HAVE_STDINT_H 1
@@ -246,7 +252,9 @@
 #define HAVE_SYS_IOCTL_H 1
 
 /* Define to 1 if you have the <sys/mman.h> header file. */
+#ifndef __WIN32__
 #define HAVE_SYS_MMAN_H 1
+#endif
 
 /* Define to 1 if you have the <sys/select.h> header file. */
 #define HAVE_SYS_SELECT_H 1