[m-rev.] trivial diff: fix stand-alone interfaces in low-level C grades
Julien Fischer
juliensf at csse.unimelb.edu.au
Tue Feb 13 17:29:42 AEDT 2007
Estimated hours taken: 1
Branches: main
Fix stand-alone interfaces in low-level C grades.
runtime/mercury_wrapper.c:
Reposition the definition of MR_dummy_main in order to avoid
the need for forward references.
Add dummy_main_module() to mrcury_sys_init_wrapper_init.
Julien.
Index: mercury_wrapper.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.179
diff -u -r1.179 mercury_wrapper.c
--- mercury_wrapper.c 9 Feb 2007 04:05:17 -0000 1.179
+++ mercury_wrapper.c 13 Feb 2007 06:20:35 -0000
@@ -2484,6 +2484,31 @@
/*---------------------------------------------------------------------------*/
+#ifdef MR_HIGHLEVEL_CODE
+
+void
+MR_dummy_main(void)
+{
+ MR_fatal_error("invalid attempt to call through Mercury entry point.");
+}
+
+#else /* ! MR_HIGHLEVEL_CODE */
+
+MR_define_extern_entry(MR_dummy_main);
+
+MR_BEGIN_MODULE(dummy_main_module)
+ MR_init_entry_an(MR_dummy_main);
+MR_BEGIN_CODE
+
+MR_define_entry(MR_dummy_main);
+ MR_fatal_error("invalid attempt to call through Mercury entry point.");
+
+MR_END_MODULE
+
+#endif /* ! MR_HIGHLEVEL_CODE */
+
+/*---------------------------------------------------------------------------*/
+
int
mercury_runtime_terminate(void)
{
@@ -2616,6 +2641,7 @@
{
#ifndef MR_HIGHLEVEL_CODE
interpreter_module();
+ dummy_main_module();
#endif
}
@@ -2632,28 +2658,3 @@
/* no proc_statics to write out */
}
#endif
-
-/*---------------------------------------------------------------------------*/
-
-#ifndef MR_HIGHLEVEL_CODE
-
-MR_define_extern_entry(MR_dummy_main);
-
-MR_BEGIN_MODULE(dummy_main_module)
- MR_init_entry_an(MR_dummy_main);
-MR_BEGIN_CODE
-
-MR_define_entry(MR_dummy_main);
- MR_fatal_error("invalid attempt to call through Mercury entry point.");
-
-MR_END_MODULE
-
-#else /* MR_HIGHLEVEL_CODE */
-
-void
-MR_dummy_main(void)
-{
- MR_fatal_error("invalid attempt to call through Mercury entry point.");
-}
-
-#endif /* MR_HIGHLEVEL_CODE */
--------------------------------------------------------------------------
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