[m-dev.] diff: cfloat.m: add #ifndef guard around typedef

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Dec 20 12:23:14 AEDT 2000


I'll commit this on both the main branch and the
version-0_10_x branch.

----------

Estimated hours taken: 0.25

extras/clpr/cfloat.m:
	Add `#ifndef ... #define ... #endif' guards around the
	typedefs in `pragma c_header_code' declarations, to protect
	against multiple inclusion.  This is needed to get it to
	compile in hl* grades.

Workspace: /home/pgrad/fjh/ws/hg
Index: extras/clpr/cfloat.m
===================================================================
RCS file: /home/mercury1/repository/clpr/cfloat.m,v
retrieving revision 1.31
diff -u -d -r1.31 cfloat.m
--- extras/clpr/cfloat.m	2000/12/15 03:38:37	1.31
+++ extras/clpr/cfloat.m	2000/12/20 01:20:47
@@ -378,6 +378,8 @@
 ** Its entries store the values of the CLP(R) global variables, including
 ** the `CLPR_trtop' variable, which points to the top of the CLP(R) trail.
 */
+#ifndef ML_CFLOAT_CHOICEPOINT_GUARD
+#define ML_CFLOAT_CHOICEPOINT_GUARD
 typedef struct ML_cfloat_choicepoint {
 	int stamp;
 	int slack_id;
@@ -386,6 +388,7 @@
 	NL_EQN_ptr nl_eqn_top;
 	struct ML_cfloat_choicepoint *next;
 } ML_cfloat_choicepoint;
+#endif
 
 #define ML_cfloat_maybe_trail_solver()				\\
 	( CLPR_stamp != MR_current_choicepoint_id() ? (		\\
@@ -499,7 +502,10 @@
 
 :- pragma c_header_code("
 
+#ifndef ML_CFLOAT_SVAR_GUARD
+#define ML_CFLOAT_SVAR_GUARD
 typedef MR_Integer ML_svar;
+#endif
 
 /*
 ** The following ""functions"" are currently all implemented using macros.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- 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