diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-11-05 18:06:42 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-11-05 18:06:42 +0800 |
commit | d12b2a21a2f6654c6bdc87e62012483fb3aca493 (patch) | |
tree | 32f15667f5efa3e14eb8a29a46abc6c11eb3a7ba /src | |
parent | e11812a1072b5d56c9c8a86b77a9f6cbef2bf7de (diff) | |
download | dexon-bls-d12b2a21a2f6654c6bdc87e62012483fb3aca493.tar dexon-bls-d12b2a21a2f6654c6bdc87e62012483fb3aca493.tar.gz dexon-bls-d12b2a21a2f6654c6bdc87e62012483fb3aca493.tar.bz2 dexon-bls-d12b2a21a2f6654c6bdc87e62012483fb3aca493.tar.lz dexon-bls-d12b2a21a2f6654c6bdc87e62012483fb3aca493.tar.xz dexon-bls-d12b2a21a2f6654c6bdc87e62012483fb3aca493.tar.zst dexon-bls-d12b2a21a2f6654c6bdc87e62012483fb3aca493.zip |
[js] support Node.js
Diffstat (limited to 'src')
-rw-r--r-- | src/bls_c.cpp | 15 |
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 |