diff options
author | Ryo Nakamura <upa@haeena.net> | 2023-03-15 23:18:33 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2023-03-15 23:18:33 +0900 |
commit | f0c70a148bffeb4faa362a3e696857461aae0419 (patch) | |
tree | 6f24288b9b04f4424170bf832c0ef27e0ca1cc7f /src/platform.h | |
parent | e038b3020d0487337fd33205c819e23fa63ee96f (diff) |
macOS does not support sem_init. use sem_open instead
Diffstat (limited to 'src/platform.h')
-rw-r--r-- | src/platform.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/platform.h b/src/platform.h index 7fddfc4..b4fb1b1 100644 --- a/src/platform.h +++ b/src/platform.h @@ -3,7 +3,12 @@ #include <pthread.h> -int nr_cpus(); +#ifndef PSEMNAMLEN /* defined in macOS, but not in Linux */ +#define PSEMNAMLEN 31 +#endif + +int nr_cpus(void); int set_thread_affinity(pthread_t tid, int core); +int get_random(int max); #endif /* _PLATFORM_H_ */ |