diff src/c/openssl.c @ 2263:dfadb5effdc0

Merge bbaren's fix for bug 209.
author Ziv Scully <ziv@mit.edu>
date Tue, 13 Oct 2015 14:22:05 -0400
parents c275bbc41194 ce312cad5ecd
children
line wrap: on
line diff
--- a/src/c/openssl.c	Wed Oct 07 08:58:08 2015 -0400
+++ b/src/c/openssl.c	Tue Oct 13 14:22:05 2015 -0400
@@ -34,9 +34,15 @@
 }
 
 // OpenSSL callbacks
+#ifdef PTHREAD_T_IS_POINTER
+# define CRYPTO_THREADID_SET CRYPTO_THREADID_set_pointer
+#else
+# define CRYPTO_THREADID_SET CRYPTO_THREADID_set_numeric
+#endif
 static void thread_id(CRYPTO_THREADID *const result) {
-  CRYPTO_THREADID_set_numeric(result, (unsigned long)pthread_self());
+  CRYPTO_THREADID_SET(result, pthread_self());
 }
+#undef CRYPTO_THREADID_SET
 static void lock_or_unlock(const int mode, const int type, const char *file,
                            const int line) {
   pthread_mutex_t *const lock = &openssl_locks[type];