[m-rev.] diff: fix warnings from runtime on MacOS 10.3

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Jun 29 16:01:07 AEST 2005


Estimated hours taken: 0.2
Branches: main, release

Fix some warnings from the C compiler when compiling the
runtime on MacOS 10.3.  These problems seem to have been fixed
in 10.4.

runtime/mercury_context.c:
	Include unistd.h if it available and MR_CAN_DO_PENDING_IO
	is available.  The function prototype for select() is not
	visible on MacOS 10.3 otherwise.

runtime/mercury_reg_workarounds.c:
	Include strings.h, otherwise the prototype for
	bzero() is not visible.

Julien.

Index: mercury_context.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_context.c,v
retrieving revision 1.39
diff -u -r1.39 mercury_context.c
--- mercury_context.c	23 Jul 2004 06:13:13 -0000	1.39
+++ mercury_context.c	29 Jun 2005 05:52:39 -0000
@@ -19,6 +19,9 @@
 #ifdef MR_CAN_DO_PENDING_IO
   #include <sys/types.h>	/* for fd_set */
   #include <sys/time.h>		/* for struct timeval */
+  #ifdef MR_HAVE_UNISTD_H
+	#include <unistd.h>	/* for select() on OS X */
+  #endif
 #endif

 #include "mercury_memory_handlers.h"
Index: mercury_reg_workarounds.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_reg_workarounds.c,v
retrieving revision 1.7
diff -u -r1.7 mercury_reg_workarounds.c
--- mercury_reg_workarounds.c	15 Dec 2004 06:57:50 -0000	1.7
+++ mercury_reg_workarounds.c	29 Jun 2005 05:52:40 -0000
@@ -16,6 +16,15 @@

 #ifdef	MR_CAN_DO_PENDING_IO

+/*
+** Work around for a problem on MacOS 10.3 and earlier.
+** The function prototype for bzero() is not visible otherwise.
+** This seems to have been fixed in MacOS 10.4.
+*/
+#if defined(__APPLE__) && (__MACH__)
+	#include <strings.h>
+#endif
+
 #include <sys/types.h>	/* for fd_set and FD_ZERO() */
 #include <sys/time.h>	/* for FD_ZERO() */


--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list