[m-rev.] diff: Fix a problem with semaphores in the IL backend

Jonathan Morgan jonmmorgan at gmail.com
Wed Jun 13 16:35:36 AEST 2007


Note that, as with the previous change to threading, this change only
ensures that the module compiles.  I haven't tested whether the module
does the right thing under the IL backend.

Jon

=============================================================
Estimated hours taken: 0.5
Branches: main

Fixed a problem with the semaphore module that prevented the library from
linking under the IL backend.

library/thread.semaphore.m:
	Altered the IL foreign type definition for a semaphore to refer to the
	`mercury' assembly rather than `semaphore__csharp_code' (which is
	not correct for the standard library).  This compiled, but caused
	linker errors due to the undefined assembly that was referenced.

Index: library/thread.semaphore.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/thread.semaphore.m,v
retrieving revision 1.7
diff -u -r1.7 thread.semaphore.m
--- library/thread.semaphore.m	30 May 2007 08:16:09 -0000	1.7
+++ library/thread.semaphore.m	13 Jun 2007 06:25:42 -0000
@@ -80,15 +80,15 @@
     } ML_Semaphore;
 ").

-:- pragma foreign_decl("C#", "
+:- pragma foreign_code("C#", "
 public class ML_Semaphore {
     public int count;
-}
+};
 ").

 :- pragma foreign_type("C",  semaphore, "ML_Semaphore *").
 :- pragma foreign_type("IL", semaphore,
-        "class [semaphore__csharp_code]ML_Semaphore").
+    "class [mercury]mercury.thread.semaphore__csharp_code.mercury_code.ML_Semaphore").
 :- pragma foreign_type("Erlang", semaphore, "").

 :- pragma foreign_decl("C", "
--------------------------------------------------------------------------
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