Give an #error when we want threads and OpenSSL has disabled threads

Fixes ticket 6673.
This commit is contained in:
Nick Mathewson 2013-03-11 13:23:10 -04:00
parent 0196647970
commit fdafe11a25
2 changed files with 10 additions and 0 deletions

4
changes/bug6673 Normal file
View File

@ -0,0 +1,4 @@
o Minor features (build):
- Detect and reject attempts to build Tor with threading support
when OpenSSL have been compiled with threading support disabled.
Fixes bug 6673.

View File

@ -3000,6 +3000,12 @@ memwipe(void *mem, uint8_t byte, size_t sz)
} }
#ifdef TOR_IS_MULTITHREADED #ifdef TOR_IS_MULTITHREADED
#ifndef OPENSSL_THREADS
#error OpenSSL has been built without thread support. Tor requires an \
OpenSSL library with thread support enabled.
#endif
/** Helper: OpenSSL uses this callback to manipulate mutexes. */ /** Helper: OpenSSL uses this callback to manipulate mutexes. */
static void static void
openssl_locking_cb_(int mode, int n, const char *file, int line) openssl_locking_cb_(int mode, int n, const char *file, int line)