diff --git a/src/runtime/c/pgf/db.cxx b/src/runtime/c/pgf/db.cxx index 1ea4d5e31..efd2347dd 100644 --- a/src/runtime/c/pgf/db.cxx +++ b/src/runtime/c/pgf/db.cxx @@ -1,11 +1,29 @@ #include #include + +#ifndef _WIN32 #include #include #include #include #include +#else + +#include +#include + +static +size_t getpagesize() +{ + SYSTEM_INFO si; + GetSystemInfo(&si); + return si.dwPageSize; +} + +#define ftruncate _chsize +#endif + #include "data.h" #include "ipc.h" diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index b4f02aaf7..9bb0c0e06 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -118,6 +118,7 @@ typedef struct { /* Arbitrary size integers are represented as an array of uintmax_t * values. Each value in the array is at most LINT_BASE-1 big. * LINT_BASE itself is always 10 ^ LINT_BASE_LOG. */ +#if defined(__WORDSIZE) #if __WORDSIZE == 8 #define LINT_BASE 100 #define LINT_BASE_LOG 2 @@ -133,6 +134,15 @@ typedef struct { #else #error "Platforms with the current __WORDSIZE are not supported yet" #endif +#elif defined(_WIN64) +#define LINT_BASE 10000000000000000000UL +#define LINT_BASE_LOG 19 +#elif defined(_WIN32) +#define LINT_BASE 1000000000 +#define LINT_BASE_LOG 9 +#else +#error "Unsupported platform" +#endif /* The PgfUnmarshaller structure tells the runtime how to create * abstract syntax expressions and types in the heap of