[m-dev.] diff: fix bug in error/1

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jul 13 02:28:02 AEST 1998


On 13-Jul-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Fix a bug that broke error/1 in grades `jump.*' and `fast.*'.
> 
> library/require.m:
> 	Rename the C module `require_module_internal' as
> 	`require_internal_module', to be consistent with the names
> 	used for other C modules defined in the Mercury library.
> 	Add code to ensure that the initialization function
> 	for this module gets run.

Sorry, I was a bit quick off the mark with the diff for that one --
there were a couple of syntax errors in that one. 
Here's the correct diff.

Index: library/require.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/require.m,v
retrieving revision 1.22
diff -u -r1.22 require.m
--- require.m	1998/05/28 11:13:59	1.22
+++ require.m	1998/07/12 16:24:22
@@ -1,8 +1,8 @@
-%---------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 % Copyright (C) 1993-1998 The University of Melbourne.
 % This file may only be copied under the terms of the GNU Library General
 % Public License - see the file COPYING.LIB in the Mercury distribution.
-%---------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- module require.
 
@@ -75,7 +75,7 @@
 
 MR_MAKE_STACK_LAYOUT_ENTRY(mercury__require__error_internal_1_0);
 
-BEGIN_MODULE(require_module_internal)
+BEGIN_MODULE(require_internal_module)
         init_entry(mercury__require__error_internal_1_0);
 BEGIN_CODE
 
@@ -92,8 +92,20 @@
 	exit(1);
 }
 END_MODULE
+
+/*
+** Ensure that the initialization function for the above module gets run.
+*/
+/*
+INIT sys_init_require_internal_module
+*/
+extern ModuleFunc require_internal_module;
+void sys_init_require_internal_module(void);
+void sys_init_require_internal_module(void) {
+	require_internal_module();
+}
 ").
 
 :- end_module require.
 
-/*---------------------------------------------------------------------------*/
+%-----------------------------------------------------------------------------%

-- 
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.



More information about the developers mailing list