Remove __cplusplus preamble from internal headers

These headers are internal and never exposed to a cpp compiler, hence no
need for the preamble.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/6554)
This commit is contained in:
Nicola Tuveri 2018-06-21 23:24:34 +03:00 committed by Dr. Matthias St. Pierre
parent 07e4dc341f
commit 34446a8524
20 changed files with 0 additions and 149 deletions

View File

@ -23,10 +23,6 @@
# include "internal/bn_int.h" # include "internal/bn_int.h"
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* These preprocessor symbols control various aspects of the bignum headers * These preprocessor symbols control various aspects of the bignum headers
* and library code. They're not defined by any "normal" configuration, as * and library code. They're not defined by any "normal" configuration, as
@ -659,8 +655,4 @@ static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);
} }
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -10,10 +10,6 @@
#ifndef HEADER_CMS_LCL_H #ifndef HEADER_CMS_LCL_H
# define HEADER_CMS_LCL_H # define HEADER_CMS_LCL_H
#ifdef __cplusplus
extern "C" {
#endif
# include <openssl/x509.h> # include <openssl/x509.h>
/* /*
@ -438,7 +434,4 @@ DECLARE_ASN1_ITEM(CMS_RevocationInfoChoice)
DECLARE_ASN1_ITEM(CMS_SignedData) DECLARE_ASN1_ITEM(CMS_SignedData)
DECLARE_ASN1_ITEM(CMS_CompressedData) DECLARE_ASN1_ITEM(CMS_CompressedData)
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -16,10 +16,6 @@
# include "internal/thread_once.h" # include "internal/thread_once.h"
# include "internal/refcount.h" # include "internal/refcount.h"
#ifdef __cplusplus
extern "C" {
#endif
extern CRYPTO_RWLOCK *global_engine_lock; extern CRYPTO_RWLOCK *global_engine_lock;
/* /*
@ -172,8 +168,4 @@ typedef struct st_engine_pile ENGINE_PILE;
DEFINE_LHASH_OF(ENGINE_PILE); DEFINE_LHASH_OF(ENGINE_PILE);
#ifdef __cplusplus
}
#endif
#endif /* HEADER_ENGINE_INT_H */ #endif /* HEADER_ENGINE_INT_H */

View File

@ -10,13 +10,6 @@
#ifndef HEADER_HMAC_LCL_H #ifndef HEADER_HMAC_LCL_H
# define HEADER_HMAC_LCL_H # define HEADER_HMAC_LCL_H
#ifdef __cplusplus
extern "C" {
#endif
#if 0 /* emacs indentation fix */
}
#endif
struct hmac_ctx_st { struct hmac_ctx_st {
const EVP_MD *md; const EVP_MD *md;
EVP_MD_CTX *md_ctx; EVP_MD_CTX *md_ctx;
@ -26,8 +19,4 @@ struct hmac_ctx_st {
unsigned char key[HMAC_MAX_MD_CBLOCK]; unsigned char key[HMAC_MAX_MD_CBLOCK];
}; };
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif #endif

View File

@ -25,10 +25,6 @@
# define ARIA_BLOCK_SIZE 16 /* Size of each encryption/decryption block */ # define ARIA_BLOCK_SIZE 16 /* Size of each encryption/decryption block */
# define ARIA_MAX_KEYS 17 /* Number of keys needed in the worst case */ # define ARIA_MAX_KEYS 17 /* Number of keys needed in the worst case */
# ifdef __cplusplus
extern "C" {
# endif
typedef union { typedef union {
unsigned char c[ARIA_BLOCK_SIZE]; unsigned char c[ARIA_BLOCK_SIZE];
unsigned int u[ARIA_BLOCK_SIZE / sizeof(unsigned int)]; unsigned int u[ARIA_BLOCK_SIZE / sizeof(unsigned int)];
@ -51,8 +47,4 @@ int aria_set_decrypt_key(const unsigned char *userKey, const int bits,
void aria_encrypt(const unsigned char *in, unsigned char *out, void aria_encrypt(const unsigned char *in, unsigned char *out,
const ARIA_KEY *key); const ARIA_KEY *key);
# ifdef __cplusplus
}
# endif
#endif #endif

View File

@ -13,10 +13,6 @@
# include <openssl/bn.h> # include <openssl/bn.h>
# include <limits.h> # include <limits.h>
#ifdef __cplusplus
extern "C" {
#endif
BIGNUM *bn_wexpand(BIGNUM *a, int words); BIGNUM *bn_wexpand(BIGNUM *a, int words);
BIGNUM *bn_expand2(BIGNUM *a, int words); BIGNUM *bn_expand2(BIGNUM *a, int words);
@ -64,8 +60,4 @@ void bn_set_static_words(BIGNUM *a, BN_ULONG *words, int size);
*/ */
int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words); int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -12,10 +12,6 @@
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* ChaCha20_ctr32 encrypts |len| bytes from |inp| with the given key and * ChaCha20_ctr32 encrypts |len| bytes from |inp| with the given key and
* nonce and writes the result to |out|, which may be equal to |inp|. * nonce and writes the result to |out|, which may be equal to |inp|.
@ -43,7 +39,4 @@ void ChaCha20_ctr32(unsigned char *out, const unsigned char *inp,
#define CHACHA_CTR_SIZE 16 #define CHACHA_CTR_SIZE 16
#define CHACHA_BLK_SIZE 64 #define CHACHA_BLK_SIZE 64
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -15,10 +15,6 @@
# ifndef OPENSSL_NO_SM2 # ifndef OPENSSL_NO_SM2
# ifdef __cplusplus
extern "C" {
# endif
# include <openssl/ec.h> # include <openssl/ec.h>
/* The default user id as specified in GM/T 0009-2012 */ /* The default user id as specified in GM/T 0009-2012 */
@ -74,9 +70,5 @@ int sm2_decrypt(const EC_KEY *key,
const uint8_t *ciphertext, const uint8_t *ciphertext,
size_t ciphertext_len, uint8_t *ptext_buf, size_t *ptext_len); size_t ciphertext_len, uint8_t *ptext_buf, size_t *ptext_len);
# ifdef __cplusplus
}
# endif
# endif /* OPENSSL_NO_SM2 */ # endif /* OPENSSL_NO_SM2 */
#endif #endif

View File

@ -15,9 +15,6 @@
# ifndef OPENSSL_NO_SM2 # ifndef OPENSSL_NO_SM2
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_SM2_strings(void); int ERR_load_SM2_strings(void);
/* /*

View File

@ -14,10 +14,6 @@
# include <openssl/store.h> # include <openssl/store.h>
# include <openssl/ui.h> # include <openssl/ui.h>
# ifdef __cplusplus
extern "C" {
# endif
/* /*
* Two functions to read PEM data off an already opened BIO. To be used * Two functions to read PEM data off an already opened BIO. To be used
* instead of OSSLSTORE_open() and OSSLSTORE_close(). Everything is done * instead of OSSLSTORE_open() and OSSLSTORE_close(). Everything is done
@ -27,7 +23,4 @@ OSSL_STORE_CTX *ossl_store_attach_pem_bio(BIO *bp, const UI_METHOD *ui_method,
void *ui_data); void *ui_data);
int ossl_store_detach_pem_bio(OSSL_STORE_CTX *ctx); int ossl_store_detach_pem_bio(OSSL_STORE_CTX *ctx);
# ifdef __cplusplus
}
# endif
#endif #endif

View File

@ -45,10 +45,6 @@ typedef unsigned int seed_word;
# endif # endif
#ifdef __cplusplus
extern "C" {
#endif
# define char2word(c, i) \ # define char2word(c, i) \
(i) = ((((seed_word)(c)[0]) << 24) | (((seed_word)(c)[1]) << 16) | (((seed_word)(c)[2]) << 8) | ((seed_word)(c)[3])) (i) = ((((seed_word)(c)[0]) << 24) | (((seed_word)(c)[1]) << 16) | (((seed_word)(c)[2]) << 8) | ((seed_word)(c)[3]))
@ -113,8 +109,4 @@ extern "C" {
(X1) ^= (T0); \ (X1) ^= (T0); \
(X2) ^= (T1) (X2) ^= (T1)
#ifdef __cplusplus
}
#endif
#endif /* HEADER_SEED_LOCL_H */ #endif /* HEADER_SEED_LOCL_H */

View File

@ -10,10 +10,6 @@
#ifndef HEADER_V3_ADMISSION_H #ifndef HEADER_V3_ADMISSION_H
# define HEADER_V3_ADMISSION_H # define HEADER_V3_ADMISSION_H
#ifdef __cplusplus
extern "C" {
#endif
struct NamingAuthority_st { struct NamingAuthority_st {
ASN1_OBJECT* namingAuthorityId; ASN1_OBJECT* namingAuthorityId;
ASN1_IA5STRING* namingAuthorityUrl; ASN1_IA5STRING* namingAuthorityUrl;
@ -39,7 +35,4 @@ struct AdmissionSyntax_st {
STACK_OF(ADMISSIONS)* contentsOfAdmissions; STACK_OF(ADMISSIONS)* contentsOfAdmissions;
}; };
#ifdef __cplusplus
}
#endif
#endif #endif

8
e_os.h
View File

@ -22,10 +22,6 @@
* outside; this file e_os.h is not part of the exported interface. * outside; this file e_os.h is not part of the exported interface.
*/ */
#ifdef __cplusplus
extern "C" {
#endif
# ifndef DEVRANDOM # ifndef DEVRANDOM
/* /*
* set this to a comma-separated list of 'random' device files to try out. By * set this to a comma-separated list of 'random' device files to try out. By
@ -325,8 +321,4 @@ struct servent *getservbyname(const char *name, const char *proto);
# define CRYPTO_memcmp memcmp # define CRYPTO_memcmp memcmp
#endif #endif
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -12,11 +12,6 @@
#include <openssl/conf.h> #include <openssl/conf.h>
#ifdef __cplusplus
extern "C" {
#endif
struct ossl_init_settings_st { struct ossl_init_settings_st {
char *appname; char *appname;
}; };
@ -25,8 +20,4 @@ void openssl_config_int(const char *appname);
void openssl_no_config_int(void); void openssl_no_config_int(void);
void conf_modules_free_int(void); void conf_modules_free_int(void);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -14,10 +14,6 @@
# include <string.h> # include <string.h>
# include <openssl/e_os2.h> /* For 'ossl_inline' */ # include <openssl/e_os2.h> /* For 'ossl_inline' */
#ifdef __cplusplus
extern "C" {
#endif
/*- /*-
* The boolean methods return a bitmask of all ones (0xff...f) for true * The boolean methods return a bitmask of all ones (0xff...f) for true
* and 0 for false. This is useful for choosing a value based on the result * and 0 for false. This is useful for choosing a value based on the result
@ -328,8 +324,4 @@ static ossl_inline void constant_time_lookup(void *out,
} }
} }
#ifdef __cplusplus
}
#endif
#endif /* HEADER_CONSTANT_TIME_LOCL_H */ #endif /* HEADER_CONSTANT_TIME_LOCL_H */

View File

@ -25,10 +25,6 @@
# include <openssl/err.h> # include <openssl/err.h>
# include "internal/nelem.h" # include "internal/nelem.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NDEBUG #ifdef NDEBUG
# define ossl_assert(x) ((x) != 0) # define ossl_assert(x) ((x) != 0)
#else #else
@ -96,8 +92,4 @@ void *openssl_fopen(const char *filename, const char *mode);
uint32_t OPENSSL_rdtsc(void); uint32_t OPENSSL_rdtsc(void);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -13,10 +13,6 @@
# include <openssl/crypto.h> # include <openssl/crypto.h>
# include "internal/dsoerr.h" # include "internal/dsoerr.h"
#ifdef __cplusplus
extern "C" {
#endif
/* These values are used as commands to DSO_ctrl() */ /* These values are used as commands to DSO_ctrl() */
# define DSO_CTRL_GET_FLAGS 1 # define DSO_CTRL_GET_FLAGS 1
# define DSO_CTRL_SET_FLAGS 2 # define DSO_CTRL_SET_FLAGS 2
@ -166,7 +162,4 @@ void *DSO_global_lookup(const char *name);
int ERR_load_DSO_strings(void); int ERR_load_DSO_strings(void);
# ifdef __cplusplus
}
# endif
#endif #endif

View File

@ -15,9 +15,6 @@
# ifndef OPENSSL_NO_DSO # ifndef OPENSSL_NO_DSO
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_DSO_strings(void); int ERR_load_DSO_strings(void);
/* /*

View File

@ -39,10 +39,6 @@
#ifndef O_DIR_H #ifndef O_DIR_H
# define O_DIR_H # define O_DIR_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX; typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX;
/* /*
@ -53,8 +49,4 @@ const char *OPENSSL_DIR_read(OPENSSL_DIR_CTX **ctx, const char *directory);
/* returns 1 on success, 0 on error */ /* returns 1 on success, 0 on error */
int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx); int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx);
#ifdef __cplusplus
}
#endif
#endif /* LPDIR_H */ #endif /* LPDIR_H */

View File

@ -18,10 +18,6 @@
# include "internal/numbers.h" # include "internal/numbers.h"
# ifdef __cplusplus
extern "C" {
# endif
typedef struct { typedef struct {
/* Pointer to where we are currently reading from */ /* Pointer to where we are currently reading from */
const unsigned char *curr; const unsigned char *curr;
@ -875,8 +871,4 @@ unsigned char *WPACKET_get_curr(WPACKET *pkt);
/* Release resources in a WPACKET if a failure has occurred. */ /* Release resources in a WPACKET if a failure has occurred. */
void WPACKET_cleanup(WPACKET *pkt); void WPACKET_cleanup(WPACKET *pkt);
# ifdef __cplusplus
}
# endif
#endif /* HEADER_PACKET_LOCL_H */ #endif /* HEADER_PACKET_LOCL_H */