Index: RTBuiltin.c =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/runtime/common/RTBuiltin.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 RTBuiltin.c --- RTBuiltin.c 24 Jan 2001 12:24:26 -0000 1.1.1.1 +++ RTBuiltin.c 20 May 2010 14:31:35 -0000 @@ -7,12 +7,20 @@ /*----------- types from RT0, for now ... -----------------*/ +/* _INTEGER is always signed and exactly the same size as a pointer */ +#if __INITIAL_POINTER_SIZE == 64 || defined(_WIN64) +/* VMS with 64 bit pointers but 32bit size_t/ptrdiff_t, or Win64. */ +typedef __int64 _INTEGER; +#else +typedef long _INTEGER; +#endif + #define _INTEGER long -#define _INT32 int #define _ADDRESS char* typedef void (*_PROC)(); -#define WSZ sizeof(_ADDRESS) +/* word size */ +#define WSZ sizeof(_ADDRESS) typedef struct _typecell { _INTEGER typecode; Index: RTIOc.c =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/runtime/common/RTIOc.c,v retrieving revision 1.12 diff -u -r1.12 RTIOc.c --- RTIOc.c 7 Feb 2010 12:55:29 -0000 1.12 +++ RTIOc.c 20 May 2010 14:31:35 -0000 @@ -2,6 +2,7 @@ #undef _DLL #endif +#include "m3core.h" #include #include @@ -58,11 +59,11 @@ fflush(NULL); } -void __cdecl PutBytes(const unsigned char* p, size_t count) +void __cdecl PutBytes(const unsigned char* p, WORD_T count) { char buffer[33]; /* size must be odd */ const static char hex[] = "0123456789ABCDEF"; - size_t i = { 0 }; + WORD_T i = { 0 }; size_t j = { 0 }; Flush(); Index: RTMiscC.c =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/runtime/common/RTMiscC.c,v retrieving revision 1.5 diff -u -r1.5 RTMiscC.c --- RTMiscC.c 16 Jan 2010 20:26:32 -0000 1.5 +++ RTMiscC.c 20 May 2010 14:31:35 -0000 @@ -6,6 +6,7 @@ #undef _DLL #endif +#include "m3core.h" #include #ifdef __cplusplus @@ -18,12 +19,12 @@ /*------------------------------- byte copying ------------------------------*/ -void __cdecl RTMisc__Copy(const void* src, void* dest, size_t len) +void __cdecl RTMisc__Copy(const void* src, void* dest, WORD_T len) { memmove(dest, src, len); } -void __cdecl RTMisc__Zero(void* dest, size_t len) +void __cdecl RTMisc__Zero(void* dest, WORD_T len) { memset(dest, 0, len); } @@ -32,11 +33,11 @@ /* Align is equated to Upper via <*EXTERNAL*>; this is here for compatiblity. */ -size_t __cdecl RTMisc__Upper(size_t a, size_t y); +WORD_T __cdecl RTMisc__Upper(WORD_T a, WORD_T y); -void* __cdecl RTMisc__Align(void* a, size_t y) +void* __cdecl RTMisc__Align(void* a, WORD_T y) { - return (void*)RTMisc__Upper((size_t)a, y); + return (void*)RTMisc__Upper((WORD_T)a, y); } #ifdef __cplusplus Index: RTUntracedMemoryC.c =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/runtime/common/RTUntracedMemoryC.c,v retrieving revision 1.8 diff -u -r1.8 RTUntracedMemoryC.c --- RTUntracedMemoryC.c 16 Jan 2010 20:29:57 -0000 1.8 +++ RTUntracedMemoryC.c 20 May 2010 14:31:35 -0000 @@ -9,6 +9,7 @@ #undef _DLL #endif +#include "m3core.h" #include #ifdef _MSC_VER @@ -48,17 +49,17 @@ extern "C" { #endif -void* __cdecl RTUntracedMemory__AllocZ PROTO1(size_t, count) +void* __cdecl RTUntracedMemory__AllocZ PROTO1(WORD_T, count) /* Z = zeroed = calloc */ { return WIN(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count)) POSIX(calloc(count, 1)); } -void* __cdecl RTUntracedMemory__AllocZV PROTO2(size_t, count, size_t, size) +void* __cdecl RTUntracedMemory__AllocZV PROTO2(WORD_T, count, WORD_T, size) /* ZV = zeroed vector = calloc */ { - size_t max = ~(size_t)0; + WORD_T max = ~(WORD_T)0; if (count > 1 && size > 1 && count > (max / size)) /* implies count * size > max */ return 0; return WIN(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * size))