[m-rev.] for review: add MR_ prefixes

Simon Taylor stayl at cs.mu.OZ.AU
Tue Feb 12 23:26:04 AEDT 2002


Estimated hours taken: 2.5
Branches: main

Add MR_ prefixes to uses of configuration macros.
Bootcheck now succeeds with MR_NO_CONF_BACKWARDS_COMPAT.

Mmake.common.in:
	Define MR_NO_CONF_BACKWARDS_COMPAT when checking
	for namespace cleanliness.

configure.in:
*/*.c:
*/*.h:
*/*.m:
	Add MR_ prefixes.

Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.58
diff -u -u -r1.58 Mmake.common.in
--- Mmake.common.in	29 Jun 2001 15:55:02 -0000	1.58
+++ Mmake.common.in	11 Feb 2002 17:43:43 -0000
@@ -272,7 +272,7 @@
 AWK = awk
 %.check.macros: %.h %.check.c
 	-$(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) \
-		-DMERCURY_BOOTSTRAP_H \
+		-DMERCURY_BOOTSTRAP_H -DMR_NO_CONF_BACKWARDS_COMPAT \
 		-E $*.check.c \
 		-nostdinc -dN \
 		2> /dev/null | $(AWK) '/^#define/ { print $$2; }' | \
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.296
diff -u -u -r1.296 configure.in
--- configure.in	11 Feb 2002 12:11:31 -0000	1.296
+++ configure.in	12 Feb 2002 06:49:22 -0000
@@ -1667,8 +1667,8 @@
 
 	AC_CACHE_VAL(mercury_cv_gcc_model_fast,
 	AC_TRY_RUN([
-	#define USE_GCC_NONLOCAL_GOTOS
-	#define USE_GCC_GLOBAL_REGISTERS
+	#define MR_USE_GCC_NONLOCAL_GOTOS
+	#define MR_USE_GCC_GLOBAL_REGISTERS
 	#include "mercury_engine.h"
 	changequote(<<,>>) 
 	MercuryEngine MR_engine_base;
@@ -1700,7 +1700,7 @@
 
 AC_CACHE_VAL(mercury_cv_gcc_model_reg,
 AC_TRY_RUN([
-#define USE_GCC_GLOBAL_REGISTERS
+#define MR_USE_GCC_GLOBAL_REGISTERS
 #include "mercury_engine.h"
 changequote(<<,>>) 
 MercuryEngine MR_engine_base;
@@ -2329,11 +2329,11 @@
 AC_TRY_RUN([
 changequote(<<,>>) 
 
-/* USE_GCC_GLOBAL_REGISTERS are essential to the purpose of the test. */
-/* We define USE_GCC_NONLOCAL_GOTOS because some platforms (e.g. SPARCs) */
-/* cannot have USE_GCC_GLOBAL_REGISTERS without it. */
-#define	USE_GCC_GLOBAL_REGISTERS
-#define USE_GCC_NONLOCAL_GOTOS
+/* MR_USE_GCC_GLOBAL_REGISTERS are essential to the purpose of the test. */
+/* We define MR_USE_GCC_NONLOCAL_GOTOS because some platforms (e.g. SPARCs) */
+/* cannot have MR_USE_GCC_GLOBAL_REGISTERS without it. */
+#define	MR_USE_GCC_GLOBAL_REGISTERS
+#define MR_USE_GCC_NONLOCAL_GOTOS
 #include "mercury_imp.h"
 #include "trace/mercury_trace_spy.h"
 
Index: browser/dl.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/dl.m,v
retrieving revision 1.14
diff -u -u -r1.14 dl.m
--- browser/dl.m	20 Jan 2002 07:32:13 -0000	1.14
+++ browser/dl.m	11 Feb 2002 17:04:35 -0000
@@ -85,7 +85,7 @@
 	#include <stdio.h>
 	#include ""mercury_conf.h""
 	#include ""mercury_string.h""	/* for MR_make_aligned_string_copy() */
-#ifdef HAVE_DLFCN_H
+#ifdef MR_HAVE_DLFCN_H
 	#include <dlfcn.h>
 #endif
 ").
@@ -117,7 +117,7 @@
 :- pragma c_code(dlopen(FileName::in, Mode::in, Scope::in, Result::out,
 		_IO0::di, _IO::uo), [], "
 {
-#if defined(HAVE_DLFCN_H) && defined(HAVE_DLOPEN) \
+#if defined(MR_HAVE_DLFCN_H) && defined(MR_HAVE_DLOPEN) \
  && defined(RTLD_NOW) && defined(RTLD_LAZY)
 	int mode = (Mode ? RTLD_NOW : RTLD_LAZY);
 	/* not all systems have RTLD_GLOBAL */
@@ -429,7 +429,7 @@
 :- pragma c_code(dlsym(Handle::in, Name::in, Pointer::out,
 	_IO0::di, _IO::uo), [will_not_call_mercury], "
 {
-#if defined(HAVE_DLFCN_H) && defined(HAVE_DLSYM)
+#if defined(MR_HAVE_DLFCN_H) && defined(MR_HAVE_DLSYM)
 	Pointer = (MR_Word) dlsym((void *) Handle, Name);
 #else
 	Pointer = (MR_Word) NULL;
@@ -442,7 +442,7 @@
 {
 	const char *msg;
 
-#if defined(HAVE_DLFCN_H) && defined(HAVE_DLERROR)
+#if defined(MR_HAVE_DLFCN_H) && defined(MR_HAVE_DLERROR)
 	msg = dlerror();
 	if (msg == NULL) msg = """";
 #else
@@ -465,7 +465,7 @@
 */
 :- pred dlclose(c_pointer::in, io__state::di, io__state::uo) is det.
 :- pragma c_code(dlclose(Handle::in, _IO0::di, _IO::uo), [], "
-#if defined(HAVE_DLFCN_H) && defined(HAVE_DLCLOSE)
+#if defined(MR_HAVE_DLFCN_H) && defined(MR_HAVE_DLCLOSE)
 	dlclose((void *)Handle)
 #endif
 ").
Index: browser/name_mangle.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/name_mangle.m,v
retrieving revision 1.4
diff -u -u -r1.4 name_mangle.m
--- browser/name_mangle.m	11 Jan 2001 05:59:31 -0000	1.4
+++ browser/name_mangle.m	11 Feb 2002 17:04:35 -0000
@@ -249,7 +249,7 @@
 
 :- pred use_asm_labels is semidet.
 :- pragma c_code(use_asm_labels, [will_not_call_mercury, thread_safe], "
-#ifdef USE_ASM_LABELS
+#ifdef MR_USE_ASM_LABELS
 	SUCCESS_INDICATOR = TRUE;
 #else
 	SUCCESS_INDICATOR = FALSE;
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.231
diff -u -u -r1.231 mercury_compile.m
--- compiler/mercury_compile.m	11 Feb 2002 09:00:18 -0000	1.231
+++ compiler/mercury_compile.m	11 Feb 2002 17:04:50 -0000
@@ -94,7 +94,7 @@
 :- pred gc_init(io__state::di, io__state::uo) is det.
 
 :- pragma c_code(gc_init(_IO0::di, _IO::uo), [will_not_call_mercury], "
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	/*
 	** Explicitly force the initial heap size to be at least 4 Mb.
 	**
Index: compiler/pragma_c_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/pragma_c_gen.m,v
retrieving revision 1.47
diff -u -u -r1.47 pragma_c_gen.m
--- compiler/pragma_c_gen.m	24 Oct 2001 13:34:35 -0000	1.47
+++ compiler/pragma_c_gen.m	11 Feb 2002 17:04:55 -0000
@@ -60,7 +60,7 @@
 %	MR_save_registers(); /* see notes (1) and (2) below */
 %	{ <the c code itself> }
 %	<for semidet code, check of r1>
-%	#ifndef CONSERVATIVE_GC
+%	#ifndef MR_CONSERVATIVE_GC
 %	  MR_restore_registers(); /* see notes (1) and (3) below */
 %	#endif
 %	<assignment of the output values from local variables to registers>
@@ -505,7 +505,7 @@
 	),
 
 	%
-	% #ifndef CONSERVATIVE_GC
+	% #ifndef MR_CONSERVATIVE_GC
 	%   MR_restore_registers(); /* see notes (1) and (3) above */
 	% #endif
 	%
@@ -513,7 +513,7 @@
 		RestoreRegsComp = pragma_c_noop
 	;
 		RestoreRegsComp = pragma_c_raw_code(
-		"#ifndef CONSERVATIVE_GC\n\tMR_restore_registers();\n#endif\n",
+		"#ifndef MR_CONSERVATIVE_GC\n\tMR_restore_registers();\n#endif\n",
 		live_lvals_info(set__init)
 		)
 	},
Index: extras/aditi/aditi.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/aditi/aditi.m,v
retrieving revision 1.14
diff -u -u -r1.14 aditi.m
--- extras/aditi/aditi.m	4 Dec 2000 18:28:30 -0000	1.14
+++ extras/aditi/aditi.m	11 Feb 2002 17:05:03 -0000
@@ -437,7 +437,7 @@
 	/*
 	** We might allocate memory from may_call_mercury C code.
 	*/
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 #error ""The Aditi interface requires conservative garbage collection. \\
                 Use a compilation grade containing .gc.""
 #endif
Index: extras/concurrency/semaphore.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/concurrency/semaphore.m,v
retrieving revision 1.10
diff -u -u -r1.10 semaphore.m
--- extras/concurrency/semaphore.m	22 Nov 2001 10:37:49 -0000	1.10
+++ extras/concurrency/semaphore.m	11 Feb 2002 17:05:04 -0000
@@ -74,7 +74,7 @@
 ").
 
 :- pragma c_header_code("
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   void ME_finalize_semaphore(GC_PTR obj, GC_PTR cd);
 #endif
 ").
@@ -103,7 +103,7 @@
 	** The condvar and the mutex will need to be destroyed
 	** when the semaphore is garbage collected.
 	*/
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	GC_REGISTER_FINALIZER(sem, ME_finalize_semaphore, NULL, NULL, NULL);
 #endif
 
@@ -112,7 +112,7 @@
 }").
 
 :- pragma c_code("
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   void
   ME_finalize_semaphore(GC_PTR obj, GC_PTR cd)
   {
Index: extras/curs/curs.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curs/curs.m,v
retrieving revision 1.2
diff -u -u -r1.2 curs.m
--- extras/curs/curs.m	22 Sep 2001 11:30:28 -0000	1.2
+++ extras/curs/curs.m	11 Feb 2002 17:05:04 -0000
@@ -309,7 +309,7 @@
 
 :- pragma foreign_code("C","
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 
 /*      
 ** The addresses of the closures that we pass to curses
Index: extras/curses/basics.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curses/basics.m,v
retrieving revision 1.2
diff -u -u -r1.2 basics.m
--- extras/curses/basics.m	31 Jan 2000 03:12:54 -0000	1.2
+++ extras/curses/basics.m	11 Feb 2002 17:05:04 -0000
@@ -302,7 +302,7 @@
 
 :- pragma c_code("
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 
 /*
 ** The addresses of the closures that we pass to curses
Index: extras/graphics/mercury_tcltk/mtcltk.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_tcltk/mtcltk.m,v
retrieving revision 1.5
diff -u -u -r1.5 mtcltk.m
--- extras/graphics/mercury_tcltk/mtcltk.m	16 Jul 2001 10:21:44 -0000	1.5
+++ extras/graphics/mercury_tcltk/mtcltk.m	11 Feb 2002 17:05:06 -0000
@@ -305,7 +305,7 @@
 
 :- pragma c_code("
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 
 /*
 ** The addresses of the closures that we pass to Tk
Index: extras/odbc/odbc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/odbc/odbc.m,v
retrieving revision 1.12
diff -u -u -r1.12 odbc.m
--- extras/odbc/odbc.m	8 May 2000 13:48:24 -0000	1.12
+++ extras/odbc/odbc.m	11 Feb 2002 17:05:08 -0000
@@ -310,10 +310,10 @@
 	** Conservative garbage collection also makes restoring the state
 	** after an exception a bit simpler.
 	*/	
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 #error ""The OBDC interface requires conservative garbage collection. \\
 		Use a compilation grade containing .gc.""
-#endif /* ! CONSERVATIVE_GC */
+#endif /* ! MR_CONSERVATIVE_GC */
 
 #ifdef MODBC_IODBC
 
Index: extras/references/nb_reference.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/nb_reference.m,v
retrieving revision 1.4
diff -u -u -r1.4 nb_reference.m
--- extras/references/nb_reference.m	21 Jan 2002 05:20:34 -0000	1.4
+++ extras/references/nb_reference.m	11 Feb 2002 17:05:10 -0000
@@ -61,12 +61,12 @@
 :- pragma inline(new_nb_reference/2).
 :- pragma c_code(new_nb_reference(X::in, Ref::out), will_not_call_mercury, "
 	MR_incr_hp(Ref, 1);
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	MR_save_transient_registers();
 #endif
 	*(MR_Word *) Ref = MR_make_long_lived(X, (MR_TypeInfo) TypeInfo_for_T,
 			(MR_Word *) Ref);
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	MR_restore_transient_registers();
 #endif
 ").
@@ -78,12 +78,12 @@
 
 :- pragma inline(update/2).
 :- pragma c_code(update(Ref::in, X::in), will_not_call_mercury, "
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	MR_save_transient_registers();
 #endif
 	*(MR_Word *) Ref = MR_make_long_lived(X, (MR_TypeInfo) TypeInfo_for_T,
 			(MR_Word *) Ref);
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	MR_restore_transient_registers();
 #endif
 ").
Index: library/benchmarking.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/benchmarking.m,v
retrieving revision 1.45
diff -u -u -r1.45 benchmarking.m
--- library/benchmarking.m	20 Jan 2002 07:32:18 -0000	1.45
+++ library/benchmarking.m	11 Feb 2002 17:05:12 -0000
@@ -164,7 +164,7 @@
 ML_report_stats(void)
 {
 	int			time_at_prev_stat;
-#if !defined(MR_HIGHLEVEL_CODE) || !defined(CONSERVATIVE_GC)
+#if !defined(MR_HIGHLEVEL_CODE) || !defined(MR_CONSERVATIVE_GC)
 	MercuryEngine		*eng;
 #endif
 #ifdef MR_MPROF_PROFILE_MEMORY
@@ -179,7 +179,7 @@
 	time_at_prev_stat = MR_time_at_last_stat;
 	MR_time_at_last_stat = MR_get_user_cpu_miliseconds();
 
-#if !defined(MR_HIGHLEVEL_CODE) || !defined(CONSERVATIVE_GC)
+#if !defined(MR_HIGHLEVEL_CODE) || !defined(MR_CONSERVATIVE_GC)
 	eng = MR_get_engine();
 #endif
 
@@ -200,7 +200,7 @@
 	);
 #endif
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	{ char local_var;
 	  fprintf(stderr, "" C Stack: %.3fk,"",
 		labs(&local_var - (char *) GC_stackbottom) / 1024.0);
@@ -219,7 +219,7 @@
 	** Print heap usage information.
 	*/
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	fprintf(stderr, 
 		""\\n#GCs: %lu, ""
 		""Heap used since last GC: %.3fk, Total used: %.3fk"",
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.66
diff -u -u -r1.66 builtin.m
--- library/builtin.m	30 Jan 2002 05:08:51 -0000	1.66
+++ library/builtin.m	11 Feb 2002 17:05:13 -0000
@@ -336,7 +336,7 @@
 
 MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_UNUSED(void, 0, MR_TYPECTOR_REP_VOID);
 
-#ifdef	NATIVE_GC
+#ifdef	MR_NATIVE_GC
 
 /*
 ** The following type_ctor_infos are used only by accurate gc.
@@ -349,7 +349,7 @@
 MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_UNUSED(redofr, 0, MR_TYPECTOR_REP_REDOFR);
 MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_UNUSED(redoip, 0, MR_TYPECTOR_REP_REDOIP);
 
-#endif /* NATIVE_GC */
+#endif /* MR_NATIVE_GC */
 
 /*
 ** The following type_ctor_infos are used both accurate gc and by the debugger.
Index: library/exception.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/exception.m,v
retrieving revision 1.56
diff -u -u -r1.56 exception.m
--- library/exception.m	20 Jan 2002 07:32:19 -0000	1.56
+++ library/exception.m	11 Feb 2002 17:05:13 -0000
@@ -1830,7 +1830,7 @@
 		MR_exception);
 	MR_discard_tickets_to(MR_EXCEPTION_STRUCT->MR_excp_ticket_counter);
 #endif
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	/*
 	** Reset the heap.  But we need to be careful to preserve the
 	** thrown exception object.
@@ -1912,7 +1912,7 @@
 		MR_sol_hp = MR_EXCEPTION_STRUCT->MR_excp_solns_heap_ptr;
 	}
 }
-#endif /* !defined(CONSERVATIVE_GC) */
+#endif /* !defined(MR_CONSERVATIVE_GC) */
 
 	/*
 	** Pop the final exception handler frame off the nondet stack,
Index: library/float.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/float.m,v
retrieving revision 1.41
diff -u -u -r1.41 float.m
--- library/float.m	5 Feb 2002 16:30:05 -0000	1.41
+++ library/float.m	11 Feb 2002 17:05:14 -0000
@@ -374,7 +374,7 @@
 
 	#define	ML_FLOAT_RADIX	FLT_RADIX	/* There is no DBL_RADIX. */
 
-	#if defined USE_SINGLE_PREC_FLOAT
+	#if defined MR_USE_SINGLE_PREC_FLOAT
 		#define	ML_FLOAT_MAX		FLT_MAX
 		#define	ML_FLOAT_MIN		FLT_MIN
 		#define	ML_FLOAT_EPSILON	FLT_EPSILON
Index: library/gc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/gc.m,v
retrieving revision 1.6
diff -u -u -r1.6 gc.m
--- library/gc.m	31 May 2001 06:00:04 -0000	1.6
+++ library/gc.m	11 Feb 2002 17:05:14 -0000
@@ -39,7 +39,7 @@
 :- pragma no_inline(garbage_collect/0).
 
 :- pragma foreign_proc("C", garbage_collect, [may_call_mercury], "
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #ifndef MR_HIGHLEVEL_CODE
 	/* clear out the stacks and registers before garbage collecting */
 	MR_clear_zone_for_GC(MR_CONTEXT(MR_ctxt_detstack_zone), MR_sp + 1);
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.241
diff -u -u -r1.241 io.m
--- library/io.m	4 Feb 2002 05:22:48 -0000	1.241
+++ library/io.m	11 Feb 2002 17:05:14 -0000
@@ -1785,10 +1785,10 @@
 %	otherwise Size is -1.
 
 :- pragma foreign_decl("C", "
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
 	#include <unistd.h>
 #endif
-#ifdef HAVE_SYS_STAT_H
+#ifdef MR_HAVE_SYS_STAT_H
 	#include <sys/stat.h>
 #endif
 ").
@@ -1799,8 +1799,8 @@
 			thread_safe],
 "{
 	MercuryFile *f = (MercuryFile *) Stream;
-#if defined(HAVE_FSTAT) && \
-    (defined(HAVE_FILENO) || defined(fileno)) && \
+#if defined(MR_HAVE_FSTAT) && \
+    (defined(MR_HAVE_FILENO) || defined(fileno)) && \
     defined(S_ISREG)
 	struct stat s;
 	if (MR_IS_FILE_STREAM(*f)) {
@@ -1849,7 +1849,7 @@
 		Status::out, Msg::out, Time::out, IO0::di, IO::uo),
 		[will_not_call_mercury, promise_pure, thread_safe],
 "{
-#ifdef HAVE_STAT
+#ifdef MR_HAVE_STAT
 	struct stat s;
 	if (stat(FileName, &s) == 0) {
 		/* XXX This assumes that a time_t will fit into an MR_Word. */
@@ -1905,7 +1905,7 @@
 	MR_Char *buffer0 = (MR_Char *) Buffer0;
 	MR_Char *buffer;
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	buffer = GC_REALLOC(buffer0, NewSize * sizeof(MR_Char));
 #else
 	if (buffer0 + OldSize == (MR_Char *) MR_hp) {
@@ -2985,7 +2985,7 @@
 	io__get_stream_id(Stream::in, Id::out), 
 		[will_not_call_mercury, promise_pure], "
 
-#ifndef NATIVE_GC
+#ifndef MR_NATIVE_GC
 	/* 
 	** Most of the time, we can just use the pointer to the stream
 	** as a unique identifier.
@@ -3112,7 +3112,7 @@
 		[will_not_call_mercury, promise_pure, tabled_for_io],
 "
 	/* for Windows DLLs, we need to call GC_INIT() from each DLL */
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	GC_INIT();
 #endif
 	MR_add_root(&ML_io_stream_names, (MR_TypeInfo) StreamNamesType);
@@ -3235,7 +3235,7 @@
 #include <string.h>
 #include <errno.h>
 
-#ifdef HAVE_SYS_WAIT
+#ifdef MR_HAVE_SYS_WAIT_H
   #include <sys/wait.h>		/* for WIFEXITED, WEXITSTATUS, etc. */
 #endif
 
@@ -3320,8 +3320,8 @@
 	MR_mercuryfile_init(NULL, 1, &mercury_stdin_binary);
 	MR_mercuryfile_init(NULL, 1, &mercury_stdout_binary);
 
-#if defined(HAVE_FDOPEN) && (defined(HAVE_FILENO) || defined(fileno)) && \
-    defined(HAVE_DUP)
+#if defined(MR_HAVE_FDOPEN) && (defined(MR_HAVE_FILENO) || defined(fileno)) && \
+    defined(MR_HAVE_DUP)
 	MR_file(mercury_stdin_binary) = fdopen(dup(fileno(stdin)), ""rb"");
 	if (MR_file(mercury_stdin_binary) == NULL) {
 		MR_fatal_error(""error opening standard input stream in ""
@@ -4950,7 +4950,7 @@
 %#include <stdio.h>
 
 :- pragma foreign_decl("C", "
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
 	#include <unistd.h>
 #endif
 	#include <sys/types.h>
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.96
diff -u -u -r1.96 private_builtin.m
--- library/private_builtin.m	5 Feb 2002 16:30:06 -0000	1.96
+++ library/private_builtin.m	11 Feb 2002 17:05:15 -0000
@@ -1179,7 +1179,7 @@
 :- pragma foreign_proc("C", gc_trace(Pointer::in),
 	[will_not_call_mercury, thread_safe],
 "
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
 	*(MR_Word *)Pointer =
 		MR_agc_deep_copy((MR_Word *) Pointer,
 			(MR_TypeInfo) TypeInfo_for_T,
Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.261
diff -u -u -r1.261 std_util.m
--- library/std_util.m	4 Feb 2002 05:22:51 -0000	1.261
+++ library/std_util.m	11 Feb 2002 17:05:16 -0000
@@ -911,7 +911,7 @@
 	[will_not_call_mercury, thread_safe],
 "
 	/* save heap states */
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
  	HeapPtr = (MR_Word) MR_hp;
  	SolutionsHeapPtr = (MR_Word) MR_sol_hp;
 #else
@@ -998,7 +998,7 @@
 	swap_heap_and_solutions_heap,
 	[will_not_call_mercury, thread_safe],
 "{
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	MR_MemoryZone *temp_zone;
 	MR_Word *temp_hp;
 
@@ -1036,7 +1036,7 @@
 
 #include ""mercury_deep_copy.h""
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   /* for conservative GC, shallow copies suffice */
   #define MR_PARTIAL_DEEP_COPY(SolutionsHeapPtr,			\\
   		OldVar, NewVal, TypeInfo_for_T)				\\
@@ -1116,7 +1116,7 @@
 	reset_solutions_heap(SolutionsHeapPtr::in),
 	[will_not_call_mercury, thread_safe, promise_pure],
 "
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	MR_sol_hp = (MR_Word *) SolutionsHeapPtr;
 #endif
 ").
Index: library/string.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/string.m,v
retrieving revision 1.166
diff -u -u -r1.166 string.m
--- library/string.m	12 Feb 2002 01:39:58 -0000	1.166
+++ library/string.m	12 Feb 2002 09:02:07 -0000
@@ -1870,7 +1870,7 @@
 /*-----------------------------------------------------------------------*/
 
 :- pragma c_header_code("
-#ifdef USE_GCC_GLOBAL_REGISTERS
+#ifdef MR_USE_GCC_GLOBAL_REGISTERS
 	/*
 	** GNU C version egcs-1.1.2 crashes with `fixed or forbidden
 	** register spilled' in grade asm_fast.gc.tr.debug
Index: library/time.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/time.m,v
retrieving revision 1.23
diff -u -u -r1.23 time.m
--- library/time.m	20 Jan 2002 07:32:27 -0000	1.23
+++ library/time.m	11 Feb 2002 17:05:17 -0000
@@ -160,10 +160,10 @@
 
 :- pragma c_header_code("
 	#include <time.h>
-	#ifdef HAVE_SYS_TYPES_H
+	#ifdef MR_HAVE_SYS_TYPES_H
 		#include <sys/types.h>
 	#endif
-	#ifdef HAVE_SYS_TIMES_H
+	#ifdef MR_HAVE_SYS_TIMES_H
 		#include <sys/times.h>
 	#endif
 
Index: runtime/RESERVED_MACRO_NAMES
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/RESERVED_MACRO_NAMES,v
retrieving revision 1.9
diff -u -u -r1.9 RESERVED_MACRO_NAMES
--- runtime/RESERVED_MACRO_NAMES	11 Feb 2002 12:11:42 -0000	1.9
+++ runtime/RESERVED_MACRO_NAMES	11 Feb 2002 17:35:52 -0000
@@ -48,87 +48,8 @@
 # XXX we ought to add MR_ prefixes to all of these.
 # XXX TAG_BITS is defined in mercury_tags.h
 pid_t
-BOXED_FLOAT
-CONSERVATIVE_GC
-LOW_TAG_BITS
-NATIVE_GC
-NO_TYPE_LAYOUT
-PARALLEL
-PC_ACCESS
-PC_ACCESS_GREG
 PIC
-PROFILE_CALLS
-PROFILE_MEMORY
-PROFILE_TIME
-SIGACTION_FIELD
 TAG_BITS
-USE_ASM_LABELS
-USE_DLLS
-USE_GCC_GLOBAL_REGISTERS
-USE_GCC_NONLOCAL_GOTOS
-USE_SINGLE_PREC_FLOAT
-HAVE_ASM_SIGCONTEXT
-HAVE_CLOSE
-HAVE_DEV_PTMX
-HAVE_DLCLOSE
-HAVE_DLERROR
-HAVE_DLFCN_H
-HAVE_DLOPEN
-HAVE_DLSYM
-HAVE_DUP
-HAVE_DUP2
-HAVE_EXECLP
-HAVE_FCNTL_H
-HAVE_FDOPEN
-HAVE_FILENO
-HAVE_FORK
-HAVE_FSTAT
-HAVE_GETHOSTNAME
-HAVE_GETPAGESIZE
-HAVE_GRANTPT
-HAVE_IOCTL
-HAVE_ISATTY
-HAVE_KILL
-HAVE_MEMALIGN
-HAVE_MEMMOVE
-HAVE_MPROTECT
-HAVE_GETPID
-HAVE_OPEN
-HAVE_PTSNAME
-HAVE_READLINE_HISTORY
-HAVE_READLINE_READLINE
-HAVE_SETPGID
-HAVE_SETITIMER
-HAVE_SIGACTION
-HAVE_SIGCONTEXT_STRUCT
-HAVE_SIGCONTEXT_STRUCT_2ARG
-HAVE_SIGCONTEXT_STRUCT_3ARG
-HAVE_SIGINFO
-HAVE_SIGINFO_T
-HAVE_SNPRINTF
-HAVE_STAT
-HAVE_STRERROR
-HAVE_SYSCONF
-HAVE_SYS_IOCTL_H
-HAVE_SYS_PARAM
-HAVE_SYS_STAT_H
-HAVE_SYS_SIGINFO
-HAVE_SYS_SIGNAL
-HAVE_SYS_STROPTS_H
-HAVE_SYS_TIME
-HAVE_SYS_TIMES_H
-HAVE_SYS_TYPES_H
-HAVE_SYS_UCONTEXT
-HAVE_SYS_WAIT
-HAVE_TCGETATTR
-HAVE_TCSETATTR
-HAVE_TERMIOS_H
-HAVE_UCONTEXT
-HAVE_UNISTD_H
-HAVE_UNLOCKPT
-HAVE_VSNPRINTF
-HAVE__VSNPRINTF
-HAVE_WAIT
 #-----------------------------------------------------------------------------#
 # These are defined by mercury.h
 # Normally macros should start with capital letters,
Index: runtime/mercury.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury.c,v
retrieving revision 1.35
diff -u -u -r1.35 mercury.c
--- runtime/mercury.c	5 Feb 2002 09:14:54 -0000	1.35
+++ runtime/mercury.c	11 Feb 2002 17:05:19 -0000
@@ -26,7 +26,7 @@
 ** Variable definitions
 */
 
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
   void *mercury__private_builtin__stack_chain;
 #endif
 
Index: runtime/mercury.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury.h,v
retrieving revision 1.49
diff -u -u -r1.49 mercury.h
--- runtime/mercury.h	6 Feb 2002 08:41:46 -0000	1.49
+++ runtime/mercury.h	11 Feb 2002 17:05:19 -0000
@@ -34,9 +34,9 @@
 #include "mercury_memory.h"	/* for memory allocation routines */
 #include "mercury_type_tables.h"	/* for MR_register_type_ctor_info */
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #include "gc.h"
-  #ifdef INLINE_ALLOC
+  #ifdef MR_INLINE_ALLOC
     #include "gc_inl.h"
   #endif
 #else
@@ -294,7 +294,7 @@
 ** Declarations of contants and variables
 */
 
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
   /*
   ** This points to the start of the MR_StackChain frame list.
   ** XXX Using a global variable for this is not thread-safe.
@@ -395,10 +395,10 @@
 **	Allocates memory on the garbage-collected heap.
 */
 
-#ifdef CONSERVATIVE_GC
-  #ifdef INLINE_ALLOC
+#ifdef MR_CONSERVATIVE_GC
+  #ifdef MR_INLINE_ALLOC
     #ifndef __GNUC__
-      #error "INLINE_ALLOC requires GNU C"
+      #error "MR_INLINE_ALLOC requires GNU C"
     #endif
     /*
     ** This must be a macro, not an inline function, because
@@ -423,12 +423,12 @@
         )
     #define MR_new_object(type, size, name) \
   		((type *) MR_GC_MALLOC_INLINE(size))
-  #else /* !INLINE_ALLOC */
+  #else /* !MR_INLINE_ALLOC */
     #define MR_new_object(type, size, name) \
   		((type *) GC_MALLOC(size)) 
-  #endif /* !INLINE_ALLOC */
+  #endif /* !MR_INLINE_ALLOC */
 
-#else /* !CONSERVATIVE_GC */
+#else /* !MR_CONSERVATIVE_GC */
 
   #ifndef __GNUC__
     /*
Index: runtime/mercury_accurate_gc.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_accurate_gc.c,v
retrieving revision 1.14
diff -u -u -r1.14 mercury_accurate_gc.c
--- runtime/mercury_accurate_gc.c	1 Feb 2002 22:06:14 -0000	1.14
+++ runtime/mercury_accurate_gc.c	11 Feb 2002 17:05:19 -0000
@@ -10,7 +10,7 @@
 
 #include "mercury_imp.h"
 
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
 
 #include "mercury_deep_copy.h"
 #include "mercury_layout_util.h"
@@ -845,4 +845,4 @@
 	}
 }
 
-#endif /* NATIVE_GC */
+#endif /* MR_NATIVE_GC */
Index: runtime/mercury_agc_debug.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_agc_debug.c,v
retrieving revision 1.16
diff -u -u -r1.16 mercury_agc_debug.c
--- runtime/mercury_agc_debug.c	28 Jan 2002 05:33:29 -0000	1.16
+++ runtime/mercury_agc_debug.c	11 Feb 2002 17:05:20 -0000
@@ -13,7 +13,7 @@
 #include "mercury_deep_copy.h"
 #include "mercury_agc_debug.h"
 
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
 
 /*
 ** Function prototypes.
@@ -34,7 +34,7 @@
 void
 MR_agc_dump_roots(MR_RootList roots)
 {
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
 	MR_Word	saved_regs[MR_MAX_FAKE_REG];
 
 	fflush(NULL);
@@ -66,7 +66,7 @@
 		roots = roots->next;
 	}
   #endif /* MR_DEBUG_AGC_PRINT_VARS */
-#endif /* NATIVE_GC */
+#endif /* MR_NATIVE_GC */
 }
 
 void
@@ -163,7 +163,7 @@
 MR_agc_dump_stack_frames(MR_Internal *label, MR_MemoryZone *heap_zone,
 	MR_Word *stack_pointer, MR_Word *current_frame)
 {
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
 	MR_Word			saved_regs[MR_MAX_FAKE_REG];
 	int			i, short_var_count, long_var_count;
 	MR_Word			*type_params;
@@ -224,7 +224,7 @@
 			entry_layout = layout->MR_sll_entry;
 		}
 	}
-#endif /* NATIVE_GC */
+#endif /* MR_NATIVE_GC */
 }
 
 static void
@@ -330,7 +330,7 @@
 dump_long_value(MR_Long_Lval locn, MR_MemoryZone *heap_zone,
 	MR_Word *stack_pointer, MR_Word *current_frame, bool do_regs)
 {
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
 	int	locn_num;
 	MR_Word	value = 0;
 	int	difference;
@@ -409,14 +409,14 @@
 			fprintf(stderr, "\t       \t(%lx)", (long) value);
 		}
 	}
-#endif /* NATIVE_GC */
+#endif /* MR_NATIVE_GC */
 }
 
 static void
 dump_short_value(MR_Short_Lval locn, MR_MemoryZone *heap_zone,
 	MR_Word *stack_pointer, MR_Word *current_frame, bool do_regs)
 {
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
 	int	locn_num;
 	MR_Word	value = 0;
 	int	difference;
@@ -483,7 +483,7 @@
 			fprintf(stderr, "\t       \t(%lx)", (long) value);
 		}
 	}
-#endif /* NATIVE_GC */
+#endif /* MR_NATIVE_GC */
 }
 
-#endif /* NATIVE_GC */
+#endif /* MR_NATIVE_GC */
Index: runtime/mercury_conf_bootstrap.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf_bootstrap.h,v
retrieving revision 1.1
diff -u -u -r1.1 mercury_conf_bootstrap.h
--- runtime/mercury_conf_bootstrap.h	11 Feb 2002 12:11:43 -0000	1.1
+++ runtime/mercury_conf_bootstrap.h	11 Feb 2002 15:57:19 -0000
@@ -262,9 +262,6 @@
 #ifdef MR_SYNC_TERM_SIZE
   #define SYNC_TERM_SIZE MR_SYNC_TERM_SIZE
 #endif
-#ifdef MR_BOXED_FLOAT
-  #define BOXED_FLOAT 1
-#endif
 #ifdef MR_HAVE_GCC_LABELS
   #define HAVE_GCC_LABELS 1
 #endif
Index: runtime/mercury_context.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_context.h,v
retrieving revision 1.19
diff -u -u -r1.19 mercury_context.h
--- runtime/mercury_context.h	22 Nov 2001 11:37:12 -0000	1.19
+++ runtime/mercury_context.h	11 Feb 2002 17:05:20 -0000
@@ -265,7 +265,7 @@
 	} while (0)
 #endif /* MR_HIGHLEVEL_CODE */
 
-#ifndef	CONSERVATIVE_GC
+#ifndef	MR_CONSERVATIVE_GC
 
   /*
   ** To figure out the maximum amount of heap we can reclaim on backtracking,
Index: runtime/mercury_debug.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_debug.c,v
retrieving revision 1.8
diff -u -u -r1.8 mercury_debug.c
--- runtime/mercury_debug.c	5 Dec 2001 05:35:32 -0000	1.8
+++ runtime/mercury_debug.c	11 Feb 2002 17:05:20 -0000
@@ -162,7 +162,7 @@
 void 
 MR_incr_hp_debug_msg(MR_Word val, const MR_Word *addr)
 {
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	printf("allocated %ld words at %p\n", (long) val, addr);
 #else
 	printf("increment hp by %ld from ", (long) (MR_Integer) val);
@@ -203,7 +203,7 @@
 
 	for(i=1; i<=8; i++) {
 		x = (MR_Integer) MR_get_reg(i);
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 		if ((MR_Integer) MR_ENGINE(MR_eng_heap_zone)->min <= x
 				&& x < (MR_Integer)
 					MR_ENGINE(MR_eng_heap_zone)->top)
@@ -243,7 +243,7 @@
 void 
 MR_printheap(const MR_Word *h)
 {
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	if (MR_print_raw_addrs) {
 		printf("ptr %p, ", (const void *) h);
 	}
@@ -342,7 +342,7 @@
 		printf("r%d:      ", i + 1);
 		value = (MR_Integer) MR_get_reg(i+1);
 
-#ifndef	CONSERVATIVE_GC
+#ifndef	MR_CONSERVATIVE_GC
 		if ((MR_Integer) MR_ENGINE(MR_eng_heap_zone)->min <= value
 				&& value < (MR_Integer)
 					MR_ENGINE(MR_eng_heap_zone)->top)
@@ -434,7 +434,7 @@
 void 
 MR_print_heapptr(FILE *fp, const MR_Word *s)
 {
-#ifdef	CONSERVATIVE_GC
+#ifdef	MR_CONSERVATIVE_GC
 	fprintf(fp, "heap %ld", (long) s);
 #else
 	fprintf(fp, "heap %3ld",
Index: runtime/mercury_deep_copy.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy.c,v
retrieving revision 1.25
diff -u -u -r1.25 mercury_deep_copy.c
--- runtime/mercury_deep_copy.c	7 Aug 2001 23:12:25 -0000	1.25
+++ runtime/mercury_deep_copy.c	11 Feb 2002 17:05:20 -0000
@@ -58,7 +58,7 @@
 /*
 ** agc_deep_copy(): see mercury_deep_copy.h for documentation.
 */
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
 
 #undef  in_range
 #define in_range(X)	((X) >= lower_limit && (X) <= upper_limit)
@@ -116,7 +116,7 @@
 		(val2) = swap_tmp;	\
 	} while (0)
 
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 
 /*
 ** MR_make_long_lived(): see mercury_deep_copy.h for documentation.
@@ -155,4 +155,4 @@
 	return result;
 }
 
-#endif	/* not CONSERVATIVE_GC */
+#endif	/* not MR_CONSERVATIVE_GC */
Index: runtime/mercury_deep_copy.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy.h,v
retrieving revision 1.12
diff -u -u -r1.12 mercury_deep_copy.h
--- runtime/mercury_deep_copy.h	23 Nov 2000 02:00:25 -0000	1.12
+++ runtime/mercury_deep_copy.h	11 Feb 2002 17:05:20 -0000
@@ -128,7 +128,7 @@
 **	"heap," but don't see how to.
 */
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #define MR_make_long_lived(term, type_info, lower_limit) (term)
 #else
   extern	MR_Word MR_make_long_lived(MR_Word term, MR_TypeInfo type_info,
Index: runtime/mercury_deep_copy_body.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy_body.h,v
retrieving revision 1.44
diff -u -u -r1.44 mercury_deep_copy_body.h
--- runtime/mercury_deep_copy_body.h	30 Jan 2002 05:08:59 -0000	1.44
+++ runtime/mercury_deep_copy_body.h	11 Feb 2002 17:05:20 -0000
@@ -409,7 +409,7 @@
         break;
 
     case MR_TYPECTOR_REP_FLOAT:
-        #ifdef BOXED_FLOAT
+        #ifdef MR_BOXED_FLOAT
             {
                 MR_Word    *data_value;
 
Index: runtime/mercury_engine.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_engine.c,v
retrieving revision 1.37
diff -u -u -r1.37 mercury_engine.c
--- runtime/mercury_engine.c	4 Dec 2001 00:44:33 -0000	1.37
+++ runtime/mercury_engine.c	11 Feb 2002 17:05:21 -0000
@@ -20,7 +20,7 @@
 
 #include	"mercury_dummy.h"
 
-#ifdef USE_GCC_NONLOCAL_GOTOS
+#ifdef MR_USE_GCC_NONLOCAL_GOTOS
 
 #define LOCALS_SIZE	10024	/* amount of space to reserve for local vars */
 #define MAGIC_MARKER	187	/* a random character */
@@ -30,7 +30,7 @@
 
 static	void	call_engine_inner(MR_Code *entry_point) NO_RETURN;
 
-#ifndef USE_GCC_NONLOCAL_GOTOS
+#ifndef MR_USE_GCC_NONLOCAL_GOTOS
   static MR_Code	*engine_done(void);
   static MR_Code	*engine_init_registers(void);
 #endif
@@ -58,7 +58,7 @@
 
 	MR_init_memory();
 
-#if !defined(USE_GCC_NONLOCAL_GOTOS) && !defined(MR_HIGHLEVEL_CODE)
+#if !defined(MR_USE_GCC_NONLOCAL_GOTOS) && !defined(MR_HIGHLEVEL_CODE)
 	{
 		static bool made_engine_done_label = FALSE;
 		if (!made_engine_done_label) {
@@ -74,13 +74,13 @@
 	** stuff.
 	*/
 
-#ifndef	CONSERVATIVE_GC
+#ifndef	MR_CONSERVATIVE_GC
 	eng->MR_eng_heap_zone = MR_create_zone("heap", 1, MR_heap_size,
 			MR_next_offset(), MR_heap_zone_size,
 			MR_default_handler);
 	eng->MR_eng_hp = eng->MR_eng_heap_zone->min;
 
-#ifdef	NATIVE_GC
+#ifdef	MR_NATIVE_GC
 	eng->MR_eng_heap_zone2 = MR_create_zone("heap2", 1, MR_heap_size,
 			MR_next_offset(), MR_heap_zone_size,
 			MR_default_handler);
@@ -341,7 +341,7 @@
 	call_engine_inner(entry_point);
 }
 
-#ifdef USE_GCC_NONLOCAL_GOTOS
+#ifdef MR_USE_GCC_NONLOCAL_GOTOS
 
 /* The gcc-specific version */
 
@@ -533,7 +533,7 @@
 void 
 MR_dump_prev_locations(void) {}
 
-#else /* not USE_GCC_NONLOCAL_GOTOS */
+#else /* not MR_USE_GCC_NONLOCAL_GOTOS */
 
 /*
 ** The portable version
@@ -639,7 +639,7 @@
 		fp = (Func *) (*fp)();
 	}
 } /* end call_engine_inner() */
-#endif /* not USE_GCC_NONLOCAL_GOTOS */
+#endif /* not MR_USE_GCC_NONLOCAL_GOTOS */
 
 /*---------------------------------------------------------------------------*/
 
Index: runtime/mercury_engine.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_engine.h,v
retrieving revision 1.22
diff -u -u -r1.22 mercury_engine.h
--- runtime/mercury_engine.h	31 May 2001 06:00:13 -0000	1.22
+++ runtime/mercury_engine.h	11 Feb 2002 17:05:21 -0000
@@ -180,7 +180,7 @@
 typedef struct MR_mercury_engine_struct {
 	MR_Word		MR_eng_fake_reg[MR_MAX_FAKE_REG];
 		/* The fake reg vector for this engine. */
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	MR_Word		*MR_eng_hp;
 		/* The heap pointer for this engine */
 	MR_Word		*MR_eng_sol_hp;
@@ -223,12 +223,12 @@
 #endif
 	jmp_buf		*MR_eng_jmp_buf;
 	MR_Word		*MR_eng_exception;
-#ifndef	CONSERVATIVE_GC
+#ifndef	MR_CONSERVATIVE_GC
 	MR_MemoryZone	*MR_eng_heap_zone;
 	MR_MemoryZone	*MR_eng_solutions_heap_zone;
 	MR_MemoryZone	*MR_eng_global_heap_zone;
 #endif
-#ifdef	NATIVE_GC
+#ifdef	MR_NATIVE_GC
 	MR_MemoryZone	*MR_eng_heap_zone2;
   #ifdef MR_DEBUG_AGC_PRINT_VARS
 	MR_MemoryZone	*MR_eng_debug_heap_zone;
@@ -277,7 +277,7 @@
 
 #define	MR_CONTEXT(x)		(MR_ENGINE(MR_eng_context).x)
 
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
   #define MR_IF_NOT_CONSERVATIVE_GC(x)	x
 #else
   #define MR_IF_NOT_CONSERVATIVE_GC(x)
Index: runtime/mercury_file.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_file.c,v
retrieving revision 1.3
diff -u -u -r1.3 mercury_file.c
--- runtime/mercury_file.c	30 Jan 2002 12:47:12 -0000	1.3
+++ runtime/mercury_file.c	11 Feb 2002 17:05:21 -0000
@@ -12,7 +12,7 @@
 #include "mercury_file.h"
 #include "mercury_std.h"	/* for MR_assert */
 
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
   static int next_id = 0;
 #endif
 
@@ -22,7 +22,7 @@
   {
 	MR_file(*mf)	    = file;
 	MR_line_number(*mf) = line_number;
-  #ifdef NATIVE_GC
+  #ifdef MR_NATIVE_GC
 	mf->id = ++next_id;
   #endif
   }
@@ -45,7 +45,7 @@
 	mf->getc		= MR_getch;
 	mf->vprintf		= MR_vfprintf;
 	mf->putc		= MR_putch;
-  #ifdef NATIVE_GC
+  #ifdef MR_NATIVE_GC
 	mf->id = ++next_id;
   #endif
   }
Index: runtime/mercury_float.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_float.h,v
retrieving revision 1.12
diff -u -u -r1.12 mercury_float.h
--- runtime/mercury_float.h	22 Nov 2001 11:37:13 -0000	1.12
+++ runtime/mercury_float.h	11 Feb 2002 17:05:21 -0000
@@ -9,23 +9,23 @@
 #ifndef MERCURY_FLOAT_H
 #define MERCURY_FLOAT_H
 
-#include "mercury_conf.h"	/* for BOXED_FLOAT */
+#include "mercury_conf.h"	/* for MR_BOXED_FLOAT */
 #include "mercury_types.h"	/* for `MR_Word' */
 
-#ifdef USE_SINGLE_PREC_FLOAT
+#ifdef MR_USE_SINGLE_PREC_FLOAT
   typedef float MR_Float;
 #else
   typedef double MR_Float;
 #endif
 
-#ifdef BOXED_FLOAT 
+#ifdef MR_BOXED_FLOAT 
 
 #define MR_word_to_float(w) 	(* (MR_Float *) (w))
 
 #define MR_FLOAT_WORDS 		((sizeof(MR_Float) + sizeof(MR_Word) - 1) \
 					/ sizeof(MR_Word))
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #define MR_float_to_word(f) ( \
 		MR_hp_alloc_atomic(MR_FLOAT_WORDS), \
 		* (MR_Float *) (void *) (MR_hp - MR_FLOAT_WORDS) = (f), \
@@ -58,7 +58,7 @@
   #define MR_float_const(f) MR_float_to_word(f)	/* inefficient */
 #endif
 
-#else /* not BOXED_FLOAT */
+#else /* not MR_BOXED_FLOAT */
 
   /* unboxed float means we can assume sizeof(MR_Float) == sizeof(MR_Word) */
 
@@ -86,7 +86,7 @@
 
   #endif /* not __GNUC__ */
 
-#endif /* not BOXED_FLOAT */
+#endif /* not MR_BOXED_FLOAT */
 
 MR_Integer MR_hash_float(MR_Float);
 
Index: runtime/mercury_goto.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_goto.h,v
retrieving revision 1.31
diff -u -u -r1.31 mercury_goto.h
--- runtime/mercury_goto.h	4 Dec 2001 00:44:33 -0000	1.31
+++ runtime/mercury_goto.h	11 Feb 2002 17:05:22 -0000
@@ -102,7 +102,7 @@
   #define MR_make_entry(n, a, l)		/* nothing */
 #endif
 
-#ifdef SPLIT_C_FILES
+#ifdef MR_SPLIT_C_FILES
   #define MR_MODULE_STATIC_OR_EXTERN extern
 #else
   #define MR_MODULE_STATIC_OR_EXTERN static
@@ -459,10 +459,10 @@
 
 /*---------------------------------------------------------------------------*/
 
-#if defined(USE_GCC_NONLOCAL_GOTOS)
+#if defined(MR_USE_GCC_NONLOCAL_GOTOS)
 
   #ifndef __GNUC__
-  #error "You must use gcc if you define USE_GCC_NONLOCAL_GOTOS"
+  #error "You must use gcc if you define MR_USE_GCC_NONLOCAL_GOTOS"
   #endif
 
   /* Define the type of a module initialization function */
@@ -541,7 +541,7 @@
   #define MR_END_MODULE } }
 
 
-  #if defined(USE_ASM_LABELS)
+  #if defined(MR_USE_ASM_LABELS)
     #define MR_declare_entry(label)		\
 	extern void label(void) __asm__("_entry_" MR_STRINGIFY(label))
     #define MR_declare_static(label)		\
@@ -585,7 +585,7 @@
     #endif
 
   #else
-    /* !defined(USE_ASM_LABELS) */
+    /* !defined(MR_USE_ASM_LABELS) */
 
     #define MR_declare_entry(label)	extern MR_Code * MR_entry(label)
     #define MR_declare_static(label)	static MR_Code * MR_entry(label)
@@ -619,7 +619,7 @@
     #define MR_JUMP(label)		goto *(label)
     #endif
 
-  #endif /* !defined(USE_ASM_LABELS) */
+  #endif /* !defined(MR_USE_ASM_LABELS) */
 
   #define MR_declare_local(label)	/* no declaration required */
   #define MR_define_local(label)	\
@@ -666,7 +666,7 @@
   */
 
 #else
-  /* !defined(USE_GCC_NONLOCAL_GOTOS) */
+  /* !defined(MR_USE_GCC_NONLOCAL_GOTOS) */
 
   /* Define the type of a module initialization function */
   typedef MR_Code * MR_ModuleFunc(void);
@@ -739,7 +739,7 @@
   #define MR_GOTO_LOCAL(label) 	MR_GOTO(MR_LOCAL(label))
   #define MR_GOTO_LABEL(label) 	MR_GOTO(MR_LABEL(label))
 
-#endif /* !defined(USE_GCC_NONLOCAL_GOTOS) */
+#endif /* !defined(MR_USE_GCC_NONLOCAL_GOTOS) */
 
 /* definitions for computed gotos */
 
Index: runtime/mercury_grade.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_grade.h,v
retrieving revision 1.33
diff -u -u -r1.33 mercury_grade.h
--- runtime/mercury_grade.h	28 Jan 2002 07:00:53 -0000	1.33
+++ runtime/mercury_grade.h	11 Feb 2002 17:05:22 -0000
@@ -70,20 +70,20 @@
 
 #else /* ! MR_HIGHLEVEL_CODE */
 
-  #ifdef USE_ASM_LABELS
+  #ifdef MR_USE_ASM_LABELS
     #define MR_GRADE_PART_1	MR_PASTE2(MR_GRADE_PART_0, asm_)
   #else
     #define MR_GRADE_PART_1	MR_GRADE_PART_0
   #endif
 
-  #ifdef USE_GCC_NONLOCAL_GOTOS
-    #ifdef USE_GCC_GLOBAL_REGISTERS
+  #ifdef MR_USE_GCC_NONLOCAL_GOTOS
+    #ifdef MR_USE_GCC_GLOBAL_REGISTERS
       #define MR_GRADE_PART_2	MR_PASTE2(MR_GRADE_PART_1, fast)
     #else
       #define MR_GRADE_PART_2	MR_PASTE2(MR_GRADE_PART_1, jump)
     #endif
   #else
-    #ifdef USE_GCC_GLOBAL_REGISTERS
+    #ifdef MR_USE_GCC_GLOBAL_REGISTERS
       #define MR_GRADE_PART_2	MR_PASTE2(MR_GRADE_PART_1, reg)
     #else
       #define MR_GRADE_PART_2	MR_PASTE2(MR_GRADE_PART_1, none)
@@ -98,9 +98,9 @@
   #define MR_GRADE_PART_3	MR_GRADE_PART_2
 #endif
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #define MR_GRADE_PART_4	MR_PASTE2(MR_GRADE_PART_3, _gc)
-#elif defined(NATIVE_GC)
+#elif defined(MR_NATIVE_GC)
   #define MR_GRADE_PART_4	MR_PASTE2(MR_GRADE_PART_3, _agc)
 #else
   #define MR_GRADE_PART_4	MR_GRADE_PART_3
@@ -184,7 +184,7 @@
   					MR_PASTE2(_tags, TAGBITS))
 #endif
 
-#ifdef BOXED_FLOAT
+#ifdef MR_BOXED_FLOAT
   #define MR_GRADE_PART_9	MR_GRADE_PART_8
 #else				/* "ubf" stands for "unboxed float" */
   #define MR_GRADE_PART_9	MR_PASTE2(MR_GRADE_PART_8, _ubf)
@@ -198,7 +198,7 @@
 
 #if defined(MR_USE_REGPARM) && defined(MR_HIGHLEVEL_CODE) && defined(__i386__)
   #define MR_GRADE_PART_11	MR_PASTE2(MR_GRADE_PART_10, _regparm)
-#elif defined(PIC_REG) && defined(USE_GCC_GLOBAL_REGISTERS) && defined(__i386__)
+#elif defined(MR_PIC_REG) && defined(MR_USE_GCC_GLOBAL_REGISTERS) && defined(__i386__)
   #define MR_GRADE_PART_11	MR_PASTE2(MR_GRADE_PART_10, _picreg)
 #else
   #define MR_GRADE_PART_11	MR_GRADE_PART_10
@@ -252,20 +252,20 @@
 
 #else /* ! MR_HIGHLEVEL_CODE */
 
-  #ifdef USE_ASM_LABELS
+  #ifdef MR_USE_ASM_LABELS
     #define MR_GRADE_OPT_PART_1		"asm_"
   #else
     #define MR_GRADE_OPT_PART_1		""
   #endif
 
-  #ifdef USE_GCC_NONLOCAL_GOTOS
-    #ifdef USE_GCC_GLOBAL_REGISTERS
+  #ifdef MR_USE_GCC_NONLOCAL_GOTOS
+    #ifdef MR_USE_GCC_GLOBAL_REGISTERS
       #define MR_GRADE_OPT_PART_2	MR_GRADE_OPT_PART_1 "fast"
     #else
       #define MR_GRADE_OPT_PART_2	MR_GRADE_OPT_PART_1 "jump"
     #endif
   #else
-    #ifdef USE_GCC_GLOBAL_REGISTERS
+    #ifdef MR_USE_GCC_GLOBAL_REGISTERS
       #define MR_GRADE_OPT_PART_2	MR_GRADE_OPT_PART_1 "reg"
     #else
       #define MR_GRADE_OPT_PART_2	MR_GRADE_OPT_PART_1 "none"
@@ -279,9 +279,9 @@
 #else
   #define MR_GRADE_OPT_PART_3	MR_GRADE_OPT_PART_2
 #endif
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #define MR_GRADE_OPT_PART_4	MR_GRADE_OPT_PART_3 ".gc"
-#elif defined(NATIVE_GC)
+#elif defined(MR_NATIVE_GC)
   #define MR_GRADE_OPT_PART_4	MR_GRADE_OPT_PART_3 ".agc"
 #else
   #define MR_GRADE_OPT_PART_4	MR_GRADE_OPT_PART_3
@@ -352,7 +352,7 @@
 
 #if defined(MR_USE_REGPARM) && defined(MR_HIGHLEVEL_CODE) && defined(__i386__)
   #define MR_GRADE_OPT_PART_11	MR_GRADE_OPT_PART_7 ".regparm"
-#elif defined(PIC_REG) && defined(USE_GCC_GLOBAL_REGISTERS) && defined(__i386__)
+#elif defined(MR_PIC_REG) && defined(MR_USE_GCC_GLOBAL_REGISTERS) && defined(__i386__)
   #define MR_GRADE_OPT_PART_11	MR_GRADE_OPT_PART_7 ".picreg"
 #else
   #define MR_GRADE_OPT_PART_11	MR_GRADE_OPT_PART_7
Index: runtime/mercury_heap.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_heap.h,v
retrieving revision 1.22
diff -u -u -r1.22 mercury_heap.h
--- runtime/mercury_heap.h	31 May 2001 06:00:14 -0000	1.22
+++ runtime/mercury_heap.h	11 Feb 2002 17:05:22 -0000
@@ -18,7 +18,7 @@
   #include "mercury.h"			/* for MR_new_object() */
 #endif
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 
   #include "gc.h"
 
@@ -29,7 +29,7 @@
 	((dest) = (MR_Word) MR_mkword((tag),				\
 			(MR_Word) GC_MALLOC_ATOMIC((count) * sizeof(MR_Word))))
 
-  #ifdef INLINE_ALLOC
+  #ifdef MR_INLINE_ALLOC
 
     /*
     ** The following stuff uses the macros in the `gc_inl.h' header file in the
@@ -54,9 +54,9 @@
     #ifndef __GNUC__
       /*
       ** Without the gcc extensions __builtin_constant_p() and ({...}),
-      ** INLINE_ALLOC would probably be a performance _loss_.
+      ** MR_INLINE_ALLOC would probably be a performance _loss_.
       */
-      #error "INLINE_ALLOC requires the use of GCC"
+      #error "MR_INLINE_ALLOC requires the use of GCC"
     #endif
 
     #include "gc_inl.h"
@@ -72,12 +72,12 @@
 	: MR_tag_incr_hp_n((dest), (tag), (count))			\
 	)
 
-  #else /* not INLINE_ALLOC */
+  #else /* not MR_INLINE_ALLOC */
 
     #define MR_tag_incr_hp(dest, tag, count) \
 	MR_tag_incr_hp_n((dest), (tag), (count))
 
-  #endif /* not INLINE_ALLOC */
+  #endif /* not MR_INLINE_ALLOC */
 
   #define MR_mark_hp(dest)		((void)0)
   #define MR_restore_hp(src)		((void)0)
@@ -96,7 +96,7 @@
 
   #define MR_free_heap(ptr)	GC_FREE((ptr))
 
-#else /* not CONSERVATIVE_GC */
+#else /* not MR_CONSERVATIVE_GC */
 
   #define MR_tag_incr_hp(dest, tag, count) 				\
 		(							\
@@ -140,7 +140,7 @@
 
   #define MR_free_heap(ptr)		((void) 0)
   
-#endif /* not CONSERVATIVE_GC */
+#endif /* not MR_CONSERVATIVE_GC */
   
 #if	defined (MR_DEEP_PROFILING) && defined(MR_DEEP_PROFILING_MEMORY)
   #define MR_maybe_record_allocation(count, proclabel, type)		\
Index: runtime/mercury_imp.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_imp.h,v
retrieving revision 1.18
diff -u -u -r1.18 mercury_imp.h
--- runtime/mercury_imp.h	11 Oct 2000 03:00:18 -0000	1.18
+++ runtime/mercury_imp.h	11 Feb 2002 17:05:22 -0000
@@ -20,8 +20,8 @@
 #define MERCURY_IMP_H
 
 /*
-** The #include of "mercury_conf.h" must come before the `#ifdef USE_DLLS',
-** because mercury_conf.h defines the USE_DLLS macro.
+** The #include of "mercury_conf.h" must come before the `#ifdef MR_USE_DLLS',
+** because mercury_conf.h defines the MR_USE_DLLS macro.
 */
 
 #include	"mercury_conf.h"
@@ -32,7 +32,7 @@
 ** Note: `libmer_dll.h' is automatically generated by `Makefile.DLLs'.
 */
 
-#ifdef USE_DLLS
+#ifdef MR_USE_DLLS
   #include "libmer_dll.h"
 #endif
 
Index: runtime/mercury_init.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_init.h,v
retrieving revision 1.31
diff -u -u -r1.31 mercury_init.h
--- runtime/mercury_init.h	30 Jan 2002 05:09:00 -0000	1.31
+++ runtime/mercury_init.h	11 Feb 2002 17:05:22 -0000
@@ -20,8 +20,8 @@
 ** The following must come before any definitions of global variables.
 ** This is necessary to support DLLs on Windows.
 */
-#include "mercury_conf.h" /* for USE_DLLS */
-#if USE_DLLS
+#include "mercury_conf.h" /* for MR_USE_DLLS */
+#if MR_USE_DLLS
   #include "libmer_rt_dll.h"
 #endif
 
@@ -87,7 +87,7 @@
 #include "mercury_trace_base.h"	/* for MR_trace_port */
 #include "mercury_type_info.h"	/* for MR_TypeCtorInfo_Struct */
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #include "gc.h"
 #endif
 
Index: runtime/mercury_library_types.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_library_types.h,v
retrieving revision 1.6
diff -u -u -r1.6 mercury_library_types.h
--- runtime/mercury_library_types.h	30 Jan 2002 12:47:12 -0000	1.6
+++ runtime/mercury_library_types.h	11 Feb 2002 17:05:22 -0000
@@ -27,7 +27,7 @@
   typedef struct mercury_file {
 	FILE *file1;
 	int line_number1;
-  #ifdef NATIVE_GC
+  #ifdef MR_NATIVE_GC
 	int id;
   #endif
   } MercuryFile;
@@ -104,7 +104,7 @@
 	MR_StreamType	stream_type;
 	MR_StreamInfo	stream_info;
 	int		line_number;
-  #ifdef NATIVE_GC
+  #ifdef MR_NATIVE_GC
 	int id;
   #endif
 
Index: runtime/mercury_memory.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_memory.c,v
retrieving revision 1.27
diff -u -u -r1.27 mercury_memory.c
--- runtime/mercury_memory.c	6 Feb 2002 08:41:46 -0000	1.27
+++ runtime/mercury_memory.c	11 Feb 2002 17:05:23 -0000
@@ -42,26 +42,26 @@
 */
 #include "mercury_signal.h"
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>
 #endif
 
 #include <stdio.h>
 #include <string.h>
 
-#ifdef HAVE_SYS_SIGINFO
+#ifdef MR_HAVE_SYS_SIGINFO_H
   #include <sys/siginfo.h>
 #endif 
 
-#ifdef	HAVE_MPROTECT
+#ifdef	MR_HAVE_MPROTECT
   #include <sys/mman.h>
 #endif
 
-#ifdef	HAVE_UCONTEXT
+#ifdef	MR_HAVE_UCONTEXT_H
   #include <ucontext.h>
 #endif
 
-#ifdef	HAVE_SYS_UCONTEXT
+#ifdef	MR_HAVE_SYS_UCONTEXT_H
   #include <sys/ucontext.h>
 #endif
 
@@ -71,9 +71,9 @@
 
 /*---------------------------------------------------------------------------*/
 
-#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE)
+#if defined(MR_HAVE_SYSCONF) && defined(_SC_PAGESIZE)
   #define	getpagesize()	sysconf(_SC_PAGESIZE)
-#elif !defined(HAVE_GETPAGESIZE)
+#elif !defined(MR_HAVE_GETPAGESIZE)
   #if defined(MR_WIN32_GETSYSTEMINFO)
     #include <windows.h>
 
@@ -91,10 +91,10 @@
 
 /*---------------------------------------------------------------------------*/
 
-#ifdef	HAVE_SIGINFO
+#ifdef	MR_HAVE_SIGINFO
   static	bool	try_munprotect(void *address, void *context);
   static	char	*explain_context(void *context);
-#endif /* HAVE_SIGINFO */
+#endif /* MR_HAVE_SIGINFO */
 
 /*
 ** Define the memory zones used by the Mercury runtime.
@@ -128,7 +128,7 @@
 	MR_page_size = getpagesize();
 	MR_unit = max(MR_page_size, MR_pcache_size);
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	MR_heap_size		 = 0;
 	MR_heap_zone_size	 = 0;
 	MR_solutions_heap_size	 = 0;
@@ -194,7 +194,7 @@
 	** set them to a single unit.
 	*/
 
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
 	if (MR_heap_zone_size >= MR_heap_size) {
 		MR_heap_zone_size = MR_unit;
 	}
@@ -281,7 +281,7 @@
 ** These routines allocate memory that will be scanned by the
 ** conservative garbage collector.
 **
-** XXX This is inefficient.  If CONSERVATIVE_GC is enabled,
+** XXX This is inefficient.  If MR_CONSERVATIVE_GC is enabled,
 ** we should set `GC_oom_fn' (see boehm_gc/gc.h) rather than
 ** testing the return value from GC_MALLOC() or GC_MALLOC_UNCOLLECTABLE().
 */
@@ -291,7 +291,7 @@
 {
 	void	*ptr;
 
-#ifdef	CONSERVATIVE_GC
+#ifdef	MR_CONSERVATIVE_GC
 	ptr = GC_MALLOC(num_bytes);
 #else
 	ptr = malloc(num_bytes);
@@ -309,7 +309,7 @@
 {
 	void	*ptr;
 
-#ifdef	CONSERVATIVE_GC
+#ifdef	MR_CONSERVATIVE_GC
 	ptr = GC_MALLOC_UNCOLLECTABLE(num_bytes);
 #else
 	ptr = malloc(num_bytes);
@@ -327,7 +327,7 @@
 {
 	void    *ptr;
 
-#ifdef	CONSERVATIVE_GC
+#ifdef	MR_CONSERVATIVE_GC
 	ptr = GC_REALLOC(old_ptr, num_bytes);
 #else
 	ptr = realloc(old_ptr, num_bytes);
Index: runtime/mercury_memory.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_memory.h,v
retrieving revision 1.14
diff -u -u -r1.14 mercury_memory.h
--- runtime/mercury_memory.h	23 Nov 2000 02:00:34 -0000	1.14
+++ runtime/mercury_memory.h	11 Feb 2002 17:05:24 -0000
@@ -24,8 +24,8 @@
 
 #include "mercury_types.h"	/* for MR_Word */
 #include "mercury_std.h"	/* for bool */
-#include "mercury_conf.h"	/* for CONSERVATIVE_GC, etc. */
-#ifdef CONSERVATIVE_GC
+#include "mercury_conf.h"	/* for MR_CONSERVATIVE_GC, etc. */
+#ifdef MR_CONSERVATIVE_GC
   #include "gc.h"		/* for GC_FREE */
 #endif
 
@@ -44,7 +44,7 @@
 extern	void	MR_init_memory(void);
 extern	void	MR_init_heap(void);
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   extern void	MR_init_conservative_GC(void);
 #endif
 
@@ -148,7 +148,7 @@
 #define MR_GC_RESIZE_ARRAY(ptr, type, num) \
 	((type *) MR_GC_realloc((ptr), (num) * sizeof(type)))
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #define MR_GC_free(ptr) GC_FREE(ptr)
 #else
   #define MR_GC_free(ptr) free(ptr)
@@ -180,7 +180,7 @@
 ** contains pointers to the Mercury heap.  This information is only
 ** used for agc grades.
 */
-#ifdef NATIVE_GC
+#ifdef MR_NATIVE_GC
   #define MR_add_root(root_ptr, type_info) \
 	MR_agc_add_root((root_ptr), (type_info))
 #else
Index: runtime/mercury_memory_handlers.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_memory_handlers.c,v
retrieving revision 1.24
diff -u -u -r1.24 mercury_memory_handlers.c
--- runtime/mercury_memory_handlers.c	1 Feb 2002 08:43:20 -0000	1.24
+++ runtime/mercury_memory_handlers.c	11 Feb 2002 17:05:24 -0000
@@ -15,7 +15,7 @@
 
 #include "mercury_imp.h"
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>
 #endif
 
@@ -28,24 +28,24 @@
 */
 #include "mercury_signal.h"
 
-#ifdef HAVE_SYS_SIGINFO
+#ifdef MR_HAVE_SYS_SIGINFO_H
   #include <sys/siginfo.h>
 #endif 
 
-#ifdef HAVE_SYS_SIGNAL
+#ifdef MR_HAVE_SYS_SIGNAL_H
   /* on FREEBSD we need to include <sys/signal.h> before <ucontext.h> */
   #include <sys/signal.h>
 #endif
 
-#ifdef	HAVE_MPROTECT
+#ifdef	MR_HAVE_MPROTECT
   #include <sys/mman.h>
 #endif
 
-#ifdef	HAVE_UCONTEXT
+#ifdef	MR_HAVE_UCONTEXT_H
   #include <ucontext.h>
 #endif
 
-#ifdef	HAVE_SYS_UCONTEXT
+#ifdef	MR_HAVE_SYS_UCONTEXT_H
   #include <sys/ucontext.h>
 #endif
 
@@ -56,39 +56,39 @@
 
 /*---------------------------------------------------------------------------*/
 
-#ifdef HAVE_SIGINFO
-  #if defined(HAVE_SIGCONTEXT_STRUCT)
-    #if defined(HAVE_SIGCONTEXT_STRUCT_3ARG)
+#ifdef MR_HAVE_SIGINFO
+  #if defined(MR_HAVE_SIGCONTEXT_STRUCT)
+    #if defined(MR_HAVE_SIGCONTEXT_STRUCT_3ARG)
       static	void	complex_sighandler_3arg(int, int, 
 			      struct sigcontext_struct);
     #else
       static	void	complex_sighandler(int, struct sigcontext_struct);
     #endif
-  #elif defined(HAVE_SIGINFO_T)
+  #elif defined(MR_HAVE_SIGINFO_T)
     static	void	complex_bushandler(int, siginfo_t *, void *);
     static	void	complex_segvhandler(int, siginfo_t *, void *);
   #else
-    #error "HAVE_SIGINFO defined but don't know how to get it"
+    #error "MR_HAVE_SIGINFO defined but don't know how to get it"
   #endif
 #else
   static	void	simple_sighandler(int);
 #endif
 
 
-#ifdef HAVE_SIGINFO
-  #if defined(HAVE_SIGCONTEXT_STRUCT)
-    #if defined(HAVE_SIGCONTEXT_STRUCT_3ARG)
+#ifdef MR_HAVE_SIGINFO
+  #if defined(MR_HAVE_SIGCONTEXT_STRUCT)
+    #if defined(MR_HAVE_SIGCONTEXT_STRUCT_3ARG)
       #define     bus_handler	complex_sighandler_3arg
       #define     segv_handler	complex_sighandler_3arg
     #else
       #define     bus_handler	complex_sighandler
       #define     segv_handler	complex_sighandler
     #endif
-  #elif defined(HAVE_SIGINFO_T)
+  #elif defined(MR_HAVE_SIGINFO_T)
     #define     bus_handler	complex_bushandler
     #define     segv_handler	complex_segvhandler
   #else
-    #error "HAVE_SIGINFO defined but don't know how to get it"
+    #error "MR_HAVE_SIGINFO defined but don't know how to get it"
   #endif
 #else
     #define     bus_handler	simple_sighandler
@@ -113,7 +113,7 @@
 static bool 
 try_munprotect(void *addr, void *context)
 {
-#if !(defined(HAVE_SIGINFO) || defined(MR_WIN32_VIRTUAL_ALLOC))
+#if !(defined(MR_HAVE_SIGINFO) || defined(MR_WIN32_VIRTUAL_ALLOC))
 	return FALSE;
 #else
 	MR_Word *    fault_addr;
@@ -151,7 +151,7 @@
 	}
 
 	return FALSE;
-#endif /* HAVE_SIGINFO */
+#endif /* MR_HAVE_SIGINFO */
 } 
 
 bool 
@@ -220,7 +220,7 @@
 		zone->name, zone->id, (void *) zone->redzone,
 		(void *) zone->top);
 	}
-  #if defined(NATIVE_GC) && !defined(MR_HIGHLEVEL_CODE)
+  #if defined(MR_NATIVE_GC) && !defined(MR_HIGHLEVEL_CODE)
 	MR_schedule_agc(get_pc_from_context(context),
 		get_sp_from_context(context),
 		get_curfr_from_context(context));
@@ -265,11 +265,11 @@
 {
 	static	char	buf[100];
 
-#if defined(HAVE_SIGCONTEXT_STRUCT)
+#if defined(MR_HAVE_SIGCONTEXT_STRUCT)
 
-  #ifdef PC_ACCESS
+  #ifdef MR_PC_ACCESS
 	struct sigcontext_struct *context = the_context;
-	void *pc_at_signal = (void *) context->PC_ACCESS;
+	void *pc_at_signal = (void *) context->MR_PC_ACCESS;
 
 	sprintf(buf, "PC at signal: %ld (%lx)\n",
 		(long)pc_at_signal, (long)pc_at_signal);
@@ -277,31 +277,31 @@
 	buf[0] = '\0';
   #endif
 
-#elif defined(HAVE_SIGINFO_T)
+#elif defined(MR_HAVE_SIGINFO_T)
 
-  #ifdef PC_ACCESS
+  #ifdef MR_PC_ACCESS
 
 	ucontext_t *context = the_context;
 
-    #ifdef PC_ACCESS_GREG
+    #ifdef MR_PC_ACCESS_GREG
 	sprintf(buf, "PC at signal: %ld (%lx)\n",
-		(long) context->uc_mcontext.gregs[PC_ACCESS],
-		(long) context->uc_mcontext.gregs[PC_ACCESS]);
+		(long) context->uc_mcontext.gregs[MR_PC_ACCESS],
+		(long) context->uc_mcontext.gregs[MR_PC_ACCESS]);
     #else
 	sprintf(buf, "PC at signal: %ld (%lx)\n",
-		(long) context->uc_mcontext.PC_ACCESS,
-		(long) context->uc_mcontext.PC_ACCESS);
+		(long) context->uc_mcontext.MR_PC_ACCESS,
+		(long) context->uc_mcontext.MR_PC_ACCESS);
     #endif
 
-  #else /* not PC_ACCESS */
+  #else /* not MR_PC_ACCESS */
 
-	/* if PC_ACCESS is not set, we don't know the context */
+	/* if MR_PC_ACCESS is not set, we don't know the context */
 	/* therefore we return an empty string to be printed  */
 	buf[0] = '\0';
 
-  #endif /* not PC_ACCESS */
+  #endif /* not MR_PC_ACCESS */
 
-#else /* not HAVE_SIGINFO_T && not HAVE_SIGCONTEXT_STRUCT */
+#else /* not MR_HAVE_SIGINFO_T && not MR_HAVE_SIGCONTEXT_STRUCT */
 
 	buf[0] = '\0';
 
@@ -310,8 +310,8 @@
 	return buf;
 }
 
-#if defined(HAVE_SIGCONTEXT_STRUCT)
-  #if defined(HAVE_SIGCONTEXT_STRUCT_3ARG)
+#if defined(MR_HAVE_SIGCONTEXT_STRUCT)
+  #if defined(MR_HAVE_SIGCONTEXT_STRUCT_3ARG)
     static void
     complex_sighandler_3arg(int sig, int code,
 		    struct sigcontext_struct sigcontext)
@@ -321,8 +321,8 @@
   #endif
 {
 	void *address = (void *) MR_GET_FAULT_ADDR(sigcontext);
-  #ifdef PC_ACCESS
-	void *pc_at_signal = (void *) sigcontext.PC_ACCESS;
+  #ifdef MR_PC_ACCESS
+	void *pc_at_signal = (void *) sigcontext.MR_PC_ACCESS;
   #endif
 
 	switch(sig) {
@@ -367,7 +367,7 @@
 			break;
 	}
 
-  #ifdef PC_ACCESS
+  #ifdef MR_PC_ACCESS
 	fprintf(stderr, "PC at signal: %ld (%lx)\n",
 		(long) pc_at_signal, (long) pc_at_signal);
   #endif
@@ -381,7 +381,7 @@
 } /* end complex_sighandler() */
 
 
-#elif defined(HAVE_SIGINFO_T)
+#elif defined(MR_HAVE_SIGINFO_T)
 
 static void 
 complex_bushandler(int sig, siginfo_t *info, void *context)
@@ -539,7 +539,7 @@
 	exit(1);
 } /* end complex_segvhandler */
 
-#else /* not HAVE_SIGINFO_T && not HAVE_SIGCONTEXT_STRUCT */
+#else /* not MR_HAVE_SIGINFO_T && not MR_HAVE_SIGCONTEXT_STRUCT */
 
 static void 
 simple_sighandler(int sig)
@@ -570,7 +570,7 @@
 	exit(1);
 }
 
-#endif /* not HAVE_SIGINFO_T && not HAVE_SIGCONTEXT_STRUCT */
+#endif /* not MR_HAVE_SIGINFO_T && not MR_HAVE_SIGCONTEXT_STRUCT */
 
 #ifdef MR_MSVC_STRUCTURED_EXCEPTIONS
 static const char *MR_find_exception_name(DWORD exception_code);
@@ -857,36 +857,36 @@
 get_pc_from_context(void *the_context)
 {
 	MR_Code *pc_at_signal = NULL;
-#if defined(HAVE_SIGCONTEXT_STRUCT)
+#if defined(MR_HAVE_SIGCONTEXT_STRUCT)
 
-  #ifdef PC_ACCESS
+  #ifdef MR_PC_ACCESS
 	struct sigcontext_struct *context = the_context;
 
-	pc_at_signal = (MR_Code *) context->PC_ACCESS;
+	pc_at_signal = (MR_Code *) context->MR_PC_ACCESS;
   #else
 	pc_at_signal = (MR_Code *) NULL;
   #endif
 
-#elif defined(HAVE_SIGINFO_T)
+#elif defined(MR_HAVE_SIGINFO_T)
 
-  #ifdef PC_ACCESS
+  #ifdef MR_PC_ACCESS
 
 	ucontext_t *context = the_context;
 
-    #ifdef PC_ACCESS_GREG
-	pc_at_signal = (MR_Code *) context->uc_mcontext.gregs[PC_ACCESS];
+    #ifdef MR_PC_ACCESS_GREG
+	pc_at_signal = (MR_Code *) context->uc_mcontext.gregs[MR_PC_ACCESS];
     #else
-	pc_at_signal = (MR_Code *) context->uc_mcontext.PC_ACCESS;
+	pc_at_signal = (MR_Code *) context->uc_mcontext.MR_PC_ACCESS;
     #endif
 
-  #else /* not PC_ACCESS */
+  #else /* not MR_PC_ACCESS */
 
-	/* if PC_ACCESS is not set, we don't know the context */
+	/* if MR_PC_ACCESS is not set, we don't know the context */
 	pc_at_signal = (MR_Code *) NULL;
 
-  #endif /* not PC_ACCESS */
+  #endif /* not MR_PC_ACCESS */
 
-#else /* not HAVE_SIGINFO_T && not HAVE_SIGCONTEXT_STRUCT */
+#else /* not MR_HAVE_SIGINFO_T && not MR_HAVE_SIGCONTEXT_STRUCT */
 
 	pc_at_signal = (MR_Code *) NULL;
 
@@ -911,10 +911,10 @@
 get_sp_from_context(void *the_context)
 {
 	MR_Word *sp_at_signal = NULL;
-#if defined(NATIVE_GC) && !defined(MR_HIGHLEVEL_CODE)
-  #if defined(HAVE_SIGCONTEXT_STRUCT)
+#if defined(MR_NATIVE_GC) && !defined(MR_HIGHLEVEL_CODE)
+  #if defined(MR_HAVE_SIGCONTEXT_STRUCT)
 
-    #ifdef PC_ACCESS
+    #ifdef MR_PC_ACCESS
 	struct sigcontext_struct *context = the_context;
 
 	sp_at_signal = (MR_Word *) context->MR_real_reg_number_sp;
@@ -922,36 +922,36 @@
 	sp_at_signal = (MR_Word *) NULL;
     #endif
 
-  #elif defined(HAVE_SIGINFO_T)
+  #elif defined(MR_HAVE_SIGINFO_T)
 
-    #ifdef PC_ACCESS
+    #ifdef MR_PC_ACCESS
 
 	struct sigcontext *context = the_context;
 
-      #ifdef PC_ACCESS_GREG
+      #ifdef MR_PC_ACCESS_GREG
 	sp_at_signal = (MR_Word *) context->gregs[MR_real_reg_number_sp];
       #else
 	sp_at_signal = (MR_Word *) context->sc_regs[MR_real_reg_number_sp];
       #endif
 
-    #else /* not PC_ACCESS */
+    #else /* not MR_PC_ACCESS */
 
 	/* 
-	** if PC_ACCESS is not set, we don't know how to get at the
+	** if MR_PC_ACCESS is not set, we don't know how to get at the
 	** registers
 	*/
 	sp_at_signal = (MR_Word *) NULL;
 
-    #endif /* not PC_ACCESS */
+    #endif /* not MR_PC_ACCESS */
 
-  #else /* not HAVE_SIGINFO_T && not HAVE_SIGCONTEXT_STRUCT */
+  #else /* not MR_HAVE_SIGINFO_T && not MR_HAVE_SIGCONTEXT_STRUCT */
 
 	sp_at_signal = (MR_Word *) NULL;
 
   #endif
-#else /* !NATIVE_GC */
+#else /* !MR_NATIVE_GC */
 	sp_at_signal = (MR_Word *) NULL;
-#endif /* !NATIVE_GC */
+#endif /* !MR_NATIVE_GC */
 
 	return sp_at_signal;
 }
Index: runtime/mercury_memory_zones.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_memory_zones.c,v
retrieving revision 1.17
diff -u -u -r1.17 mercury_memory_zones.c
--- runtime/mercury_memory_zones.c	6 Feb 2002 08:41:47 -0000	1.17
+++ runtime/mercury_memory_zones.c	11 Feb 2002 17:05:24 -0000
@@ -24,31 +24,31 @@
 
 #include "mercury_imp.h"
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>
 #endif
 
 #include <stdio.h>
 #include <string.h>
 
-#ifdef HAVE_SYS_SIGINFO
+#ifdef MR_HAVE_SYS_SIGINFO_H
   #include <sys/siginfo.h>
 #endif 
 
-#ifdef HAVE_SYS_SIGNAL
+#ifdef MR_HAVE_SYS_SIGNAL_H
   /* on FREEBSD we need to include <sys/signal.h> before <ucontext.h> */
   #include <sys/signal.h>
 #endif
 
-#ifdef	HAVE_MPROTECT
+#ifdef	MR_HAVE_MPROTECT
   #include <sys/mman.h>
 #endif
 
-#ifdef	HAVE_UCONTEXT
+#ifdef	MR_HAVE_UCONTEXT_H
   #include <ucontext.h>
 #endif
 
-#ifdef	HAVE_SYS_UCONTEXT
+#ifdef	MR_HAVE_SYS_UCONTEXT_H
   #include <sys/ucontext.h>
 #endif
 
@@ -64,9 +64,9 @@
 
 /*
 ** MR_PROTECTPAGE is now defined if we have some sort of mprotect like
-** functionality, all checks for HAVE_MPROTECT should now use MR_PROTECTPAGE.
+** functionality, all checks for MR_HAVE_MPROTECT should now use MR_PROTECTPAGE.
 */
-#if defined(HAVE_MPROTECT)
+#if defined(MR_HAVE_MPROTECT)
 int
 MR_protect_pages(void *addr, size_t size, int prot_flags)
 {
@@ -129,15 +129,15 @@
 				(unsigned long) GetLastError());
 	}
 
-  #ifdef CONSERVATIVE_GC
+  #ifdef MR_CONSERVATIVE_GC
 	if (ptr != NULL)
 		GC_add_roots((char *)ptr, (char *)ptr + size);
   #endif
 	return ptr;
 }
-#elif defined(CONSERVATIVE_GC)
+#elif defined(MR_CONSERVATIVE_GC)
   #define	memalign(a,s)   GC_MALLOC_UNCOLLECTABLE(s)
-#elif defined(HAVE_MEMALIGN)
+#elif defined(MR_HAVE_MEMALIGN)
   extern void	*memalign(size_t, size_t);
 #else
   #define	memalign(a,s)	malloc(s)
@@ -158,7 +158,7 @@
 */
 #ifdef MR_PROTECTPAGE
 
-  #ifdef CONSERVATIVE_GC
+  #ifdef MR_CONSERVATIVE_GC
     /*
     ** The conservative garbage collectors scans through
     ** all these areas, so we need to allow reads.
@@ -424,7 +424,7 @@
 	}
 #endif	/* MR_PROTECTPAGE */
 
-#if defined(NATIVE_GC) && defined(MR_HIGHLEVEL_CODE)
+#if defined(MR_NATIVE_GC) && defined(MR_HIGHLEVEL_CODE)
 	zone->gc_threshold = (char *) zone->MR_zone_end - MR_heap_margin_size;
 #endif
 
Index: runtime/mercury_memory_zones.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_memory_zones.h,v
retrieving revision 1.11
diff -u -u -r1.11 mercury_memory_zones.h
--- runtime/mercury_memory_zones.h	6 Feb 2002 08:41:47 -0000	1.11
+++ runtime/mercury_memory_zones.h	11 Feb 2002 17:05:24 -0000
@@ -126,7 +126,7 @@
 	#define MR_zone_end	top
 #endif
 
-#if defined(NATIVE_GC) && defined(MR_HIGHLEVEL_CODE)
+#if defined(MR_NATIVE_GC) && defined(MR_HIGHLEVEL_CODE)
 	/*
 	** This field, which is only used for heap zones,
 	** points to MR_heap_margin_size bytes before MR_zone_end.
@@ -172,7 +172,7 @@
 ** MR_init_memory_arena() allocates (if necessary) the top-level memory pool
 ** from which all allocations should come. If PARALLEL is defined, then
 ** this pool should be shared memory. In the absence of PARALLEL, it
-** doesn't need to do anything, since with CONSERVATIVE_GC, the collector
+** doesn't need to do anything, since with MR_CONSERVATIVE_GC, the collector
 ** manages the heap, and without GC, we can allocate memory using memalign
 ** or malloc.
 */
Index: runtime/mercury_prof.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_prof.c,v
retrieving revision 1.20
diff -u -u -r1.20 mercury_prof.c
--- runtime/mercury_prof.c	30 Jan 2002 14:51:08 -0000	1.20
+++ runtime/mercury_prof.c	11 Feb 2002 17:05:24 -0000
@@ -12,7 +12,7 @@
 
 #include        "mercury_imp.h"
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include	<unistd.h>
 #endif
 
Index: runtime/mercury_prof_time.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_prof_time.c,v
retrieving revision 1.3
diff -u -u -r1.3 mercury_prof_time.c
--- runtime/mercury_prof_time.c	30 Jan 2002 14:51:08 -0000	1.3
+++ runtime/mercury_prof_time.c	11 Feb 2002 17:05:24 -0000
@@ -20,17 +20,17 @@
 #include	<signal.h>
 #include	<errno.h>
 
-#ifdef	HAVE_UNISTD_H
+#ifdef	MR_HAVE_UNISTD_H
   #include	<unistd.h>
 #endif
 
-#ifdef	HAVE_SYS_TIME
+#ifdef	MR_HAVE_SYS_TIME_H
   #include	<sys/time.h>
 #endif
 
 #if	defined(MR_MPROF_PROFILE_TIME) || defined(MR_DEEP_PROFILING)
 
-#if	!defined(MR_CLOCK_TICKS_PER_SECOND) || !defined(HAVE_SETITIMER)
+#if	!defined(MR_CLOCK_TICKS_PER_SECOND) || !defined(MR_HAVE_SETITIMER)
   #error "Time profiling not supported on this system"
 #endif
 
Index: runtime/mercury_reg_workarounds.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_reg_workarounds.c,v
retrieving revision 1.4
diff -u -u -r1.4 mercury_reg_workarounds.c
--- runtime/mercury_reg_workarounds.c	8 Jun 2000 07:59:05 -0000	1.4
+++ runtime/mercury_reg_workarounds.c	11 Feb 2002 17:05:25 -0000
@@ -19,7 +19,7 @@
 #include <sys/types.h>	/* for fd_set and FD_ZERO() */
 #include <sys/time.h>	/* for FD_ZERO() */
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>	/* for FD_ZERO() */
 #endif
 
Index: runtime/mercury_regs.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_regs.h,v
retrieving revision 1.19
diff -u -u -r1.19 mercury_regs.h
--- runtime/mercury_regs.h	14 Jun 2001 03:47:22 -0000	1.19
+++ runtime/mercury_regs.h	11 Feb 2002 17:05:25 -0000
@@ -87,9 +87,9 @@
 /*
 ** The hardware description layer
 */
-#if defined(USE_GCC_GLOBAL_REGISTERS)
+#if defined(MR_USE_GCC_GLOBAL_REGISTERS)
   #ifndef __GNUC__
-    #error "You must use gcc if you define USE_GCC_GLOBAL_REGISTERS."
+    #error "You must use gcc if you define MR_USE_GCC_GLOBAL_REGISTERS."
   #endif
 
   #if defined(__mips__)
@@ -105,7 +105,7 @@
   #elif defined(_POWER) || defined(__powerpc__)
     #include "machdeps/rs6000_regs.h"
   #else
-    #error "USE_GCC_GLOBAL_REGISTERS not yet supported on this machine."
+    #error "MR_USE_GCC_GLOBAL_REGISTERS not yet supported on this machine."
   #endif
 #else
     #include "machdeps/no_regs.h"
@@ -179,7 +179,7 @@
 ** except that they only guarantee to save/restore the heap pointer,
 ** if any.  (They might save/restore other regs too, though.)
 */
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #define MR_save_transient_hp()	/* nothing */
   #define MR_restore_transient_hp()	/* nothing */
 #else
Index: runtime/mercury_runtime_util.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_runtime_util.c,v
retrieving revision 1.1
diff -u -u -r1.1 mercury_runtime_util.c
--- runtime/mercury_runtime_util.c	27 Dec 2001 07:08:10 -0000	1.1
+++ runtime/mercury_runtime_util.c	11 Feb 2002 17:05:25 -0000
@@ -17,7 +17,7 @@
 #include	<unistd.h>
 #include	<errno.h>
 
-#ifndef HAVE_STRERROR
+#ifndef MR_HAVE_STRERROR
 
 /*
 ** Apparently SunOS 4.1.3 doesn't have strerror()
@@ -39,7 +39,7 @@
 	}
 }
 
-#endif	/* HAVE_STRERROR */
+#endif	/* MR_HAVE_STRERROR */
 
 FILE *
 MR_checked_fopen(const char *filename, const char *message, const char *mode)
Index: runtime/mercury_runtime_util.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_runtime_util.h,v
retrieving revision 1.1
diff -u -u -r1.1 mercury_runtime_util.h
--- runtime/mercury_runtime_util.h	27 Dec 2001 07:08:10 -0000	1.1
+++ runtime/mercury_runtime_util.h	11 Feb 2002 17:05:25 -0000
@@ -9,7 +9,7 @@
 
 #include	<stdio.h>
 
-#ifndef HAVE_STRERROR
+#ifndef MR_HAVE_STRERROR
 extern	char	*strerror(int errnum);
 #endif
 
Index: runtime/mercury_signal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_signal.c,v
retrieving revision 1.11
diff -u -u -r1.11 mercury_signal.c
--- runtime/mercury_signal.c	31 Jan 2002 17:10:17 -0000	1.11
+++ runtime/mercury_signal.c	11 Feb 2002 17:05:25 -0000
@@ -12,7 +12,7 @@
 
 #include "mercury_imp.h"
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>
 #endif
 
@@ -22,19 +22,19 @@
 
 #include "mercury_signal.h"
 
-#ifdef HAVE_SYS_SIGINFO
+#ifdef MR_HAVE_SYS_SIGINFO_H
   #include <sys/siginfo.h>
 #endif 
 
-#ifdef	HAVE_MPROTECT
+#ifdef	MR_HAVE_MPROTECT
   #include <sys/mman.h>
 #endif
 
-#ifdef	HAVE_UCONTEXT
+#ifdef	MR_HAVE_UCONTEXT_H
   #include <ucontext.h>
 #endif
 
-#ifdef	HAVE_SYS_UCONTEXT
+#ifdef	MR_HAVE_SYS_UCONTEXT_H
   #include <sys/ucontext.h>
 #endif
 
@@ -76,7 +76,7 @@
 {
 	MR_signal_action	act;
 
-#if	defined(HAVE_SIGACTION)
+#if	defined(MR_HAVE_SIGACTION)
 
 	act.sa_flags = (restart ? SA_RESTART : 0);
 
@@ -87,7 +87,7 @@
 	** request signals, we should not ask for SA_SIGINFO, since our
 	** handler will not be of the right type.
 	*/
-#if	!defined(HAVE_SIGCONTEXT_STRUCT)
+#if	!defined(MR_HAVE_SIGCONTEXT_STRUCT)
 		act.sa_flags |= SA_SIGINFO;
 #endif
 	}
@@ -97,12 +97,12 @@
 	}
 	errno = 0;
 
-	act.SIGACTION_FIELD = handler;
-#else /* not HAVE_SIGACTION */
+	act.MR_SIGACTION_FIELD = handler;
+#else /* not MR_HAVE_SIGACTION */
 
 	act = handler;
 
-#endif /* not HAVE_SIGACTION */
+#endif /* not MR_HAVE_SIGACTION */
 
 	MR_set_signal_action(sig, &act, error_message);
 }
@@ -111,35 +111,35 @@
 MR_get_signal_action(int sig, MR_signal_action *act,
 			const char *error_message)
 {
-#ifdef HAVE_SIGACTION
+#ifdef MR_HAVE_SIGACTION
 	if (sigaction(sig, NULL, act) != 0) {
 		MR_perror(error_message);
 		exit(1);
 	}
 
-#else /* not HAVE_SIGACTION */
+#else /* not MR_HAVE_SIGACTION */
 	*act = signal(sig, NULL);
 	if (*act == SIG_ERR) {
 		MR_perror(error_message);
 		exit(1);
 	}
-#endif /* not HAVE_SIGACTION */
+#endif /* not MR_HAVE_SIGACTION */
 }
 
 void
 MR_set_signal_action(int sig, MR_signal_action *act,
 			const char *error_message)
 {
-#ifdef HAVE_SIGACTION
+#ifdef MR_HAVE_SIGACTION
 	if (sigaction(sig, act, NULL) != 0) {
 		MR_perror(error_message);
 		exit(1);
 	}
 
-#else /* not HAVE_SIGACTION */
+#else /* not MR_HAVE_SIGACTION */
 	if (signal(sig, *act) == SIG_ERR) {
 		MR_perror(error_message);
 		exit(1);
 	}
-#endif /* not HAVE_SIGACTION */
+#endif /* not MR_HAVE_SIGACTION */
 }
Index: runtime/mercury_signal.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_signal.h,v
retrieving revision 1.8
diff -u -u -r1.8 mercury_signal.h
--- runtime/mercury_signal.h	1 Feb 2002 08:43:20 -0000	1.8
+++ runtime/mercury_signal.h	11 Feb 2002 17:05:25 -0000
@@ -20,7 +20,7 @@
 #include "mercury_std.h"
 #include "mercury_conf.h"
 
-#ifdef HAVE_SIGCONTEXT_STRUCT
+#ifdef MR_HAVE_SIGCONTEXT_STRUCT
   /*
   ** Some versions of Linux call it struct sigcontext_struct, some call it
   ** struct sigcontext.  The following #define eliminates the differences.
@@ -42,14 +42,14 @@
   ** Some versions of Linux define it in <signal.h>, others define it in
   ** <asm/sigcontext.h>.  We try both.
   */
-  #ifdef HAVE_ASM_SIGCONTEXT
+  #ifdef MR_HAVE_ASM_SIGCONTEXT_H
     #include <asm/sigcontext.h>
   #endif 
 #else
   #include <signal.h>
 #endif
 
-#ifdef HAVE_SIGACTION
+#ifdef MR_HAVE_SIGACTION
 typedef struct sigaction	MR_signal_action;
 #else
 typedef MR_Code *		MR_signal_action;
Index: runtime/mercury_stacks.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stacks.h,v
retrieving revision 1.31
diff -u -u -r1.31 mercury_stacks.h
--- runtime/mercury_stacks.h	27 Dec 2001 07:25:23 -0000	1.31
+++ runtime/mercury_stacks.h	11 Feb 2002 17:05:25 -0000
@@ -263,7 +263,7 @@
 
 /* DEFINITIONS FOR EXCEPTION HANDLING */
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   #define MR_IF_NOT_CONSERVATIVE_GC(x)
 #else
   #define MR_IF_NOT_CONSERVATIVE_GC(x) x
Index: runtime/mercury_string.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_string.c,v
retrieving revision 1.12
diff -u -u -r1.12 mercury_string.c
--- runtime/mercury_string.c	8 Jan 2001 14:46:12 -0000	1.12
+++ runtime/mercury_string.c	11 Feb 2002 17:05:25 -0000
@@ -9,11 +9,11 @@
 #include "mercury_imp.h"
 #include "mercury_string.h"
 
-#if defined(HAVE__VSNPRINTF) && ! defined(HAVE_VSNPRINTF)
+#if defined(MR_HAVE__VSNPRINTF) && ! defined(MR_HAVE_VSNPRINTF)
   #define vsnprintf	_vsnprintf
 #endif
 
-#if defined(HAVE_VSNPRINTF) || defined(HAVE__VSNPRINTF)
+#if defined(MR_HAVE_VSNPRINTF) || defined(MR_HAVE__VSNPRINTF)
   #define MR_HAVE_A_VSNPRINTF
 #endif
 
Index: runtime/mercury_tabling.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling.h,v
retrieving revision 1.26
diff -u -u -r1.26 mercury_tabling.h
--- runtime/mercury_tabling.h	4 Dec 2000 18:28:42 -0000	1.26
+++ runtime/mercury_tabling.h	11 Feb 2002 17:05:26 -0000
@@ -21,7 +21,7 @@
 #include "mercury_reg_workarounds.h"
 #include "mercury_dlist.h"
 
-#ifndef CONSERVATIVE_GC
+#ifndef MR_CONSERVATIVE_GC
   #include "mercury_deep_copy.h"
 #endif
 
@@ -338,7 +338,7 @@
 
 /*---------------------------------------------------------------------------*/
 
-#ifndef NATIVE_GC
+#ifndef MR_NATIVE_GC
 
   #define MR_TABLE_NEW(type)						\
 	MR_GC_NEW(type)
@@ -367,7 +367,7 @@
   #define MR_table_list_cons(h, t)					\
 	MR_list_cons((h), (t))
 
-#else /* NATIVE_GC */
+#else /* MR_NATIVE_GC */
 
   #define MR_TABLE_NEW(type)						\
 	(MR_fatal_error("Sorry, not implemented: tabling in native gc grades"), \
@@ -396,7 +396,7 @@
 	(MR_fatal_error("Sorry, not implemented: tabling in native gc grades"), \
 	(MR_Word) 0)
 
-#endif /* NATIVE_GC */
+#endif /* MR_NATIVE_GC */
 
 #define MR_table_copy_bytes(dest, source, size)				\
 	MR_memcpy((dest), (source), (size))
Index: runtime/mercury_tags.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tags.h,v
retrieving revision 1.14
diff -u -u -r1.14 mercury_tags.h
--- runtime/mercury_tags.h	25 Oct 2001 12:41:19 -0000	1.14
+++ runtime/mercury_tags.h	11 Feb 2002 17:05:26 -0000
@@ -13,7 +13,7 @@
 #define	MERCURY_TAGS_H
 
 #include <limits.h>		/* for `CHAR_BIT' */
-#include "mercury_conf.h"	/* for `LOW_TAG_BITS' */
+#include "mercury_conf.h"	/* for `MR_LOW_TAG_BITS' */
 #include "mercury_types.h"	/* for `MR_Word' */
 
 /* DEFINITIONS FOR WORD LAYOUT */
@@ -25,11 +25,11 @@
   #ifdef HIGHTAGS
     #error "HIGHTAGS defined but TAGBITS undefined"
   #else
-    #define TAGBITS	LOW_TAG_BITS
+    #define TAGBITS	MR_LOW_TAG_BITS
   #endif
 #endif
 
-#if TAGBITS > 0 && defined(HIGHTAGS) && defined(CONSERVATIVE_GC)
+#if TAGBITS > 0 && defined(HIGHTAGS) && defined(MR_CONSERVATIVE_GC)
   #error "Conservative GC does not work with high tag bits"
 #endif
 
Index: runtime/mercury_timing.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_timing.c,v
retrieving revision 1.7
diff -u -u -r1.7 mercury_timing.c
--- runtime/mercury_timing.c	8 Feb 2002 03:41:37 -0000	1.7
+++ runtime/mercury_timing.c	11 Feb 2002 17:05:26 -0000
@@ -13,7 +13,7 @@
 
 #include "mercury_imp.h"
 
-#ifdef HAVE_SYS_TIMES_H
+#ifdef MR_HAVE_SYS_TIMES_H
   #include <sys/times.h>		/* for times() and `struct tms' */
 #endif
 
@@ -48,7 +48,7 @@
 	FILETIME_TO_MILLISEC(user_time, user_msec);
 	FILETIME_TO_MILLISEC(kernel_time, kernel_msec);
 	return user_msec + kernel_msec;
-#elif defined(HAVE_SYS_TIMES_H)
+#elif defined(MR_HAVE_SYS_TIMES_H)
   #ifdef MR_CLOCK_TICKS_PER_SECOND
 	const double ticks_per_milisecond = MR_CLOCK_TICKS_PER_SECOND / 1000.0;
 	struct tms t;
Index: runtime/mercury_timing.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_timing.h,v
retrieving revision 1.3
diff -u -u -r1.3 mercury_timing.h
--- runtime/mercury_timing.h	8 Jun 2000 07:59:06 -0000	1.3
+++ runtime/mercury_timing.h	11 Feb 2002 17:05:26 -0000
@@ -15,11 +15,11 @@
 
 #include "mercury_conf.h"
 
-#ifdef HAVE_SYS_PARAM
+#ifdef MR_HAVE_SYS_PARAM_H
 #include <sys/param.h>		/* for HZ */
 #endif
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>		/* for sysconf() and _SC_CLK_TCK */
 #endif
 
@@ -33,7 +33,7 @@
 */
 #ifdef HZ
   #define MR_CLOCK_TICKS_PER_SECOND	HZ
-#elif defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK)
+#elif defined(MR_HAVE_SYSCONF) && defined(_SC_CLK_TCK)
   #define MR_CLOCK_TICKS_PER_SECOND	((int) sysconf(_SC_CLK_TCK))
 #elif defined(CLK_TCK)
   #define MR_CLOCK_TICKS_PER_SECOND	CLK_TCK
Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.39
diff -u -u -r1.39 mercury_trace_base.c
--- runtime/mercury_trace_base.c	30 Jan 2002 14:51:09 -0000	1.39
+++ runtime/mercury_trace_base.c	11 Feb 2002 17:05:26 -0000
@@ -28,11 +28,11 @@
 #include <stdio.h>
 #include <errno.h>
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>		/* for the write system call */
 #endif
 
-#ifdef HAVE_SYS_WAIT
+#ifdef MR_HAVE_SYS_WAIT_H
   #include <sys/wait.h>		/* for the wait system call */
 #endif
 
@@ -221,7 +221,7 @@
 	}
 #endif
 
-#if defined(HAVE_KILL) && defined(HAVE_WAIT) && defined(SIGTERM)
+#if defined(MR_HAVE_KILL) && defined(MR_HAVE_WAIT) && defined(SIGTERM)
 	/*
 	** If mdb started a window, make sure it dies now.
 	*/
Index: runtime/mercury_trace_base.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.h,v
retrieving revision 1.20
diff -u -u -r1.20 mercury_trace_base.h
--- runtime/mercury_trace_base.h	30 Jan 2002 14:51:09 -0000	1.20
+++ runtime/mercury_trace_base.h	11 Feb 2002 17:05:26 -0000
@@ -19,7 +19,7 @@
 #include "mercury_stack_layout.h"
 #include "mercury_std.h"
 #include "mercury_tabling.h"	/* for MR_TableNode */
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>           /* for the write system call and pid_t */
 #endif
 
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.99
diff -u -u -r1.99 mercury_wrapper.c
--- runtime/mercury_wrapper.c	6 Feb 2002 08:41:47 -0000	1.99
+++ runtime/mercury_wrapper.c	11 Feb 2002 17:05:27 -0000
@@ -216,7 +216,7 @@
 void	(*MR_address_of_trace_final_external)(void);
 #endif
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 void	(*MR_address_of_init_gc)(void);
 #endif
 
@@ -266,7 +266,7 @@
 
 void	(*MR_register_module_layout)(const MR_Module_Layout *);
 
-#ifdef USE_GCC_NONLOCAL_GOTOS
+#ifdef MR_USE_GCC_NONLOCAL_GOTOS
 
 #define	SAFETY_BUFFER_SIZE	1024	/* size of stack safety buffer */
 #define	MAGIC_MARKER_2		142	/* a random character */
@@ -337,7 +337,7 @@
 	}
 #endif
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 	MR_init_conservative_GC();
 #endif
 
@@ -370,7 +370,7 @@
 
 	(*MR_address_of_mercury_init_io)();
 
-#if defined(MR_HIGHLEVEL_CODE) && defined(CONSERVATIVE_GC)
+#if defined(MR_HIGHLEVEL_CODE) && defined(MR_CONSERVATIVE_GC)
 	MR_init_memory();
   #ifdef MR_USE_TRAIL
 	/* initialize the trail */
@@ -456,7 +456,7 @@
 
 } /* end runtime_mercury_init() */
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 void
 MR_init_conservative_GC(void)
 {
@@ -502,7 +502,7 @@
 		}
 	}
 }
-#endif /* CONSERVATIVE_GC */
+#endif /* MR_CONSERVATIVE_GC */
 
 void 
 MR_do_init_modules(void)
@@ -927,7 +927,7 @@
 				MR_sregdebug      = TRUE;
 				MR_finaldebug     = TRUE;
 				MR_tracedebug     = TRUE;
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 				GC_quiet = FALSE;
 #endif
 			} else if (streq(MR_optarg, "b")) {
@@ -941,7 +941,7 @@
 			} else if (streq(MR_optarg, "g")) {
 				MR_gotodebug    = TRUE;
 			} else if (streq(MR_optarg, "G")) {
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 				GC_quiet = FALSE;
 #else
 				; /* ignore inapplicable option */
@@ -1075,7 +1075,7 @@
 			break;
 
 		case 'x':
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 			GC_dont_gc = TRUE;
 #endif
 
@@ -1119,7 +1119,7 @@
 	MR_Word c_regs[MR_NUM_REAL_REGS];
 #endif
 
-#if defined(MR_LOWLEVEL_DEBUG) && defined(USE_GCC_NONLOCAL_GOTOS)
+#if defined(MR_LOWLEVEL_DEBUG) && defined(MR_USE_GCC_NONLOCAL_GOTOS)
 	unsigned char	safety_buffer[SAFETY_BUFFER_SIZE];
 #endif
 
@@ -1161,7 +1161,7 @@
 	MR_save_regs_to_mem(c_regs);
 	MR_restore_registers();
 
-#if defined(MR_LOWLEVEL_DEBUG) && defined(USE_GCC_NONLOCAL_GOTOS)
+#if defined(MR_LOWLEVEL_DEBUG) && defined(MR_USE_GCC_NONLOCAL_GOTOS)
 	/*
 	** double-check to make sure that we're not corrupting
 	** the C stack with these non-local gotos, by filling
@@ -1174,7 +1174,7 @@
 #endif
 
 #ifdef MR_LOWLEVEL_DEBUG
-  #ifndef CONSERVATIVE_GC
+  #ifndef MR_CONSERVATIVE_GC
 	MR_ENGINE(MR_eng_heap_zone)->max =
 		MR_ENGINE(MR_eng_heap_zone)->min;
   #endif
@@ -1212,7 +1212,7 @@
 		MR_time_at_finish = MR_get_user_cpu_miliseconds();
 	}
 
-#if defined(USE_GCC_NONLOCAL_GOTOS) && defined(MR_LOWLEVEL_DEBUG)
+#if defined(MR_USE_GCC_NONLOCAL_GOTOS) && defined(MR_LOWLEVEL_DEBUG)
 	{
 		int i;
 
@@ -1228,7 +1228,7 @@
 #ifdef MR_LOWLEVEL_DEBUG
 	if (MR_memdebug) {
 		printf("\n");
-  #ifndef CONSERVATIVE_GC
+  #ifndef MR_CONSERVATIVE_GC
 		printf("max heap used:      %6ld words\n",
 			(long) (MR_ENGINE(MR_eng_heap_zone)->max
 				- MR_ENGINE(MR_eng_heap_zone)->min));
@@ -1589,7 +1589,7 @@
 #endif
 
 	MR_proceed();
-#ifndef	USE_GCC_NONLOCAL_GOTOS
+#ifndef	MR_USE_GCC_NONLOCAL_GOTOS
 	return 0;
 #endif
 
Index: runtime/mercury_wrapper.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.h,v
retrieving revision 1.48
diff -u -u -r1.48 mercury_wrapper.h
--- runtime/mercury_wrapper.h	6 Feb 2002 08:41:47 -0000	1.48
+++ runtime/mercury_wrapper.h	11 Feb 2002 17:05:27 -0000
@@ -56,7 +56,7 @@
 ** (--high-level-code) back-end, it may be called directly
 ** from main().
 */
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
   extern void	MR_init_conservative_GC(void);
 #endif
 
@@ -94,7 +94,7 @@
 extern	void		(*MR_address_of_write_out_proc_statics)(FILE *fp);
 #endif
 
-#ifdef CONSERVATIVE_GC
+#ifdef MR_CONSERVATIVE_GC
 extern	void		(*MR_address_of_init_gc)(void);
 #endif
 
Index: runtime/machdeps/i386_regs.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/machdeps/i386_regs.h,v
retrieving revision 1.19
diff -u -u -r1.19 i386_regs.h
--- runtime/machdeps/i386_regs.h	4 Dec 2000 18:35:19 -0000	1.19
+++ runtime/machdeps/i386_regs.h	11 Feb 2002 17:05:27 -0000
@@ -48,11 +48,11 @@
 /*
 ** Should we keep the GOT register (ebx) free for PIC code?
 */
-#if PIC && !defined(PIC_REG)
-  #define PIC_REG 1
+#if PIC && !defined(MR_PIC_REG)
+  #define MR_PIC_REG 1
 #endif
 
-#if PIC_REG
+#if MR_PIC_REG
   #define MR_NUM_REAL_REGS 2
 #else
   #define MR_NUM_REAL_REGS 3
@@ -64,7 +64,7 @@
 #define MR_real_reg_number_mr0	esi
 #define MR_real_reg_number_mr1	edi
 
-#if PIC_REG
+#if MR_PIC_REG
   #define 	MR_mr2	MR_fake_reg[2]
 #else
   register	MR_Word	MR_mr2 __asm__("ebx");	/* r1 */
@@ -73,7 +73,7 @@
 
 #endif
 
-#if PIC_REG
+#if MR_PIC_REG
 
 #define MR_save_regs_to_mem(save_area) (	\
 	save_area[0] = MR_mr0,			\
@@ -87,7 +87,7 @@
 	(void)0					\
 )
 
-#else /* ! PIC_REG */
+#else /* ! MR_PIC_REG */
 
 #define MR_save_regs_to_mem(save_area) (	\
 	save_area[0] = MR_mr0,			\
@@ -103,7 +103,7 @@
 	(void)0					\
 )
 
-#endif	/* ! PIC_REG */
+#endif	/* ! MR_PIC_REG */
 
 #define MR_save_transient_regs_to_mem(save_area)	((void)0)
 #define MR_restore_transient_regs_from_mem(save_area)	((void)0)
Index: runtime/machdeps/sparc_regs.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/machdeps/sparc_regs.h,v
retrieving revision 1.22
diff -u -u -r1.22 sparc_regs.h
--- runtime/machdeps/sparc_regs.h	4 Dec 2000 18:35:22 -0000	1.22
+++ runtime/machdeps/sparc_regs.h	11 Feb 2002 17:05:27 -0000
@@ -23,7 +23,7 @@
 ** This won't work at all unless we are using gcc's non-local gotos.
 */
 
-#ifndef USE_GCC_NONLOCAL_GOTOS
+#ifndef MR_USE_GCC_NONLOCAL_GOTOS
   #error "On SPARCs, you must use non-local gotos if you want global registers"
 #else
 
Index: tests/valid/zero_arity.m
===================================================================
RCS file: /home/mercury1/repository/tests/valid/zero_arity.m,v
retrieving revision 1.2
diff -u -u -r1.2 zero_arity.m
--- tests/valid/zero_arity.m	21 Sep 1999 07:26:18 -0000	1.2
+++ tests/valid/zero_arity.m	11 Feb 2002 17:06:15 -0000
@@ -38,7 +38,7 @@
 quux :- semidet_fail.
 
 :- pragma c_code(use_asm_labels, [will_not_call_mercury, thread_safe], "
-#ifdef USE_ASM_LABELS
+#ifdef MR_USE_ASM_LABELS
 	SUCCESS_INDICATOR = TRUE;
 #else
 	SUCCESS_INDICATOR = FALSE;
Index: trace/mercury_trace_external.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_external.c,v
retrieving revision 1.61
diff -u -u -r1.61 mercury_trace_external.c
--- trace/mercury_trace_external.c	30 Jan 2002 05:09:11 -0000	1.61
+++ trace/mercury_trace_external.c	11 Feb 2002 17:05:32 -0000
@@ -50,7 +50,7 @@
 #include <netinet/in.h>
 #include <netdb.h>
 #include <stdlib.h>
-#ifdef HAVE_DLFCN_H
+#ifdef MR_HAVE_DLFCN_H
   #include <dlfcn.h>
 #endif
 
@@ -1568,7 +1568,7 @@
 		(*send_collect_result_ptr)(
 			MR_collected_variable, 
 			(MR_Word) &MR_debugger_socket_out));
-#if defined(HAVE_DLFCN_H) && defined(HAVE_DLCLOSE)
+#if defined(MR_HAVE_DLFCN_H) && defined(MR_HAVE_DLCLOSE)
 	MR_TRACE_CALL_MERCURY(
        		ML_CL_unlink_collect(collect_lib_maybe_handle));
 #endif
Index: trace/mercury_trace_internal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.112
diff -u -u -r1.112 mercury_trace_internal.c
--- trace/mercury_trace_internal.c	30 Jan 2002 14:51:11 -0000	1.112
+++ trace/mercury_trace_internal.c	11 Feb 2002 17:05:32 -0000
@@ -40,31 +40,31 @@
 #include <errno.h>
 #include <signal.h>
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
+#ifdef MR_HAVE_SYS_TYPES_H
   #include <sys/types.h>
 #endif
 
-#ifdef HAVE_SYS_WAIT
+#ifdef MR_HAVE_SYS_WAIT_H
   #include <sys/wait.h>
 #endif
 
-#ifdef HAVE_TERMIOS_H
+#ifdef MR_HAVE_TERMIOS_H
   #include <termios.h>
 #endif
 
-#ifdef HAVE_FCNTL_H
+#ifdef MR_HAVE_FCNTL_H
   #include <fcntl.h>
 #endif
 
-#ifdef HAVE_SYS_IOCTL_H
+#ifdef MR_HAVE_SYS_IOCTL_H
   #include <sys/ioctl.h>
 #endif
 
-#ifdef HAVE_SYS_STROPTS_H
+#ifdef MR_HAVE_SYS_STROPTS_H
   #include <sys/stropts.h>
 #endif
 
@@ -463,18 +463,18 @@
 	**
 	** XXX Add support for MS Windows.
 	*/
-#if defined(HAVE_OPEN) && defined(O_RDWR) && defined(HAVE_FDOPEN) && \
-	defined(HAVE_CLOSE) && defined(HAVE_DUP) && defined(HAVE_DUP2) && \
-	defined(HAVE_FORK) && defined(HAVE_EXECLP) && \
-	defined(HAVE_DEV_PTMX) && defined(HAVE_GRANTPT) && \
-	defined(HAVE_UNLOCKPT) && defined(HAVE_PTSNAME)
+#if defined(MR_HAVE_OPEN) && defined(O_RDWR) && defined(MR_HAVE_FDOPEN) && \
+	defined(MR_HAVE_CLOSE) && defined(MR_HAVE_DUP) && defined(MR_HAVE_DUP2) && \
+	defined(MR_HAVE_FORK) && defined(MR_HAVE_EXECLP) && \
+	defined(MR_HAVE_DEV_PTMX) && defined(MR_HAVE_GRANTPT) && \
+	defined(MR_HAVE_UNLOCKPT) && defined(MR_HAVE_PTSNAME)
 
 	int master_fd = -1;
 	int slave_fd = -1;
 	char *slave_name;
 	pid_t child_pid;
-#if defined(HAVE_TERMIOS_H) && defined(HAVE_TCGETATTR) && \
-		defined(HAVE_TCSETATTR) && defined(ECHO) && defined(TCSADRAIN)
+#if defined(MR_HAVE_TERMIOS_H) && defined(MR_HAVE_TCGETATTR) && \
+		defined(MR_HAVE_TCSETATTR) && defined(ECHO) && defined(TCSADRAIN)
 	struct termios termio;
 #endif
 	master_fd = open("/dev/ptmx", O_RDWR);
@@ -500,14 +500,14 @@
 		return FALSE;
 	}
 
-#if defined(HAVE_IOCTL) && defined(I_PUSH)
+#if defined(MR_HAVE_IOCTL) && defined(I_PUSH)
 	/* Magic STREAMS incantations to make this work on Solaris. */
 	ioctl(slave_fd, I_PUSH, "ptem");
 	ioctl(slave_fd, I_PUSH, "ldterm");
 	ioctl(slave_fd, I_PUSH, "ttcompat");
 #endif
 
-#if defined(HAVE_TCGETATTR) && defined(HAVE_TCSETATTR) && \
+#if defined(MR_HAVE_TCGETATTR) && defined(MR_HAVE_TCSETATTR) && \
 		defined(ECHO) && defined(TCSADRAIN)
 	/*
 	** Turn off echoing before starting the xterm so that
@@ -534,7 +534,7 @@
 
 		close(slave_fd);
 
-#if defined(HAVE_SETPGID)
+#if defined(MR_HAVE_SETPGID)
 		/*
 		** Put the xterm in a new process group so it won't be
 		** killed by SIGINT signals sent to the program.
@@ -610,7 +610,7 @@
 		MR_set_signal_action(SIGALRM, &old_alarm_action,
 			"error resetting alarm handler");
 
-#if defined(HAVE_TCGETATTR) && defined(HAVE_TCSETATTR) && \
+#if defined(MR_HAVE_TCGETATTR) && defined(MR_HAVE_TCSETATTR) && \
 			defined(ECHO) && defined(TCSADRAIN)
 		/* Restore echoing. */
 		termio.c_lflag |= ECHO;
@@ -652,7 +652,7 @@
 		return TRUE;
 
 parent_error:
-#if defined(HAVE_KILL) && defined(SIGTERM) && defined(HAVE_WAIT)
+#if defined(MR_HAVE_KILL) && defined(SIGTERM) && defined(MR_HAVE_WAIT)
 		if (kill(child_pid, SIGTERM) != -1) {
 			do {
 				wait_status = wait(NULL);
@@ -672,11 +672,11 @@
 
 	}
 
-#else 	/* !HAVE_OPEN, etc. */
+#else 	/* !MR_HAVE_OPEN, etc. */
 	MR_mdb_warning(
 		"Sorry, `mdb --window' not supported on this platform.\n");
 	return FALSE;
-#endif /* !HAVE_OPEN, etc. */
+#endif /* !MR_HAVE_OPEN, etc. */
 }
 
 static void
Index: trace/mercury_trace_readline.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_readline.c,v
retrieving revision 1.6
diff -u -u -r1.6 mercury_trace_readline.c
--- trace/mercury_trace_readline.c	11 Dec 2001 09:01:25 -0000	1.6
+++ trace/mercury_trace_readline.c	11 Feb 2002 17:05:32 -0000
@@ -21,16 +21,16 @@
 #include "mercury_trace_readline.h"
 
 #ifndef MR_NO_USE_READLINE
-  #ifdef HAVE_READLINE_READLINE
+  #ifdef MR_HAVE_READLINE_READLINE_H
     #include "readline/readline.h"
   #else
     FILE *rl_instream;
     FILE *rl_outstream;
   #endif
-  #ifdef HAVE_READLINE_HISTORY
+  #ifdef MR_HAVE_READLINE_HISTORY_H
     #include "readline/history.h"
   #endif
-  #ifdef HAVE_UNISTD_H
+  #ifdef MR_HAVE_UNISTD_H
      #include <unistd.h>	/* for isatty() */
   #endif
 #endif
@@ -51,8 +51,8 @@
 char *
 MR_trace_readline(const char *prompt, FILE *in, FILE *out)
 {
-#if (defined(isatty) || defined(HAVE_ISATTY)) \
- && (defined(fileno) || defined(HAVE_FILENO)) \
+#if (defined(isatty) || defined(MR_HAVE_ISATTY)) \
+ && (defined(fileno) || defined(MR_HAVE_FILENO)) \
  && !defined(MR_NO_USE_READLINE)
 	/* use readline, if the input file is a terminal */
 	if (isatty(fileno(in))) {
Index: trace/mercury_trace_source.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_source.c,v
retrieving revision 1.4
diff -u -u -r1.4 mercury_trace_source.c
--- trace/mercury_trace_source.c	13 Nov 2001 12:37:21 -0000	1.4
+++ trace/mercury_trace_source.c	11 Feb 2002 17:05:32 -0000
@@ -22,11 +22,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include <unistd.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
+#ifdef MR_HAVE_SYS_TYPES_H
   #include <sys/types.h>	/* for getpid() */
 #endif
 
@@ -227,7 +227,7 @@
 	*/
 	base_len = strlen(MR_SOURCE_SERVER_BASENAME);
 
-#if defined(HAVE_GETPID) && defined(HAVE_GETHOSTNAME)
+#if defined(MR_HAVE_GETPID) && defined(MR_HAVE_GETHOSTNAME)
 	/*
 	** Need to leave enough room for the pid, two '.'s and the
 	** terminating zero.
Index: trace/mercury_trace_spy.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_spy.c,v
retrieving revision 1.18
diff -u -u -r1.18 mercury_trace_spy.c
--- trace/mercury_trace_spy.c	7 Aug 2001 02:16:06 -0000	1.18
+++ trace/mercury_trace_spy.c	11 Feb 2002 17:05:32 -0000
@@ -409,7 +409,7 @@
 
 	if (new_size == old_size) {
 		/* there were no matching labels */
-#ifdef	HAVE_SNPRINTF
+#ifdef	MR_HAVE_SNPRINTF
 		snprintf(MR_error_msg_buf, MR_ERROR_MSG_BUF_SIZE,
 			"there is no event at %s:%d",
 			filename, linenumber);
Index: trace/mercury_trace_vars.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_vars.c,v
retrieving revision 1.33
diff -u -u -r1.33 mercury_trace_vars.c
--- trace/mercury_trace_vars.c	4 Feb 2002 05:23:10 -0000	1.33
+++ trace/mercury_trace_vars.c	11 Feb 2002 17:05:33 -0000
@@ -159,7 +159,7 @@
   extern struct MR_TypeCtorInfo_Struct
   	mercury_data___type_ctor_info_void_0;
 
-  #ifdef NATIVE_GC
+  #ifdef MR_NATIVE_GC
     extern struct MR_TypeCtorInfo_Struct
 	mercury_data___type_ctor_info_succip_0;
     extern struct MR_TypeCtorInfo_Struct
@@ -196,7 +196,7 @@
 	/* we ignore these because they should never be needed */
 	&mercury_data___type_ctor_info_void_0,
 
-  #ifdef NATIVE_GC
+  #ifdef MR_NATIVE_GC
 	/* we ignore these because they are not interesting */
 	&mercury_data___type_ctor_info_succip_0,
 	&mercury_data___type_ctor_info_hp_0,
Index: util/mdemangle.c
===================================================================
RCS file: /home/mercury1/repository/mercury/util/mdemangle.c,v
retrieving revision 1.42
diff -u -u -r1.42 mdemangle.c
--- util/mdemangle.c	25 Sep 2001 09:37:12 -0000	1.42
+++ util/mdemangle.c	11 Feb 2002 17:05:33 -0000
@@ -49,7 +49,7 @@
 ** Using memcpy() may not work, but it doesn't really matter
 ** if the demangler doesn't work 100% correctly on SunOS 4.x.
 */
-#ifndef HAVE_MEMMOVE
+#ifndef MR_HAVE_MEMMOVE
 #define memmove memcpy
 #endif
 
Index: util/mkinit.c
===================================================================
RCS file: /home/mercury1/repository/mercury/util/mkinit.c,v
retrieving revision 1.84
diff -u -u -r1.84 mkinit.c
--- util/mkinit.c	4 Feb 2002 00:33:08 -0000	1.84
+++ util/mkinit.c	11 Feb 2002 17:05:34 -0000
@@ -26,11 +26,11 @@
 
 #include	"mercury_conf.h"
 
-#ifdef HAVE_SYS_STAT_H
+#ifdef MR_HAVE_SYS_STAT_H
   #include	<sys/stat.h>
 #endif
 
-#ifdef HAVE_UNISTD_H
+#ifdef MR_HAVE_UNISTD_H
   #include	<unistd.h>
 #endif
 
@@ -209,7 +209,7 @@
 	"** on these machines, init_gc must be statically linked.\n"
 	"*/\n"
 	"\n"
-	"#ifdef CONSERVATIVE_GC\n"
+	"#ifdef MR_CONSERVATIVE_GC\n"
 	"static void init_gc(void)\n"
 	"{\n"
 	"	GC_INIT();\n"
@@ -236,7 +236,7 @@
 	"  MR_declare_entry(%s);\n"
 	"#endif\n"
 	"\n"
-	"#if defined(USE_DLLS)\n"
+	"#if defined(MR_USE_DLLS)\n"
 	"  #if !defined(libmer_DEFINE_DLL)\n"
 	"       #define libmer_impure_ptr \\\n"
 	"		(*__imp_libmer_impure_ptr)\n"
@@ -269,7 +269,7 @@
 	"mercury_init(int argc, char **argv, char *stackbottom)\n"
 	"{\n"
 	"\n"
-	"#ifdef CONSERVATIVE_GC\n"
+	"#ifdef MR_CONSERVATIVE_GC\n"
 	"	/*\n"
 	"	** Explicitly register the bottom of the stack, so that the\n"
 	"	** GC knows where it starts.  This is necessary for AIX 4.1\n"
@@ -284,7 +284,7 @@
 	"** to take special steps to initialize _impure_ptr\n"
 	"** for the DLLs.\n"
 	"*/\n"
-	"#if defined(USE_DLLS)\n"
+	"#if defined(MR_USE_DLLS)\n"
 	"  #if !defined(libmer_DEFINE_DLL)\n"
 	"	libmer_impure_ptr = _impure_ptr;\n"
 	"  #endif\n"
@@ -319,7 +319,7 @@
 	"	MR_address_of_type_ctor_info_for_tuple ="
 	"		&mercury_data___type_ctor_info_tuple_0;\n"
 	"#endif\n"
-	"#ifdef CONSERVATIVE_GC\n"
+	"#ifdef MR_CONSERVATIVE_GC\n"
 	"	MR_address_of_init_gc = init_gc;\n"
 	"#endif\n"
 	"	MR_library_initializer = ML_io_init_state;\n"
@@ -354,7 +354,7 @@
 	"	MR_address_of_trace_final_external = NULL;\n"
 	"  #endif\n"
 	"#endif\n"
-	"#if defined(USE_GCC_NONLOCAL_GOTOS) && !defined(USE_ASM_LABELS)\n"
+	"#if defined(MR_USE_GCC_NONLOCAL_GOTOS) && !defined(MR_USE_ASM_LABELS)\n"
 	"	MR_do_init_modules();\n"
 	"#endif\n"
 	"#ifdef MR_HIGHLEVEL_CODE\n"
@@ -433,7 +433,7 @@
 
 /*---------------------------------------------------------------------------*/
 
-#ifndef HAVE_STRERROR
+#ifndef MR_HAVE_STRERROR
 
 /*
 ** Apparently SunOS 4.1.3 doesn't have strerror()
@@ -713,7 +713,7 @@
 static bool
 file_exists(const char *filename)
 {
-#ifdef HAVE_SYS_STAT_H
+#ifdef MR_HAVE_SYS_STAT_H
 	struct stat buf;
 
 	return (stat(filename, &buf) == 0);
--------------------------------------------------------------------------
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