kuroko.h
Go to the documentation of this file.
1 #pragma once
6 #include <stdint.h>
7 #include <stddef.h>
8 #include <stdlib.h>
9 #include <inttypes.h>
10 
11 typedef int64_t krk_integer_type;
12 
13 #ifndef _WIN32
14 # define KRK_PATH_SEP "/"
15 # ifndef KRK_STATIC_ONLY
16 # include <dlfcn.h>
17 # define krk_dlRefType void *
18 # define krk_dlSymType void *
19 # define krk_dlOpen(fileName) dlopen(fileName, RTLD_NOW)
20 # define krk_dlSym(dlRef, handlerName) dlsym(dlRef,handlerName)
21 # define krk_dlClose(dlRef) dlclose(dlRef)
22 # endif
23 #else
24 # include <windows.h>
25 # define KRK_PATH_SEP "\\"
26 # ifndef KRK_STATIC_ONLY
27 # define krk_dlRefType HINSTANCE
28 # define krk_dlSymType FARPROC
29 # define krk_dlOpen(fileName) LoadLibraryA(fileName)
30 # define krk_dlSym(dlRef, handlerName) GetProcAddress(dlRef, handlerName)
31 # define krk_dlClose(dlRef)
32 # endif
33 #endif
34 
35 #if defined(_MSC_VER) && !defined(__clang__)
36 #define KRK_NO_DOCUMENTATION 1
37 #define KRK_NO_GC_TRACING 1
38 typedef intptr_t ssize_t;
39 #pragma warning(disable : 4146) /* unary minus on unsigned */
40 #pragma warning(disable : 4996) /* sterror */
41 #pragma warning(disable : 4267) /* conversions to smaller types... */
42 #pragma warning(disable : 4244) /* conversions to smaller types... */
43 #include <math.h>
44 #define __builtin_floor floor
45 #define __builtin_unreachable abort
46 #define __builtin_expect(cond,expected) (cond)
47 #endif