[m-rev.] diff: fix problems with the Mercury compiler in the C# grade

Julien Fischer jfischer at opturion.com
Mon Jul 7 14:43:04 AEST 2014

Branches: 14.01, master

Note: the motivation for the following was to test some changes
to the build system, not necessarily to get a fully operational
compiler built in the C# grade.


Fix problems with the Mercury compiler in the C# grade.

Fix some problems that prevent the Mercury compiler building and running in the
C# grade.  "Running" here means that ./mercury_compile --help works; I haven't
tried anything more ambitious (yet).

 	Add a Mercury definition of unlimit_stack/2 for use by the non-C

 	Do not cause a preprocessor error if we are compiling with high-level
 	code and without the Boehm GC if we are using clang.
 	We need this on OS X because we include this header when building the
 	programs in the util directory and on OS X we will probably be using
 	clang rather than GCC.  (Clang and GCC both support the required
 	extensions to C here, so this won't be a problem.)


diff --git a/mdbcomp/shared_utilities.m b/mdbcomp/shared_utilities.m
index 7b6613e..1866782 100644
--- a/mdbcomp/shared_utilities.m
+++ b/mdbcomp/shared_utilities.m
@@ -64,4 +64,8 @@

+    % Clause for non-C backends.
+    %
diff --git a/runtime/mercury.h b/runtime/mercury.h
index 543f188..b452de0 100644
--- a/runtime/mercury.h
+++ b/runtime/mercury.h
@@ -232,13 +232,13 @@ extern	MR_Word	mercury__private_builtin__dummy_var;

  #else /* !MR_BOEHM_GC */

-  #ifndef MR_GNUC
+  #if !defined(MR_GNUC) && !defined(MR_CLANG)
      ** We need GNU C's `({...})' expressions.
-    ** It's not worth worrying about compilers other than GNU C for
+    ** It's not worth worrying about compilers other than GCC or clang for
      ** this obscure combination of options.
-    #error "For C compilers other than GNU C, `--high-level-code' requires `--gc boehm'"
+    #error "For C compilers other than GCC or clang, `--high-level-code' requires `--gc boehm'"


More information about the reviews mailing list