aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bls_c.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/bls_c.cpp b/src/bls_c.cpp
index 72074fe..0939802 100644
--- a/src/bls_c.cpp
+++ b/src/bls_c.cpp
@@ -36,11 +36,14 @@ int blsInitNotThreadSafe(int curve, int maxUnitSize)
return -1;
}
-#if defined(CYBOZU_CPP_VERSION) && CYBOZU_CPP_VERSION >= CYBOZU_CPP_VERSION_CPP11
-#include <mutex>
- #define USE_STD_MUTEX
-#else
-#include <cybozu/mutex.hpp>
+#ifndef __EMSCRIPTEN__
+ #if defined(CYBOZU_CPP_VERSION) && CYBOZU_CPP_VERSION >= CYBOZU_CPP_VERSION_CPP11
+ #include <mutex>
+ #define USE_STD_MUTEX
+ #else
+ #include <cybozu/mutex.hpp>
+ #define USE_CYBOZU_MUTEX
+ #endif
#endif
int blsInit(int curve, int maxUnitSize)
@@ -49,7 +52,7 @@ int blsInit(int curve, int maxUnitSize)
#ifdef USE_STD_MUTEX
static std::mutex m;
std::lock_guard<std::mutex> lock(m);
-#else
+#elif defined(USE_CYBOZU_MUTEX)
static cybozu::Mutex m;
cybozu::AutoLock lock(m);
#endif