[m-rev.] diff: .NET beta fixes.

Tyson Dowd trd at cs.mu.OZ.AU
Fri Jun 15 08:22:47 AEST 2001


Hi,

Here are some fixes for the latest .NET build.

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


Estimated hours taken: 6
Branches: main

Fixes required for .NET Beta 2.

aclocal.m4:
	Autodetect the C++ compiler and find the VC++ directory from it.

compiler/mlds_to_il.m:
	Put "public" annotations on the IL we generate (private is now the
	default).

library/char.m:
	Fix a use of c_header_code to be foreign_decl("C",

runtime/mercury_il.il:
	Put "public" annotations on the IL (private is now the default).

scripts/Mmake.vars.in:
	Fix the include path and command line for VC++.
	We probably shouldn't have to give this path, but at the moment
	it is required if we are going to use the latest build.


Index: aclocal.m4
===================================================================
RCS file: /home/mercury1/repository/mercury/aclocal.m4,v
retrieving revision 1.4
diff -u -r1.4 aclocal.m4
--- aclocal.m4	2001/03/15 08:08:06	1.4
+++ aclocal.m4	2001/06/14 20:28:00
@@ -87,8 +87,26 @@
 AC_MSG_RESULT($mercury_cv_microsoft_dotnet)
 ILASM=`basename "$ILASM"`
 
+AC_PATH_PROG(MS_CL, cl)
+AC_MSG_CHECKING(for Microsoft.NET Visual C++)
+AC_CACHE_VAL(mercury_cv_microsoft_visual_cpp, [
+if test "$MS_CL" != ""; then
+	changequote(<<,>>) 
+	MS_VISUALCPP_DIR=`expr "$MS_CL" : '\(.*\)[/\\]*[bB]in[/\\]*cl'`
+	changequote([,]) 
+	mercury_cv_microsoft_visual_cpp="yes"
+else
+	MS_VISUALCPP_DIR=""
+	mercury_cv_microsoft_visual_cpp="no"
+fi
+])
+AC_MSG_RESULT($mercury_cv_microsoft_visual_cpp)
+MS_CL=`basename "$MS_CL"`
+
 AC_SUBST(ILASM)
+AC_SUBST(MS_CL)
 AC_SUBST(MS_DOTNET_SDK_DIR)
+AC_SUBST(MS_VISUALCPP_DIR)
 ])
 
 #-----------------------------------------------------------------------------#
Index: compiler/mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.31
diff -u -r1.31 mlds_to_il.m
--- compiler/mlds_to_il.m	2001/06/08 10:01:00	1.31
+++ compiler/mlds_to_il.m	2001/06/14 20:28:00
@@ -371,7 +371,7 @@
 			% declarations.
 		{ ClassDecls = [
 			comment_term(MLDSDefnTerm),
-			ilasm__method(methodhead([static], id(Id), 
+			ilasm__method(methodhead([public, static], id(Id), 
 				ILSignature, []), MethodContents)
 		] },
 		il_info_add_classdecls(ClassDecls)
@@ -1764,7 +1764,7 @@
 :- mode make_class_constructor_classdecl(in, in, in, in, out, in, out) is det.
 make_class_constructor_classdecl(DoneFieldRef, Imports, AllocInstrs, 
 		InitInstrs, Method) -->
-	{ Method = method(methodhead([static], cctor, 
+	{ Method = method(methodhead([public, static], cctor, 
 		signature(call_conv(no, default), void, []), []),
 		MethodDecls) },
 	test_rtti_initialization_field(DoneFieldRef, TestInstrs),
Index: library/char.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/char.m,v
retrieving revision 1.33
diff -u -r1.33 char.m
--- library/char.m	2001/03/15 07:42:21	1.33
+++ library/char.m	2001/06/14 20:28:15
@@ -462,7 +462,7 @@
 
 char__min_char_value(0).
 
-:- pragma c_header_code("#include <limits.h>").
+:- pragma foreign_decl("C", "#include <limits.h>").
 :- pragma foreign_proc("C",
 		char__max_char_value(Max::out),
 		[will_not_call_mercury, thread_safe], "
Index: runtime/mercury_il.il
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_il.il,v
retrieving revision 1.8
diff -u -r1.8 mercury_il.il
--- runtime/mercury_il.il	2001/05/14 13:24:55	1.8
+++ runtime/mercury_il.il	2001/06/14 20:28:15
@@ -44,7 +44,7 @@
 
 .class public TempHack {
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_typeclass_info_compare() {
 	ldftn void ['mercury'] 'mercury'.'private_builtin__cpp_code'.'mercury_code'::
 	do_compare__typeclass_info_1_0(
@@ -53,7 +53,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_typeclass_info_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'private_builtin__cpp_code'.'mercury_code'::
 	do_unify__typeclass_info_1_0(
@@ -62,7 +62,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_base_typeclass_info_compare() {
 	ldftn void ['mercury'] 'mercury'.'private_builtin__cpp_code'.'mercury_code'::
 	do_compare__base_typeclass_info_1_0(
@@ -71,7 +71,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_base_typeclass_info_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'private_builtin__cpp_code'.'mercury_code'::
 	do_unify__base_typeclass_info_1_0(
@@ -80,7 +80,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_type_info_compare() {
 	ldftn void ['mercury'] 'mercury'.'private_builtin__cpp_code'.'mercury_code'::
 	do_compare__type_info_1_0(
@@ -89,7 +89,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_type_info_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'private_builtin__cpp_code'.'mercury_code'::
 	do_unify__type_info_1_0(
@@ -98,7 +98,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_type_ctor_info_compare() {
 	ldftn void ['mercury'] 'mercury'.'private_builtin__cpp_code'.'mercury_code'::
 	do_compare__type_ctor_info_1_0(
@@ -107,7 +107,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_type_ctor_info_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'private_builtin__cpp_code'.'mercury_code'::
 	do_unify__type_ctor_info_1_0(
@@ -116,7 +116,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_pred_compare() {
 	ldftn void ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_compare__pred_0_0(
@@ -125,7 +125,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_pred_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_unify__pred_0_0(
@@ -133,7 +133,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_func_compare() {
 	ldftn void ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_compare__func_0_0(
@@ -142,7 +142,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_func_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_unify__func_0_0(
@@ -150,7 +150,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_float_compare() {
 	ldftn void ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_compare__float_0_0(
@@ -158,7 +158,7 @@
 		class [mscorlib]System.Object, class [mscorlib]System.Object)
 	ret
 }
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_float_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_unify__float_0_0(
@@ -166,7 +166,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_void_compare() {
 	ldftn void ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_compare__void_0_0(
@@ -174,7 +174,7 @@
 		class [mscorlib]System.Object, class [mscorlib]System.Object)
 	ret
 }
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_void_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_unify__void_0_0(
@@ -182,7 +182,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_c_pointer_compare() {
 	ldftn void ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_compare__c_pointer_0_0(
@@ -191,7 +191,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_c_pointer_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_unify__c_pointer_0_0(
@@ -199,7 +199,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_string_compare() {
 	ldftn void ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_compare__string_0_0(
@@ -208,7 +208,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_string_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_unify__string_0_0(
@@ -216,7 +216,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_character_compare() {
 	ldftn void ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_compare__character_0_0(
@@ -225,7 +225,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_character_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_unify__character_0_0(
@@ -233,7 +233,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_int_compare() {
 	ldftn void ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_compare__int_0_0(
@@ -242,7 +242,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_int_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'builtin__cpp_code'.'mercury_code'::
 	do_unify__int_0_0(
@@ -250,7 +250,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_array_compare() {
 	ldftn void ['mercury'] 'mercury'.'array__cpp_code'.'mercury_code'::
 	do_compare__array_1_0(
@@ -259,7 +259,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_array_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'array__cpp_code'.'mercury_code'::
 	do_unify__array_1_0(
@@ -268,7 +268,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_type_desc_compare() {
 	ldftn void ['mercury'] 'mercury'.'std_util__cpp_code'.'mercury_code'::
 	do_compare__type_desc_0_0(
@@ -277,7 +277,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_type_desc_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'std_util__cpp_code'.'mercury_code'::
 	do_unify__type_desc_0_0(
@@ -285,7 +285,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_univ_compare() {
 	ldftn void ['mercury'] 'mercury'.'std_util__cpp_code'.'mercury_code'::
 	do_compare__univ_0_0(
@@ -294,7 +294,7 @@
 	ret
 }
 
-.method static default int32 
+.method public static default int32 
 get_ftn_ptr_univ_unify() {
 	ldftn int32 ['mercury'] 'mercury'.'std_util__cpp_code'.'mercury_code'::
 	do_unify__univ_0_0(
@@ -311,21 +311,21 @@
 .class public ConvertImpl {
 
 
-.method static default class [mscorlib]System.Object ToObject(int32 ival)
+.method public static default class [mscorlib]System.Object ToObject(int32 ival)
 {
 	ldarg ival
 	box ['mscorlib']System.Int32
 	ret
 }
 
-.method static default class [mscorlib]System.Object ToObject(float64 fval)
+.method public static default class [mscorlib]System.Object ToObject(float64 fval)
 {
 	ldarg fval
 	box ['mscorlib']System.Float64
 	ret
 }
 
-.method static default int32 ToInt32(class [mscorlib]System.Object obj)
+.method public static default int32 ToInt32(class [mscorlib]System.Object obj)
 {
 	ldarg obj
 	unbox int32
@@ -333,7 +333,7 @@
 	ret
 }
 
-.method static default float64 ToFloat64(class [mscorlib]System.Object obj)
+.method public static default float64 ToFloat64(class [mscorlib]System.Object obj)
 {
 	ldarg obj
 	unbox float64
@@ -352,7 +352,7 @@
 
 .class public GenericCall {
 
-.method static default  int32 semidet_call_3(class [mscorlib]System.Object 'procedure', 
+.method public static default  int32 semidet_call_3(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'X', class [mscorlib]System.Object 'Y') 
 {
 	ldarg 'X'
@@ -364,7 +364,7 @@
 }
 
 
-.method static default  int32 semidet_call_4(class [mscorlib]System.Object 'procedure', 
+.method public static default  int32 semidet_call_4(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', class [mscorlib]System.Object 'X',
 	class [mscorlib]System.Object 'Y') 
 {
@@ -377,7 +377,7 @@
 	ret
 }
 
-.method static default  int32 semidet_call_5(class [mscorlib]System.Object 'procedure', 
+.method public static default  int32 semidet_call_5(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', class [mscorlib]System.Object 'T2',
 	class [mscorlib]System.Object 'X', class [mscorlib]System.Object 'Y')
 {
@@ -391,7 +391,7 @@
 	ret
 }
 
-.method static default  int32 semidet_call_6(class [mscorlib]System.Object 'procedure', 
+.method public static default  int32 semidet_call_6(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', class [mscorlib]System.Object 'T2',
 	class [mscorlib]System.Object 'T3', class [mscorlib]System.Object 'X',
 	class [mscorlib]System.Object 'Y')
@@ -407,7 +407,7 @@
 	ret
 }
 
-.method static default  int32 semidet_call_7(class [mscorlib]System.Object 'procedure', 
+.method public static default  int32 semidet_call_7(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', class [mscorlib]System.Object 'T2',
 	class [mscorlib]System.Object 'T3', class [mscorlib]System.Object 'T4',
 	class [mscorlib]System.Object 'X', class [mscorlib]System.Object 'Y')
@@ -425,7 +425,7 @@
 }
 
 
-.method static default  int32 semidet_call_8(class [mscorlib]System.Object 'procedure', 
+.method public static default  int32 semidet_call_8(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', class [mscorlib]System.Object 'T2',
 	class [mscorlib]System.Object 'T3', class [mscorlib]System.Object 'T4',
 	class [mscorlib]System.Object 'T5', class [mscorlib]System.Object 'X',
@@ -448,7 +448,7 @@
 	// procedures that have two real parameters, and a variable number of
 	// type parameters.
 
-.method static default  void result_call_4(class [mscorlib]System.Object 'procedure', 
+.method public static default  void result_call_4(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object[]& 'result', class [mscorlib]System.Object 'X', 
 	class [mscorlib]System.Object 'Y') 
 {
@@ -461,7 +461,7 @@
 	ret
 }
 
-.method static default  void result_call_5(class [mscorlib]System.Object 'procedure', 
+.method public static default  void result_call_5(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', 
 	class [mscorlib]System.Object[]& 'result', 
 	class [mscorlib]System.Object 'X', class [mscorlib]System.Object 'Y') 
@@ -477,7 +477,7 @@
 	ret
 }
 
-.method static default  void result_call_6(class [mscorlib]System.Object 'procedure', 
+.method public static default  void result_call_6(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', class [mscorlib]System.Object 'T2',
 	class [mscorlib]System.Object[]& 'result', 
 	class [mscorlib]System.Object 'X', 
@@ -496,7 +496,7 @@
 	ret
 }
 
-.method static default  void result_call_7(class [mscorlib]System.Object 'procedure', 
+.method public static default  void result_call_7(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', 
 	class [mscorlib]System.Object 'T2', class [mscorlib]System.Object 'T3', 
 	class [mscorlib]System.Object[]& 'result', 
@@ -516,7 +516,7 @@
 	ret
 }
 
-.method static default  void result_call_8(class [mscorlib]System.Object 'procedure', 
+.method public static default  void result_call_8(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', class [mscorlib]System.Object 'T2',
 	class [mscorlib]System.Object 'T3', class [mscorlib]System.Object 'T4',
 	class [mscorlib]System.Object[]& 'result', 
@@ -538,7 +538,7 @@
 	ret
 }
 
-.method static default  void result_call_9(class [mscorlib]System.Object 'procedure', 
+.method public static default  void result_call_9(class [mscorlib]System.Object 'procedure', 
 	class [mscorlib]System.Object 'T1', 
 	class [mscorlib]System.Object 'T2', class [mscorlib]System.Object 'T3', 
 	class [mscorlib]System.Object 'T4', class [mscorlib]System.Object 'T5', 
@@ -570,7 +570,7 @@
 // yet be available in a .DLL.
 
 .class public 'Init' {
-    .method static default void init_runtime() {
+    .method public static default void init_runtime() {
         call void ['mercury']mercury.io.mercury_code::init_state_2()
 	ret
     }
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.43
diff -u -r1.43 Mmake.vars.in
--- scripts/Mmake.vars.in	2001/05/19 13:53:06	1.43
+++ scripts/Mmake.vars.in	2001/06/14 20:28:00
@@ -142,12 +142,14 @@
 
 # MS_CL is the command line version of Microsoft Visual C++, which we
 # use to compile Managed C++ code in the .NET backend.
-MS_CL		= cl
+MS_CL		= @MS_CL@
+MS_VISUALCPP_DIR = @MS_VISUALCPP_DIR@
 ALL_MS_CLFLAGS	= $(MS_CLFLAGS) $(EXTRA_MS_CLFLAGS) $(TARGET_MS_CLFLAGS) \
 		$(LIB_MS_CLFLAGS)
 MS_CLFLAGS	=
 EXTRA_MS_CLFLAGS =
-LIB_MS_CLFLAGS	= $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS))
+MS_VC7_INCLUDES = -I`cygpath -w $(MS_VISUALCPP_DIR)/include`
+LIB_MS_CLFLAGS	= $(MS_VC7_INCLUDES) $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS))
 
 # MS_CL_NOASM can be used to turn off assembly generation.  Use
 # MS_CL_NOASM=:noAssembly to turn it off, leave it blank to turn it on.


-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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