trivial diff: Fix for FreeBSD

Andrew Bromage bromage at billy.queens.unimelb.edu.au
Mon Jul 27 12:26:07 AEST 1998


G'day all.

Already committed.

Cheers,
Andrew Bromage


Estimated hours taken: 0.1

Minor fix to make Mercury compile under FreeBSD.

runtime/mercury_context.c:
	Include stdio.h after mercury_context.h.

Index: runtime/mercury_context.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_context.c,v
retrieving revision 1.7
diff -u -r1.7 mercury_context.c
--- mercury_context.c	1998/07/13 22:44:03	1.7
+++ mercury_context.c	1998/07/27 02:09:50
@@ -12,8 +12,6 @@
 
 #include "mercury_imp.h"
 
-#include <stdio.h>
-#include <unistd.h>		/* for getpid() and fork() */
 #ifdef MR_THREAD_SAFE
   #include "mercury_thread.h"
 #endif
@@ -21,6 +19,16 @@
 #include "mercury_memory_handlers.h"
 #include "mercury_context.h"
 #include "mercury_engine.h"	/* for `memdebug' */
+
+/*
+** stdio.h must be included _after_ mercury_context.h because of an
+** incompatibility with FreeBSD (2.2.x).  FreeBSD defines an inline
+** function in stdio.h, so it cannot be included until after global
+** registers have been declared, otherwise GCC complains.
+*/
+
+#include <stdio.h>
+#include <unistd.h>		/* for getpid() and fork() */
 
 MR_Context	*MR_runqueue;
 #ifdef	MR_THREAD_SAFE



More information about the developers mailing list