浏览代码

Fix standalone build on Mac.

CRYPTO_MUTEX was the wrong size. Fortunately, Apple was kind enough to define
pthread_rwlock_t unconditionally, so we can be spared fighting with feature
macros. Some of the stdlib.h removals were wrong and clang is pick about
multiply-defined typedefs. Apparently that's a C11 thing?

BUG=478598

Change-Id: Ibdcb8de9e5d83ca28e4c55b2979177d1ef0f9721
Reviewed-on: https://boringssl-review.googlesource.com/4404
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 9 年前
committed by Adam Langley
父节点
当前提交
f0df86a1f6
共有 5 个文件被更改,包括 9 次插入6 次删除
  1. +0
    -2
      crypto/ec/internal.h
  2. +3
    -1
      include/openssl/base.h
  3. +4
    -3
      include/openssl/thread.h
  4. +1
    -0
      tool/rand.cc
  5. +1
    -0
      tool/transport_common.cc

+ 0
- 2
crypto/ec/internal.h 查看文件

@@ -81,8 +81,6 @@ extern "C" {
/* Use default functions for poin2oct, oct2point and compressed coordinates */
#define EC_FLAGS_DEFAULT_OCT 0x1

typedef struct ec_method_st EC_METHOD;

struct ec_method_st {
/* Various method flags */
int flags;


+ 3
- 1
include/openssl/base.h 查看文件

@@ -132,6 +132,9 @@ extern "C" {

#endif /* defined(BORINGSSL_SHARED_LIBRARY) */

/* CRYPTO_THREADID is a dummy value. */
typedef int CRYPTO_THREADID;

typedef int ASN1_BOOLEAN;
typedef int ASN1_NULL;
typedef struct ASN1_ITEM_st ASN1_ITEM;
@@ -176,7 +179,6 @@ typedef struct cbb_st CBB;
typedef struct cbs_st CBS;
typedef struct conf_st CONF;
typedef struct conf_value_st CONF_VALUE;
typedef int CRYPTO_THREADID;
typedef struct dh_method DH_METHOD;
typedef struct dh_st DH;
typedef struct dsa_method DSA_METHOD;


+ 4
- 3
include/openssl/thread.h 查看文件

@@ -57,6 +57,8 @@
#ifndef OPENSSL_HEADER_THREAD_H
#define OPENSSL_HEADER_THREAD_H

#include <sys/types.h>

#include <openssl/base.h>

#if defined(__cplusplus)
@@ -72,6 +74,8 @@ typedef union crypto_mutex_st {
double alignment;
uint8_t padding[4*sizeof(void*) + 2*sizeof(int)];
} CRYPTO_MUTEX;
#elif defined(__MACH__) && defined(__APPLE__)
typedef pthread_rwlock_t CRYPTO_MUTEX;
#else
/* It is reasonable to include pthread.h on non-Windows systems, however the
* |pthread_rwlock_t| that we need is hidden under feature flags, and we can't
@@ -133,9 +137,6 @@ OPENSSL_EXPORT const char *CRYPTO_get_lock_name(int lock_num);

/* Deprecated functions */

/* CRYPTO_THREADID is a dummy value. */
typedef int CRYPTO_THREADID;

/* CRYPTO_THREADID_set_callback does nothing. */
OPENSSL_EXPORT int CRYPTO_THREADID_set_callback(
void (*threadid_func)(CRYPTO_THREADID *threadid));


+ 1
- 0
tool/rand.cc 查看文件

@@ -16,6 +16,7 @@
#include <vector>

#include <stdint.h>
#include <stdlib.h>

#include <openssl/rand.h>



+ 1
- 0
tool/transport_common.cc 查看文件

@@ -19,6 +19,7 @@

#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>



正在加载...
取消
保存