[m-dev.] diff: include grade in init files

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Sep 23 21:22:48 AEST 1999


Estimated hours taken: 0.5

util/mkinit.c:
	Ensure that we include a reference to the grade variable,
	so that we will catch attempts to link files compiled in different
	grades.

runtime/mercury_grade.h:
	Include mercury_tags.h, since this file uses the TAGBITS macro.

Workspace: /home/mercury0/fjh/mercury
Index: runtime/mercury_grade.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_grade.h,v
retrieving revision 1.20
diff -u -r1.20 mercury_grade.h
--- mercury_grade.h	1999/06/01 09:46:03	1.20
+++ mercury_grade.h	1999/09/23 11:14:45
@@ -25,6 +25,8 @@
 #ifndef MERCURY_GRADES_H
 #define MERCURY_GRADES_H
 
+#include "mercury_tags.h" /* for TAGBITS */
+
 /* convert a macro to a string */
 #define MR_STRINGIFY(x)		MR_STRINGIFY_2(x)
 #define MR_STRINGIFY_2(x)	#x
Index: util/mkinit.c
===================================================================
RCS file: /home/mercury1/repository/mercury/util/mkinit.c,v
retrieving revision 1.53
diff -u -r1.53 mkinit.c
--- mkinit.c	1999/07/26 02:52:46	1.53
+++ mkinit.c	1999/09/23 11:17:29
@@ -82,6 +82,7 @@
 	"\n"
 	"#include <stddef.h>\n"
 	"#include \"mercury_init.h\"\n"
+	"#include \"mercury_grade.h\"\n"
 	"\n"
 	"/*\n"
 	"** Work around a bug in the Solaris 2.X (X<=4) linker;\n"
@@ -217,6 +218,9 @@
 	"	mercury_call_main();\n"
 	"	return mercury_terminate();\n"
 	"}\n"
+	"\n"
+	"/* ensure that everything gets compiled in the same grade */\n"
+	"static const void *const MR_grade = &MR_GRADE_VAR;\n"
 	;
 
 static const char main_func[] =

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list