On 04/10/07 20:43, Benjamin Ducke wrote:
I'd love to give this a spin on a Win2000 and XP box.
Unfortunately, I don't have acccess to one right now.

Moritz, could you email all the files you changed?
I will try to get hold of a Windows machine to compile
and test as soon as possible.

All you need is the attached diff to xdr_stdio.c.

However, Glynn has suggested dropping xdr altogether for dbmi communication, so this will become obsolete.

Moritz
--- xdr_stdio_orig.c	Fri Sep 14 11:50:13 2007
+++ ../xdr-4.0-mingw2/xdr_stdio.c	Sun Sep 23 18:48:20 2007
@@ -111,7 +111,8 @@
 	register long *lp;
 {
 
-	if (fread((caddr_t)lp, sizeof(long), 1, (FILE *)xdrs->x_private) != 1)
+        if (read(fileno((FILE *)xdrs->x_private), (caddr_t)lp, sizeof(long)) != sizeof(long))
+
 		return (FALSE);
 #ifndef mc68000
 	*lp = ntohl(*lp);
@@ -129,7 +130,7 @@
 	long mycopy = htonl(*lp);
 	lp = &mycopy;
 #endif
-	if (fwrite((caddr_t)lp, sizeof(long), 1, (FILE *)xdrs->x_private) != 1)
+        if (write(fileno((FILE *)xdrs->x_private), (caddr_t)lp, sizeof(long)) != sizeof(long))
 		return (FALSE);
 	return (TRUE);
 }
@@ -141,7 +142,7 @@
 	u_int len;
 {
 
-	if ((len != 0) && (fread(addr, (int)len, 1, (FILE *)xdrs->x_private) != 1))
+        if ((len != 0) && (read(fileno((FILE *)xdrs->x_private), addr, (int)len) != (int)len))
 		return (FALSE);
 	return (TRUE);
 }
@@ -153,7 +154,7 @@
 	u_int len;
 {
 
-	if ((len != 0) && (fwrite(addr, (int)len, 1, (FILE *)xdrs->x_private) != 1))
+        if ((len != 0) && (write(fileno((FILE *)xdrs->x_private), addr, (int)len) != (int)len))
 		return (FALSE);
 	return (TRUE);
 }
_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to