port os functions, add testing module

This commit is contained in:
Krzosa Karol
2025-02-02 17:34:06 +01:00
parent 85a6c218b2
commit 9f33ea0914
27 changed files with 1120 additions and 889 deletions

51
src/core/core.c Normal file
View File

@@ -0,0 +1,51 @@
#if PLATFORM_WASM
#include "core_platform_wasm.c"
#elif PLATFORM_WINDOWS
#pragma comment(lib, "user32.lib")
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "core_platform_win32.c"
#else
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/mman.h>
#include "core_platform_unix.c"
#endif
#if PLATFORM_ADDRESS_SANITIZER
#include <sanitizer/asan_interface.h>
#endif
#if !defined(ASAN_POISON_MEMORY_REGION)
#define MA_ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#define MA_ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
#else
#define MA_ASAN_POISON_MEMORY_REGION(addr, size) ASAN_POISON_MEMORY_REGION(addr, size)
#define MA_ASAN_UNPOISON_MEMORY_REGION(addr, size) ASAN_UNPOISON_MEMORY_REGION(addr, size)
#endif
#include "core_intrin.c"
#include "core_unicode.c"
#include "core_math.c"
#include "core_arena.c"
#define STB_SPRINTF_IMPLEMENTATION
#include "stb_sprintf.h"
#include "core_string.c"
#include "core_log.c"
#include "core_lexer.c"
#include "core_type_info.c"
#include "core_hash.c"
#include "core_hash_table.c"
#ifndef DONT_INCLUDE_GENERATED_MATH
#include "core_math.gen.c"
#endif
#include "core_ctx.c"