Some Windows integration
This commit is contained in:
parent
9d67aa3189
commit
71e2e4b695
@ -1,16 +1,21 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <sys/time.h>
|
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
|
#include <Windows.h>
|
||||||
|
#else
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
#define _DEBUG 0
|
#define _DEBUG 0
|
||||||
@ -98,13 +103,22 @@ FOR_N(_i, 0, ((set)->arr.capacity + 63) / 64) FOR_BIT(it, _i*64, (set)->arr.poin
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
fn
|
fn
|
||||||
|
#if _WIN32
|
||||||
|
u64
|
||||||
|
#else
|
||||||
#if LINK_LIBC
|
#if LINK_LIBC
|
||||||
struct timespec
|
struct timespec
|
||||||
#else
|
#else
|
||||||
u64
|
u64
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
timestamp()
|
timestamp()
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
LARGE_INTEGER li;
|
||||||
|
QueryPerformanceCounter(&li);
|
||||||
|
return (u64)li.QuadPart;
|
||||||
|
#else
|
||||||
#if LINK_LIBC
|
#if LINK_LIBC
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
@ -116,6 +130,7 @@ timestamp()
|
|||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINK_LIBC
|
#if LINK_LIBC
|
||||||
@ -441,6 +456,9 @@ may_be_unused fn s32 cast_s64_to_s32(s64 source, const char* name, int line)
|
|||||||
#define unreachable() __builtin_unreachable()
|
#define unreachable() __builtin_unreachable()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef static_assert
|
||||||
|
#undef static_assert
|
||||||
|
#endif
|
||||||
#define static_assert(x) _Static_assert((x), "Static assert failed!")
|
#define static_assert(x) _Static_assert((x), "Static assert failed!")
|
||||||
#define alignof(x) _Alignof(x)
|
#define alignof(x) _Alignof(x)
|
||||||
#define auto __auto_type
|
#define auto __auto_type
|
||||||
|
1
project.bat
Normal file
1
project.bat
Normal file
@ -0,0 +1 @@
|
|||||||
|
clang -o build/build bootstrap/build.c -g -march=native -std=gnu2x -Wall -Wextra -Wpedantic -Wno-nested-anon-types -Wno-keyword-macro -Wno-gnu-auto-type -Wno-auto-decl-extensions -Wno-gnu-empty-initializer -Wno-fixed-enum-extension -pedantic -fno-exceptions -fno-stack-protector
|
Loading…
x
Reference in New Issue
Block a user