[m-rev.] diff: disable some old backwards compat stuff

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Nov 12 17:13:14 AEDT 2001


Estimated hours taken: 1

runtime/mercury_bootstrap.h:
	Move a large chunk of the things defined here
	from the section which is included by default
	to the section which is only included if you
	explicitly enable -DMR_EXTRA_BACKWARDS_COMPAT.

Index: mercury_bootstrap.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.h,v
retrieving revision 1.21
diff -u -r1.21 mercury_bootstrap.h
--- mercury_bootstrap.h	21 Feb 2001 08:32:39 -0000	1.21
+++ mercury_bootstrap.h	10 Nov 2001 06:09:45 -0000
@@ -15,6 +15,72 @@
 #ifndef	MERCURY_BOOTSTRAP_H
 #define	MERCURY_BOOTSTRAP_H
 
+/*
+** This stuff is enabled by default,
+** but you can disable it by defining MR_NO_BACKWARDS_COMPAT.
+*/
+
+#ifndef MR_NO_BACKWARDS_COMPAT
+
+
+/* 
+** For a long time the Mercury C types were defined as Char, Float,
+** Integer, Word, etc.  There will doubtless be lots of C code in
+** libraries that relies upon these names.  
+**
+** People may have written code that relies upon these names, so  
+** if you remove these names you need to give warning (unlike some of
+** the other changes in this file).
+*/
+
+#include "mercury_types.h"
+#include "mercury_float.h"
+
+typedef MR_Word 		Word;
+typedef MR_Code 		Code;
+typedef MR_Char 		Char;
+typedef MR_Float 		Float;
+typedef MR_Float64 		Float64;
+typedef MR_Integer 		Integer;
+typedef MR_Unsigned 		Unsigned;
+typedef MR_UnsignedChar 	UnsignedChar;
+typedef MR_String 		String;
+typedef MR_ConstString 		ConstString;
+typedef MR_Bool 		Bool;
+
+/*
+** The list manipulation macros are available for use by ordinary Mercury
+** programmers. People may have written code using these macros before their
+** documented names were changed, so removing backward compatibility for them
+** requires more warning than for the other things in this file.
+*/
+
+#define	list_is_empty(l)	MR_list_is_empty(l)
+#define	list_head(l)		MR_list_head(l)
+#define	list_tail(l)		MR_list_tail(l)
+#define	list_empty()		MR_list_empty()
+#define	list_cons(h, t)		MR_list_cons((h), (t))
+
+#endif	/* MR_NO_BACKWARDS_COMPAT */
+
+/*---------------------------------------------------------------------------*/
+/*
+** This stuff is not enabled by default.
+** To enable it, you must explicitly define MR_EXTRA_BACKWARDS_COMPAT.
+*/
+#ifdef	MR_EXTRA_BACKWARDS_COMPAT
+
+#define	COMPARE_EQUAL		MR_COMPARE_EQUAL
+#define	COMPARE_LESS		MR_COMPARE_LESS
+#define	COMPARE_GREATER		MR_COMPARE_GREATER
+
+#define make_aligned_string_copy(a,b)	MR_make_aligned_string_copy((a),(b))
+#define make_aligned_string(a,b)	MR_make_aligned_string((a),(b))
+#define string_equal(a,b)		MR_string_equal((a),(b))
+#define string_const(a,b)		MR_string_const((a),(b))
+#define hash_string(s)			MR_hash_string((s))
+#define fatal_error(s)			MR_fatal_error((s))
+
 #define do_redo				MR_do_redo
 #define do_fail				MR_do_fail
 #define do_reset_hp_fail		MR_do_reset_hp_fail
@@ -23,13 +89,6 @@
 #define do_not_reached			MR_do_not_reached
 #define exception_handler_do_fail	MR_exception_handler_do_fail
 
-/*
-** This stuff is enabled by default,
-** but you can disable it by defining MR_NO_BACKWARDS_COMPAT.
-*/
-
-#ifndef MR_NO_BACKWARDS_COMPAT
-
 #define	r1				MR_r1
 #define	r2				MR_r2
 #define	r3				MR_r3
@@ -252,64 +311,6 @@
 
 #define	save_transient_hp()		MR_save_transient_hp()
 #define	restore_transient_hp()		MR_restore_transient_hp()
-
-
-/* 
-** For a long time the Mercury C types were defined as Char, Float,
-** Integer, Word, etc.  There will doubtless be lots of C code in
-** libraries that relies upon these names.  
-**
-** People may have written code that relies upon these names, so  
-** if you remove these names you need to give warning (unlike some of
-** the other changes in this file).
-*/
-
-#include "mercury_types.h"
-#include "mercury_float.h"
-typedef MR_Word 		Word;
-typedef MR_Code 		Code;
-typedef MR_Char 		Char;
-typedef MR_Float 		Float;
-typedef MR_Float64 		Float64;
-typedef MR_Integer 		Integer;
-typedef MR_Unsigned 		Unsigned;
-typedef MR_UnsignedChar 	UnsignedChar;
-typedef MR_String 		String;
-typedef MR_ConstString 		ConstString;
-typedef MR_Bool 		Bool;
-
-#define	COMPARE_EQUAL		MR_COMPARE_EQUAL
-#define	COMPARE_LESS		MR_COMPARE_LESS
-#define	COMPARE_GREATER		MR_COMPARE_GREATER
-
-#define make_aligned_string_copy(a,b)	MR_make_aligned_string_copy((a),(b))
-#define make_aligned_string(a,b)	MR_make_aligned_string((a),(b))
-#define string_equal(a,b)		MR_string_equal((a),(b))
-#define string_const(a,b)		MR_string_const((a),(b))
-#define hash_string(s)			MR_hash_string((s))
-#define fatal_error(s)			MR_fatal_error((s))
-
-/*
-** The list manipulation macros are available for use by ordinary Mercury
-** programmers. People may have written code using these macros before their
-** documented names were changed, so removing backward compatibility for them
-** requires more warning than for the other things in this file.
-*/
-
-#define	list_is_empty(l)	MR_list_is_empty(l)
-#define	list_head(l)		MR_list_head(l)
-#define	list_tail(l)		MR_list_tail(l)
-#define	list_empty()		MR_list_empty()
-#define	list_cons(h, t)		MR_list_cons((h), (t))
-
-#endif	/* MR_NO_BACKWARDS_COMPAT */
-
-/*---------------------------------------------------------------------------*/
-/*
-** This stuff is not enabled by default.
-** To enable it, you must explicitly define MR_EXTRA_BACKWARDS_COMPAT.
-*/
-#ifdef	MR_EXTRA_BACKWARDS_COMPAT
 
 #define succip			MR_succip
 #define hp			MR_hp
--------------------------------------------------------------------------
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