[m-rev.] mercury_bootstrap.h
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Dec 11 21:08:02 AEDT 2001
On 21-Feb-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
>
> runtime/mercury_bootstrap.h:
> Make this file define nothing unless MR_EXTRA_BACKWARDS_COMPAT is
> defined. This should help keep our system namespace clean.
The log message for that change did't match the code, which actually
left a whole bunch of stuff defined by default:
> Index: runtime/mercury_bootstrap.h
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.h,v
> retrieving revision 1.20
> diff -u -b -r1.20 mercury_bootstrap.h
> --- runtime/mercury_bootstrap.h 2000/12/07 01:00:05 1.20
> +++ runtime/mercury_bootstrap.h 2001/02/21 04:37:51
> @@ -23,6 +23,13 @@
> #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
...
I think that may have been deliberate -- we probably decided
to keep these macros enabled by default for release 0.10 --
but the incorrect log message had me confused for a while.
Anyway, I now propose to commit the following change, which does what
the previous change's log message said it would do.
----------
Estimated hours taken: 1
Branches: main
runtime/mercury_bootstrap.h:
Make this file define nothing unless MR_EXTRA_BACKWARDS_COMPAT is
defined. This should help keep our system namespace clean.
Index: mercury_bootstrap.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.h,v
retrieving revision 1.21
diff -u -d -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
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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