[m-rev.] diff: use MR_GNUC in more places

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Aug 2 18:27:16 AEST 2011


With this change plus a couple of others which I will post
separately, Mercury now passes a complete bootcheck using
clange as a C compiler on Mac OS X in both the none.gc and
hlc.gc grades.

-----------------------

Branches: main, 11.07

runtime/mercury_string.h:
runtime/mercury_types.h:
 	Use MR_GNUC in place of __GNUC__ in some spots.

Julien.

Index: runtime/mercury_string.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_string.h,v
retrieving revision 1.41
diff -u -r1.41 mercury_string.h
--- runtime/mercury_string.h	2 Aug 2011 00:05:44 -0000	1.41
+++ runtime/mercury_string.h	2 Aug 2011 08:22:55 -0000
@@ -253,7 +253,7 @@
  MR_Integer	MR_hash_string2(MR_ConstString);
  MR_Integer	MR_hash_string3(MR_ConstString);

-#ifdef __GNUC__
+#if defined(MR_GNUC)
  #define MR_hash_string(s)						\
  	({								\
  	 	MR_Integer hash_string_result;				\
Index: runtime/mercury_types.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_types.h,v
retrieving revision 1.62
diff -u -r1.62 mercury_types.h
--- runtime/mercury_types.h	20 May 2011 04:16:56 -0000	1.62
+++ runtime/mercury_types.h	2 Aug 2011 08:22:55 -0000
@@ -42,8 +42,9 @@
  #if __STDC_VERSION__ >= 199901  /* January 1999 */
    /* Use C9X-style variable-length arrays. */
    #define   MR_VARIABLE_SIZED   /* nothing */
-#elif defined(__GNUC__)
+#elif defined(MR_GNUC)
    /* Use GNU-style variable-length arrays */
+  /* Note: clang does *not* support these. */
    #define   MR_VARIABLE_SIZED   0
  #else
    /* Just fake it by pretending that the array has a fixed size */

--------------------------------------------------------------------------
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