[m-rev.] diff: fix runtime compilation error with Visual C

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Jul 13 10:03:07 AEST 2011


Branches: main, 11.07

Fix a runtime compilation error with Visual C.

runtime/mercury_memory_zones.c:
 	Don't interleave variable declarations and code.
 	(Doing so works in GNU C or C99, but not VC9.)

Julien.

Index: runtime/mercury_memory_zones.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_memory_zones.c,v
retrieving revision 1.39
diff -u -r1.39 mercury_memory_zones.c
--- runtime/mercury_memory_zones.c	20 May 2011 04:16:55 -0000	1.39
+++ runtime/mercury_memory_zones.c	12 Jul 2011 23:59:06 -0000
@@ -1226,9 +1226,12 @@
  MR_gc_zones(void)
  {
      do {
-        MR_LOCK(&memory_zones_lock, "MR_gc_zones");
+
          MR_MemoryZonesFree  *cur_list;
-        MR_Unsigned         oldest_lru_token, cur_lru_token;
+        MR_Unsigned         oldest_lru_token;
+        MR_Unsigned         cur_lru_token;
+ 
+        MR_LOCK(&memory_zones_lock, "MR_gc_zones");

          if (NULL == lru_free_memory_zones) {
              /*

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