[m-rev.] diff: fix stdlib compilation in erlang grade

Julien Fischer jfischer at opturion.com
Wed Jul 16 17:47:47 AEST 2014


Fix standard library compilation in erlang grade.

library/thread.m:
 	Workaround a problem that was preventing this module from compiling
 	successfully in the erlang grade.

Julien.

diff --git a/library/thread.m b/library/thread.m
index 4e3739b..c6052e4 100644
--- a/library/thread.m
+++ b/library/thread.m
@@ -219,6 +219,16 @@ spawn_context(Goal, Res, !IO) :-
  spawn_context_2(_, no, "", !IO) :-
      cc_multi_equal(!IO).

+% XXX the Mercury clause above currently gets compiled into invalid Erlang code. 
+:- pragma foreign_proc("Erlang",
+    spawn_context_2(_Goal::(pred(in, di, uo) is cc_multi), Success::out,
+        ThreadId::out, _IO0::di, _IO::uo),
+    [promise_pure, will_not_call_mercury, thread_safe],
+"
+    Success = {no},
+    ThreadId = <<>>
+").
+
  :- pragma foreign_proc("C",
      spawn_context_2(Goal::(pred(in, di, uo) is cc_multi), Success::out,
          ThreadId::out, _IO0::di, _IO::uo),



More information about the reviews mailing list