[m-rev.] [dotnet-foreign] diff: handle system libraries

Peter Ross petdr at miscrit.be
Tue May 8 21:03:05 AEST 2001


Hi,


===================================================================


Estimated hours taken: 0.5
Branches: dotnet-foreign

compiler/mlds_to_il.m:
    Place a public key token and a hash on all the MS system libraries.


Index: mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.15.4.12
diff -u -r1.15.4.12 mlds_to_il.m
--- mlds_to_il.m	2001/05/03 17:26:47	1.15.4.12
+++ mlds_to_il.m	2001/05/08 10:57:52
@@ -2602,11 +2602,32 @@
 :- mode mlds_to_il__generate_extern_assembly(in, out) is det.
 
 mlds_to_il__generate_extern_assembly(Imports, AllDecls) :-
+	SystemAssemblyDecl = [
+			version(1, 0, 2411, 0),
+			public_key_token([
+				int8(0xb7), int8(0x7a), int8(0x5c), int8(0x56),
+				int8(0x19), int8(0x34), int8(0xE0), int8(0x89)
+			]),
+			hash([
+				int8(0xb0), int8(0x73), int8(0xf2), int8(0x4c),
+				int8(0x14), int8(0x39), int8(0x0a), int8(0x35),
+				int8(0x25), int8(0xea), int8(0x45), int8(0x0f),
+				int8(0x60), int8(0x58), int8(0xc3), int8(0x84),
+				int8(0xe0), int8(0x3b), int8(0xe0), int8(0x95)
+			])],
 	Gen = (pred(Import::in, Decl::out) is semidet :-
 		ClassName = mlds_module_name_to_class_name(Import ^ name),
 		ClassName = structured_name(Assembly, _),
 		not (Assembly = "mercury"),
-		Decl = extern_assembly(Assembly, [])
+		(
+			Import ^ mercury = no,
+			string__append("System", _, Assembly)
+		->
+			AssemblyDecl = SystemAssemblyDecl
+		;
+			AssemblyDecl = []
+		),
+		Decl = extern_assembly(Assembly, AssemblyDecl)
 	),
 	list__filter_map(Gen, Imports, Decls0),
 	list__sort_and_remove_dups(Decls0, Decls),
@@ -2618,20 +2639,7 @@
 				int8(0x12), int8(0xAA), int8(0x0B), int8(0x0B)
 			])
 		]),
-		extern_assembly("mscorlib", [
-			version(1, 0, 2411, 0),
-			public_key_token([
-				int8(0xb7), int8(0x7a), int8(0x5c), int8(0x56),
-				int8(0x19), int8(0x34), int8(0xE0), int8(0x89)
-			]),
-			hash([
-				int8(0xb0), int8(0x73), int8(0xf2), int8(0x4c),
-				int8(0x14), int8(0x39), int8(0x0a), int8(0x35),
-				int8(0x25), int8(0xea), int8(0x45), int8(0x0f),
-				int8(0x60), int8(0x58), int8(0xc3), int8(0x84),
-				int8(0xe0), int8(0x3b), int8(0xe0), int8(0x95)
-			])
-		]) | Decls].
+		extern_assembly("mscorlib", SystemAssemblyDecl) | Decls].
 
 %-----------------------------------------------------------------------------
 

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list