Move OPENSSL_FALLTHROUGH to internal headers.
Having it in base.h pollutes the global namespace a bit and, in particular, causes clang to give unhelpful suggestions in consuming projects. Change-Id: I6ca1a88bdd1701f0c49192a0df56ac0953c7067c Reviewed-on: https://boringssl-review.googlesource.com/25464 Commit-Queue: Steven Valdez <svaldez@google.com> Reviewed-by: Steven Valdez <svaldez@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
This commit is contained in:
parent
5301c10c53
commit
a62dbf88d8
@ -73,6 +73,7 @@ OPENSSL_MSVC_PRAGMA(warning(pop))
|
|||||||
#include <openssl/mem.h>
|
#include <openssl/mem.h>
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
#include "../internal.h"
|
||||||
|
|
||||||
|
|
||||||
static int bio_fd_non_fatal_error(int err) {
|
static int bio_fd_non_fatal_error(int err) {
|
||||||
|
@ -81,6 +81,8 @@
|
|||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/mem.h>
|
#include <openssl/mem.h>
|
||||||
|
|
||||||
|
#include "../internal.h"
|
||||||
|
|
||||||
|
|
||||||
#define BIO_FP_READ 0x02
|
#define BIO_FP_READ 0x02
|
||||||
#define BIO_FP_WRITE 0x04
|
#define BIO_FP_WRITE 0x04
|
||||||
|
@ -57,6 +57,8 @@
|
|||||||
#include <openssl/cipher.h>
|
#include <openssl/cipher.h>
|
||||||
#include <openssl/nid.h>
|
#include <openssl/nid.h>
|
||||||
|
|
||||||
|
#include "../internal.h"
|
||||||
|
|
||||||
|
|
||||||
#define c2l(c, l) \
|
#define c2l(c, l) \
|
||||||
do { \
|
do { \
|
||||||
|
@ -59,6 +59,8 @@
|
|||||||
|
|
||||||
#include <openssl/base.h>
|
#include <openssl/base.h>
|
||||||
|
|
||||||
|
#include "../../internal.h"
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -172,6 +172,20 @@ typedef __uint128_t uint128_t;
|
|||||||
|
|
||||||
#define OPENSSL_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
|
#define OPENSSL_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
|
||||||
|
|
||||||
|
// Have a generic fall-through for different versions of C/C++.
|
||||||
|
#if defined(__cplusplus) && __cplusplus >= 201703L
|
||||||
|
#define OPENSSL_FALLTHROUGH [[fallthrough]]
|
||||||
|
#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__)
|
||||||
|
#define OPENSSL_FALLTHROUGH [[clang::fallthrough]]
|
||||||
|
#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \
|
||||||
|
__GNUC__ >= 7
|
||||||
|
#define OPENSSL_FALLTHROUGH [[gnu::fallthrough]]
|
||||||
|
#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7
|
||||||
|
#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough))
|
||||||
|
#else // C++11 on gcc 6, and all other cases
|
||||||
|
#define OPENSSL_FALLTHROUGH
|
||||||
|
#endif
|
||||||
|
|
||||||
// buffers_alias returns one if |a| and |b| alias and zero otherwise.
|
// buffers_alias returns one if |a| and |b| alias and zero otherwise.
|
||||||
static inline int buffers_alias(const uint8_t *a, size_t a_len,
|
static inline int buffers_alias(const uint8_t *a, size_t a_len,
|
||||||
const uint8_t *b, size_t b_len) {
|
const uint8_t *b, size_t b_len) {
|
||||||
|
@ -57,6 +57,8 @@
|
|||||||
#ifndef OPENSSL_HEADER_DECREPIT_MACROS_H
|
#ifndef OPENSSL_HEADER_DECREPIT_MACROS_H
|
||||||
#define OPENSSL_HEADER_DECREPIT_MACROS_H
|
#define OPENSSL_HEADER_DECREPIT_MACROS_H
|
||||||
|
|
||||||
|
#include "../crypto/internal.h"
|
||||||
|
|
||||||
|
|
||||||
// NOTE - c is not incremented as per n2l
|
// NOTE - c is not incremented as per n2l
|
||||||
#define n2ln(c, l1, l2, n) \
|
#define n2ln(c, l1, l2, n) \
|
||||||
|
@ -223,20 +223,6 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Have a generic fall-through for different versions of C/C++.
|
|
||||||
#if defined(__cplusplus) && __cplusplus >= 201703L
|
|
||||||
#define OPENSSL_FALLTHROUGH [[fallthrough]]
|
|
||||||
#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__)
|
|
||||||
#define OPENSSL_FALLTHROUGH [[clang::fallthrough]]
|
|
||||||
#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \
|
|
||||||
__GNUC__ >= 7
|
|
||||||
#define OPENSSL_FALLTHROUGH [[gnu::fallthrough]]
|
|
||||||
#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7
|
|
||||||
#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough))
|
|
||||||
#else // C++11 on gcc 6, and all other cases
|
|
||||||
#define OPENSSL_FALLTHROUGH
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// CRYPTO_THREADID is a dummy value.
|
// CRYPTO_THREADID is a dummy value.
|
||||||
typedef int CRYPTO_THREADID;
|
typedef int CRYPTO_THREADID;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user