Define CRYPTO_once_t as LONG on Windows.
This is used with a platform API, so it should use the corresponding platform type, saving us the size assert. It's ever defined in an internal header, so we can freely use windows.h and friends. Change-Id: Idc979309436adcf54524c835ddc2c98c3870d2e2 Reviewed-on: https://boringssl-review.googlesource.com/4680 Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
parent
0d107e183e
commit
dfb67134dc
@ -336,7 +336,7 @@ static inline int constant_time_select_int(unsigned int mask, int a, int b) {
|
||||
typedef pthread_once_t CRYPTO_once_t;
|
||||
#define CRYPTO_ONCE_INIT PTHREAD_ONCE_INIT
|
||||
#else
|
||||
typedef int32_t CRYPTO_once_t;
|
||||
typedef LONG CRYPTO_once_t;
|
||||
#define CRYPTO_ONCE_INIT 0
|
||||
#endif
|
||||
|
||||
|
@ -32,9 +32,8 @@ OPENSSL_COMPILE_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(CRITICAL_SECTION),
|
||||
CRYPTO_MUTEX_too_small);
|
||||
|
||||
static void run_once(CRYPTO_once_t *in_once, void (*init)(void *), void *arg) {
|
||||
volatile LONG *once = (LONG*) in_once;
|
||||
volatile LONG *once = in_once;
|
||||
|
||||
assert(sizeof(LONG) == sizeof(CRYPTO_once_t));
|
||||
/* Values must be aligned. */
|
||||
assert((((uintptr_t) once) & 3) == 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user