[m-dev.] diff: add `MR_' prefixes to mercury_mcpp.h

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jan 13 12:58:15 AEDT 2001


Estimated hours taken: 0.75

runtime/mercury_mcpp.h:
	Add `MR_' prefixes to the macros defined in this file,
	to avoid invading the user's namespace.
	Also improve the indentation, and use tabs instead of spaces.

----------

I'll commit this on both the main and release branches.
(Invading the user's namespace is a bug.)

I made lots of whitespace changes, but the diff below
is with `-b' so they don't show up.

The ^M's are because this file is in DOS format -- see
my other mail.

----------

Workspace: /home/pgrad/fjh/ws/hg
Index: runtime/mercury_mcpp.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_mcpp.h,v
retrieving revision 1.3
diff -u -d -b -r1.3 mercury_mcpp.h
--- runtime/mercury_mcpp.h	2001/01/09 23:30:21	1.3
+++ runtime/mercury_mcpp.h	2001/01/13 01:49:34
@@ -87,8 +87,8 @@
 // re-use this code, however this has not been done yet.
 
 // In the .NET backend, we don't need to forward declare RTTI structures.
-#define Declare_entry(a) 	
-#define Declare_struct(a) 
+#define MR_Declare_entry(a) 	
+#define MR_Declare_struct(a) 
 
 // We have to jump through a few hoops to get function pointers -- we do
 // it in IL currently.  We treat function pointers as integers and have
@@ -96,7 +96,8 @@
 #define MR_BOX_INT(a) mercury::runtime::Convert::ToObject(a)
 #define MR_MAYBE_STATIC_CODE(a) \
 	MR_BOX_INT(mercury::runtime::TempHack::get_ftn_ptr_##a())
-#define ENTRY(a) a
+#define MR_ENTRY(a) a
+// XXX MR_ENTRY appears to be unused
 
 // Code to handle initialization of fields.
 #define MR_STRUCT_INIT(a) 
@@ -105,7 +106,8 @@
     static MR_Word a(void) { \
         System::Object *arr[] = { 
 #define MR_CLASS_INIT_END(m, f, i)             \
-        }; return arr;                      \
+		};			\
+		return arr;		\
         }                                   \
         static MR_Word f = i();  \
         static MR_Word MR_PASTE2(m, f) = i();
@@ -155,9 +157,9 @@
 // XXX we should integrate this macro in with the version in 
 // mercury_typeinfo.h
 #define MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_FULL(m, n, a, cr, u, c)    \
-    Declare_entry(u)                                                   \
-    Declare_entry(c)                                                   \
-    Declare_struct(MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_Struct)  \
+    MR_Declare_entry(u)							\
+    MR_Declare_entry(c)							\
+    MR_Declare_struct(MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_Struct)  \
     MR_STRUCT_INIT(MR_PASTE5(mercury_data_, __type_ctor_info_, n, _, a) = {)   \
     MR_CLASS_INIT(MR_PASTE4(type_ctor_init_, n, _, a))   \
         MR_BOX_INT(a),                                              \
@@ -268,5 +270,5 @@
 #define MR_TYPE_CTOR_INFO_UNIFY_PRED_SLOT	1
 #define MR_TYPE_CTOR_INFO_COMPARE_PRED_SLOT	3
 
-}
+} /* end namespace mercury */
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list