[m-rev.] for review: build Mercury using MSVC 6
Peter Ross
pro at missioncriticalit.com
Sat Feb 17 22:52:56 AEDT 2007
Hi,
===================================================================
Build Mercury using MSVC 6.
boehm_gc/NT_MAKEFILE:
msvc_dbg.c is in the include\private directory.
boehm_gc/msvc_dbg.c:
Define ULONG_PTR as an int.
compiler/prog_event.m:
ssize_t isn't defined under windows.
library/par_builtin.m:
The CL compiler doesn't accept empty structs.
robdd/Makefile:
-Wall isn't a valid option to CL.
runtime/mercury_mm_own_stacks.c:
runtime/mercury_term_size.c:
Conditionally import unistd.h
runtime/mercury_trace_base.c:
Use the correct version of snprintf.
Fix the MR_FILE_EXISTS macro to work under win32.
Index: boehm_gc/NT_MAKEFILE
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/NT_MAKEFILE,v
retrieving revision 1.15
diff -u -r1.15 NT_MAKEFILE
--- boehm_gc/NT_MAKEFILE 15 Aug 2006 04:19:22 -0000 1.15
+++ boehm_gc/NT_MAKEFILE 17 Feb 2007 11:42:24 -0000
@@ -16,7 +16,7 @@
.cpp.obj:
$(cc) $(cdebug) $(cflags) $(cvars) -Iinclude -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_BUILD $*.CPP /Fo$*.obj
-$(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\msvc_dbg.h
+$(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\private\msvc_dbg.h
gc.lib: $(OBJS)
lib /MACHINE:i386 /out:gc.lib $(OBJS)
Index: boehm_gc/msvc_dbg.c
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/msvc_dbg.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 msvc_dbg.c
--- boehm_gc/msvc_dbg.c 14 Aug 2006 03:14:20 -0000 1.1.1.1
+++ boehm_gc/msvc_dbg.c 17 Feb 2007 11:42:24 -0000
@@ -34,6 +34,8 @@
#ifdef _WIN64
typedef ULONG_PTR ULONG_ADDR;
#else
+ /* the following line is needed for MSVC 6 */
+ typedef int ULONG_PTR;
typedef ULONG ULONG_ADDR;
#endif
Index: compiler/prog_event.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_event.m,v
retrieving revision 1.8
diff -u -r1.8 prog_event.m
--- compiler/prog_event.m 12 Jan 2007 05:49:14 -0000 1.8
+++ compiler/prog_event.m 17 Feb 2007 11:42:26 -0000
@@ -203,7 +203,7 @@
SpecsFileName);
MR_make_aligned_string_copy(Problem, buf);
} else {
- ssize_t num_bytes_read;
+ size_t num_bytes_read;
num_bytes_read = read(spec_fd, spec_buf, stat_buf.st_size);
if (num_bytes_read != stat_buf.st_size) {
Index: library/par_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/par_builtin.m,v
retrieving revision 1.9
diff -u -r1.9 par_builtin.m
--- library/par_builtin.m 6 Feb 2007 06:47:35 -0000 1.9
+++ library/par_builtin.m 17 Feb 2007 11:42:27 -0000
@@ -82,6 +82,7 @@
};
#else /* !MR_THREAD_SAFE */
struct MR_Future {
+ int x;
};
#endif /* !MR_THREAD_SAFE */
").
Index: robdd/Makefile
===================================================================
RCS file: /home/mercury1/repository/mercury/robdd/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- robdd/Makefile 15 Dec 2004 06:57:44 -0000 1.2
+++ robdd/Makefile 17 Feb 2007 11:42:28 -0000
@@ -38,7 +38,7 @@
# Unix options
LINKSW=-o
DEF=-D
-MSGS=-Wall
+MSGS=
RM=rm -f
MV=mv
MKDIR=mkdir
Index: runtime/mercury_mm_own_stacks.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_mm_own_stacks.c,v
retrieving revision 1.9
diff -u -r1.9 mercury_mm_own_stacks.c
--- runtime/mercury_mm_own_stacks.c 3 Jan 2007 05:17:17 -0000 1.9
+++ runtime/mercury_mm_own_stacks.c 17 Feb 2007 11:42:33 -0000
@@ -19,7 +19,9 @@
#include "mercury_dlist.h"
#include <stdio.h>
-#include <unistd.h> /* for sleep() */
+#ifdef MR_HAVE_UNISTD_H
+ #include <unistd.h> /* for sleep() */
+#endif
#ifdef MR_MINIMAL_MODEL_DEBUG
/*
Index: runtime/mercury_term_size.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_term_size.c,v
retrieving revision 1.5
diff -u -r1.5 mercury_term_size.c
--- runtime/mercury_term_size.c 13 Feb 2007 01:58:59 -0000 1.5
+++ runtime/mercury_term_size.c 17 Feb 2007 11:42:33 -0000
@@ -18,7 +18,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
-#include <unistd.h>
+#ifdef MR_HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#include <string.h>
#ifdef MR_RECORD_TERM_SIZES
Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.80
diff -u -r1.80 mercury_trace_base.c
--- runtime/mercury_trace_base.c 3 Jan 2007 05:17:17 -0000 1.80
+++ runtime/mercury_trace_base.c 17 Feb 2007 11:42:34 -0000
@@ -43,6 +43,10 @@
#include <sys/wait.h> /* for the wait system call */
#endif
+#if defined(MR_HAVE__SNPRINTF) && ! defined(MR_HAVE_SNPRINTF)
+ #define snprintf _snprintf
+#endif
+
#define MR_TRACE_COUNT_SUMMARY_MAX_DEFAULT 20
void (*MR_trace_shutdown)(void) = NULL;
@@ -274,7 +278,15 @@
#define MERCURY_TRACE_COUNTS_PREFIX "mercury_trace_counts"
#define TEMP_SUFFIX ".tmp"
-#define MR_FILE_EXISTS(filename) (access(filename, F_OK) == 0)
+#if defined(F_OK)
+ /* unistd.h version */
+ #define MR_PERMISSIONS F_OK
+#else
+ /* win32 version */
+ #define MR_PERMISSIONS 0
+#endif
+
+#define MR_FILE_EXISTS(filename) (access(filename, MR_PERMISSIONS) == 0)
void
MR_trace_record_label_exec_counts(void *dummy)
--
Software Engineer (Work) +32 2 757 10 15
Mission Critical (Mobile) +32 485 482 559
--------------------------------------------------------------------------
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