blob: 8fd167116da5d541ea11c94d27041a8280c57318 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#ifndef CORE_INCLUDE_H
#define CORE_INCLUDE_H
// NOTE: sits right on top of base. shared by audio, net, render and the player.
#if PLATFORM_LINUX
#include <sys/syscall.h>
#include <sys/eventfd.h>
#include <sys/resource.h>
#include <linux/futex.h>
#include <malloc.h>
#elif PLATFORM_APPLE
#include <sys/resource.h>
#include <sys/event.h>
#include <malloc/malloc.h>
#include <mach/thread_info.h>
// NOTE: the futex of darwin. private but stable since 10.12, libc++ and swift's runtime use it.
extern "C" int __ulock_wait(uint32_t operation, void *address, uint64_t value, uint32_t timeout_us);
extern "C" int __ulock_wake(uint32_t operation, void *address, uint64_t wake_value);
#define DARWIN_UL_COMPARE_AND_WAIT 1
#define DARWIN_ULF_WAKE_ALL 0x00000100
#define DARWIN_ULF_NO_ERRNO 0x01000000
#elif PLATFORM_WINDOWS
#include <psapi.h>
#include <malloc.h>
// NOTE: WaitOnAddress / WakeByAddressAll live in Synchronization.lib (api-ms-win-core-synch-l1-2-0)
#endif
#include "core_sync.h"
#include "core_job.h"
#include "core_profile.h"
#include "core_sync.cpp"
#include "core_job.cpp"
#include "core_profile.cpp"
#endif // CORE_INCLUDE_H
|