forked from GitHub/gf-core
first steps towards porting to Windows
This commit is contained in:
@@ -1,11 +1,29 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <io.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
static
|
||||||
|
size_t getpagesize()
|
||||||
|
{
|
||||||
|
SYSTEM_INFO si;
|
||||||
|
GetSystemInfo(&si);
|
||||||
|
return si.dwPageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ftruncate _chsize
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "ipc.h"
|
#include "ipc.h"
|
||||||
|
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ typedef struct {
|
|||||||
/* Arbitrary size integers are represented as an array of uintmax_t
|
/* Arbitrary size integers are represented as an array of uintmax_t
|
||||||
* values. Each value in the array is at most LINT_BASE-1 big.
|
* values. Each value in the array is at most LINT_BASE-1 big.
|
||||||
* LINT_BASE itself is always 10 ^ LINT_BASE_LOG. */
|
* LINT_BASE itself is always 10 ^ LINT_BASE_LOG. */
|
||||||
|
#if defined(__WORDSIZE)
|
||||||
#if __WORDSIZE == 8
|
#if __WORDSIZE == 8
|
||||||
#define LINT_BASE 100
|
#define LINT_BASE 100
|
||||||
#define LINT_BASE_LOG 2
|
#define LINT_BASE_LOG 2
|
||||||
@@ -133,6 +134,15 @@ typedef struct {
|
|||||||
#else
|
#else
|
||||||
#error "Platforms with the current __WORDSIZE are not supported yet"
|
#error "Platforms with the current __WORDSIZE are not supported yet"
|
||||||
#endif
|
#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
|
/* The PgfUnmarshaller structure tells the runtime how to create
|
||||||
* abstract syntax expressions and types in the heap of
|
* abstract syntax expressions and types in the heap of
|
||||||
|
|||||||
Reference in New Issue
Block a user