diff options
| author | 2021-07-17 15:13:28 -0500 | |
|---|---|---|
| committer | 2021-07-17 15:13:28 -0500 | |
| commit | aea1f59f6ea3b383324f836fee9e5625a6aaee80 (patch) | |
| tree | a92353a3500a3ee13a4ecd894e546a6cac0c3ed4 /src/include/janet.h | |
| parent | Fix minimal build. (diff) | |
Add option to build janet without thread library.
Diffstat (limited to 'src/include/janet.h')
| -rw-r--r-- | src/include/janet.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/include/janet.h b/src/include/janet.h index f07074dd..8573772a 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -144,17 +144,23 @@ extern "C" { #define JANET_NO_UTC_MKTIME #endif +/* Check thread library */ +#ifndef JANET_NO_THREADS +#define JANET_THREADS +#endif + /* Define how global janet state is declared */ +/* Also enable the thread library only if not single-threaded */ #ifdef JANET_SINGLE_THREADED #define JANET_THREAD_LOCAL +#undef JANET_THREADS #elif defined(__GNUC__) #define JANET_THREAD_LOCAL __thread -#define JANET_THREADS #elif defined(_MSC_BUILD) #define JANET_THREAD_LOCAL __declspec(thread) -#define JANET_THREADS #else #define JANET_THREAD_LOCAL +#undef JANET_THREADS #endif /* Enable or disable dynamic module loading. Enabled by default. */ |
