[m-rev.] diff: clang high-level C runtime fix

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jul 12 13:20:15 AEST 2011


Branches: main, 11.07

Fix a problem that was causing the runtime not to compile in high-level C
grades with clang.

runtime/mercury_std.h:
 	Define MR_STATIC_INLINE and friends for clang.

 	Add an XXX regarding the use of the C99 definitions for the above.

Julien.

Index: runtime/mercury_std.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_std.h,v
retrieving revision 1.31
diff -u -r1.31 mercury_std.h
--- runtime/mercury_std.h	13 Sep 2005 08:25:39 -0000	1.31
+++ runtime/mercury_std.h	12 Jul 2011 03:17:31 -0000
@@ -161,6 +161,15 @@
    #define MR_INLINE			inline
    #define MR_EXTERN_INLINE		inline
    #define MR_OUTLINE_DEFN(DECL,BODY)
+#elif defined(__clang__)
+  /* clang: note that since clang also defines the macro __GNUC__
+  ** we must handle it before we handle the GCC case.
+  ** XXX why don't the C99 definitions work for clang?
+  */
+  #define MR_STATIC_INLINE		static
+  #define MR_INLINE			static
+  #define MR_EXTERN_INLINE		static
+  #define MR_OUTLINE_DEFN(DECL,BODY)
  #elif defined(__GNUC__)
    /* GNU C */
    #define MR_STATIC_INLINE		static __inline__

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list