From aa7f3411f588d12f20dea0b4f6dbe7312bbbb925 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Thu, 12 Dec 2019 17:39:22 -0600 Subject: [PATCH] Use JANET_SINGLE_THREADED to disable threads. --- Makefile | 2 +- src/include/janet.h | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 40e970e4..5f88c7f1 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ PREFIX?=/usr/local INCLUDEDIR?=$(PREFIX)/include BINDIR?=$(PREFIX)/bin LIBDIR?=$(PREFIX)/lib -JANET_BUILD?="\"$(shell git log --pretty=format:'%h' -n 1)\"" +JANET_BUILD?="\"$(shell git log --pretty=format:'%h' -n 1 || 'local')\"" CLIBS=-lm -lpthread JANET_TARGET=build/janet JANET_LIBRARY=build/libjanet.so diff --git a/src/include/janet.h b/src/include/janet.h index 7b3501ce..c3840811 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -112,8 +112,10 @@ extern "C" { #define JANET_THREAD_LOCAL #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 #endif @@ -143,11 +145,6 @@ extern "C" { #define JANET_INT_TYPES #endif -/* Enable or disable threads */ -#ifndef JANET_NO_THREADS -#define JANET_THREADS -#endif - /* How to export symbols */ #ifndef JANET_API #ifdef JANET_WINDOWS