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.
This commit is contained in:
Peter Ross
2007-02-18 08:01:56 +00:00
parent 695f63096b
commit 56d36b014a
8 changed files with 26 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ all: gctest.exe cord\de.exe test_cpp.exe
.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)

View File

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

View File

@@ -203,7 +203,7 @@ read_event_set(SpecsFileName, EventSetName, EventSpecMap, ErrorSpecs, !IO) :-
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) {

View File

@@ -82,6 +82,7 @@
};
#else /* !MR_THREAD_SAFE */
struct MR_Future {
char dummy; /* ANSI C doesn't allow empty structs */
};
#endif /* !MR_THREAD_SAFE */
").

View File

@@ -1,5 +1,5 @@
#-----------------------------------------------------------------------------#
# Copyright (C) 2001-2004 University of Melbourne.
# Copyright (C) 2001-2004,2007 University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public Licence - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
@@ -38,7 +38,7 @@ GENFILES=$(COMMONOS) $(TESTOS)
# Unix options
LINKSW=-o
DEF=-D
MSGS=-Wall
MSGS=
RM=rm -f
MV=mv
MKDIR=mkdir

View File

@@ -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
/*

View File

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

View File

@@ -43,6 +43,10 @@ ENDINIT
#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 @@ MR_PathPort MR_named_count_port[MR_PORT_NONE + 1];
#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)