提交 26da3e65 编写于 作者: R Richard Levitte

If OPENSSL_BUILD_SHLIBCRYPTO (for files that end up as libcrypto

objects) or OPENSSL_BUILD_SHLIBSSL (for files that end up as libssl
objects) is defined, redefine OPENSSL_EXTERN to be OPENSSL_EXPORT.
This is actually only important on Win32, and can safely be ignored in
all other cases, at least for now.
上级 21cd4378
...@@ -69,6 +69,11 @@ ...@@ -69,6 +69,11 @@
#include <openssl/symhacks.h> #include <openssl/symhacks.h>
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -302,12 +307,12 @@ typedef struct ASN1_VALUE_st ASN1_VALUE; ...@@ -302,12 +307,12 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ #define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
type *d2i_##name(type **a, unsigned char **in, long len); \ type *d2i_##name(type **a, unsigned char **in, long len); \
int i2d_##name(type *a, unsigned char **out); \ int i2d_##name(type *a, unsigned char **out); \
extern const ASN1_ITEM itname##_it; OPENSSL_EXTERN const ASN1_ITEM itname##_it;
#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ #define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
type *d2i_##name(type **a, const unsigned char **in, long len); \ type *d2i_##name(type **a, const unsigned char **in, long len); \
int i2d_##name(const type *a, unsigned char **out); \ int i2d_##name(const type *a, unsigned char **out); \
extern const ASN1_ITEM name##_it; OPENSSL_EXTERN const ASN1_ITEM name##_it;
#define DECLARE_ASN1_FUNCTIONS_const(name) \ #define DECLARE_ASN1_FUNCTIONS_const(name) \
name *name##_new(void); \ name *name##_new(void); \
......
...@@ -59,8 +59,14 @@ ...@@ -59,8 +59,14 @@
#define HEADER_ASN1T_H #define HEADER_ASN1T_H
#include <stddef.h> #include <stddef.h>
#include <openssl/e_os2.h>
#include <openssl/asn1.h> #include <openssl/asn1.h>
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
/* ASN1 template defines, structures and functions */ /* ASN1 template defines, structures and functions */
#ifdef __cplusplus #ifdef __cplusplus
...@@ -74,7 +80,7 @@ extern "C" { ...@@ -74,7 +80,7 @@ extern "C" {
#define ASN1_ITEM_TEMPLATE_END(tname) \ #define ASN1_ITEM_TEMPLATE_END(tname) \
;\ ;\
const ASN1_ITEM tname##_it = { \ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_PRIMITIVE,\ ASN1_ITYPE_PRIMITIVE,\
-1,\ -1,\
&tname##_item_tt,\ &tname##_item_tt,\
...@@ -114,7 +120,7 @@ extern "C" { ...@@ -114,7 +120,7 @@ extern "C" {
#define ASN1_SEQUENCE_END_name(stname, tname) \ #define ASN1_SEQUENCE_END_name(stname, tname) \
;\ ;\
const ASN1_ITEM tname##_it = { \ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_SEQUENCE,\ ASN1_ITYPE_SEQUENCE,\
V_ASN1_SEQUENCE,\ V_ASN1_SEQUENCE,\
tname##_seq_tt,\ tname##_seq_tt,\
...@@ -148,7 +154,7 @@ extern "C" { ...@@ -148,7 +154,7 @@ extern "C" {
#define ASN1_SEQUENCE_END_ref(stname, tname) \ #define ASN1_SEQUENCE_END_ref(stname, tname) \
;\ ;\
const ASN1_ITEM tname##_it = { \ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_SEQUENCE,\ ASN1_ITYPE_SEQUENCE,\
V_ASN1_SEQUENCE,\ V_ASN1_SEQUENCE,\
tname##_seq_tt,\ tname##_seq_tt,\
...@@ -194,7 +200,7 @@ extern "C" { ...@@ -194,7 +200,7 @@ extern "C" {
#define ASN1_CHOICE_END_selector(stname, tname, selname) \ #define ASN1_CHOICE_END_selector(stname, tname, selname) \
;\ ;\
const ASN1_ITEM tname##_it = { \ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_CHOICE,\ ASN1_ITYPE_CHOICE,\
offsetof(stname,selname) ,\ offsetof(stname,selname) ,\
tname##_ch_tt,\ tname##_ch_tt,\
...@@ -206,7 +212,7 @@ extern "C" { ...@@ -206,7 +212,7 @@ extern "C" {
#define ASN1_CHOICE_END_cb(stname, tname, selname) \ #define ASN1_CHOICE_END_cb(stname, tname, selname) \
;\ ;\
const ASN1_ITEM tname##_it = { \ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_CHOICE,\ ASN1_ITYPE_CHOICE,\
offsetof(stname,selname) ,\ offsetof(stname,selname) ,\
tname##_ch_tt,\ tname##_ch_tt,\
...@@ -635,7 +641,7 @@ typedef struct ASN1_AUX_st { ...@@ -635,7 +641,7 @@ typedef struct ASN1_AUX_st {
(ASN1_d2i_func *)d2i_##sname, \ (ASN1_d2i_func *)d2i_##sname, \
(ASN1_i2d_func *)i2d_##sname, \ (ASN1_i2d_func *)i2d_##sname, \
}; \ }; \
ASN1_ITEM const sname##_it = { \ OPENSSL_GLOBAL ASN1_ITEM const sname##_it = { \
ASN1_ITYPE_COMPAT, \ ASN1_ITYPE_COMPAT, \
tag, \ tag, \
NULL, \ NULL, \
...@@ -646,7 +652,7 @@ typedef struct ASN1_AUX_st { ...@@ -646,7 +652,7 @@ typedef struct ASN1_AUX_st {
} }
#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ #define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
const ASN1_ITEM sname##_it = { \ OPENSSL_GLOBAL const ASN1_ITEM sname##_it = { \
ASN1_ITYPE_EXTERN, \ ASN1_ITYPE_EXTERN, \
tag, \ tag, \
NULL, \ NULL, \
...@@ -711,16 +717,16 @@ typedef struct ASN1_AUX_st { ...@@ -711,16 +717,16 @@ typedef struct ASN1_AUX_st {
/* external definitions for primitive types */ /* external definitions for primitive types */
extern const ASN1_ITEM ASN1_BOOLEAN_it; OPENSSL_EXTERN const ASN1_ITEM ASN1_BOOLEAN_it;
extern const ASN1_ITEM ASN1_TBOOLEAN_it; OPENSSL_EXTERN const ASN1_ITEM ASN1_TBOOLEAN_it;
extern const ASN1_ITEM ASN1_FBOOLEAN_it; OPENSSL_EXTERN const ASN1_ITEM ASN1_FBOOLEAN_it;
extern const ASN1_ITEM ASN1_OBJECT_it; OPENSSL_EXTERN const ASN1_ITEM ASN1_OBJECT_it;
extern const ASN1_ITEM ASN1_ANY_it; OPENSSL_EXTERN const ASN1_ITEM ASN1_ANY_it;
extern const ASN1_ITEM ASN1_SEQUENCE_it; OPENSSL_EXTERN const ASN1_ITEM ASN1_SEQUENCE_it;
extern const ASN1_ITEM CBIGNUM_it; OPENSSL_EXTERN const ASN1_ITEM CBIGNUM_it;
extern const ASN1_ITEM BIGNUM_it; OPENSSL_EXTERN const ASN1_ITEM BIGNUM_it;
extern const ASN1_ITEM LONG_it; OPENSSL_EXTERN const ASN1_ITEM LONG_it;
extern const ASN1_ITEM ZLONG_it; OPENSSL_EXTERN const ASN1_ITEM ZLONG_it;
DECLARE_STACK_OF(ASN1_VALUE) DECLARE_STACK_OF(ASN1_VALUE)
......
...@@ -63,6 +63,11 @@ ...@@ -63,6 +63,11 @@
#include "openssl/e_os.h" /* OPENSSL_EXTERN */ #include "openssl/e_os.h" /* OPENSSL_EXTERN */
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
#undef c2l #undef c2l
#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \ #define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
l|=((unsigned long)(*((c)++)))<< 8L, \ l|=((unsigned long)(*((c)++)))<< 8L, \
......
...@@ -70,6 +70,11 @@ ...@@ -70,6 +70,11 @@
#include <openssl/opensslconf.h> /* DES_LONG */ #include <openssl/opensslconf.h> /* DES_LONG */
#include <openssl/e_os2.h> /* OPENSSL_EXTERN */ #include <openssl/e_os2.h> /* OPENSSL_EXTERN */
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
......
...@@ -93,6 +93,11 @@ ...@@ -93,6 +93,11 @@
#include <string.h> #include <string.h>
#endif #endif
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
#define ITERATIONS 16 #define ITERATIONS 16
#define HALF_ITERATIONS 8 #define HALF_ITERATIONS 8
......
...@@ -57,5 +57,11 @@ ...@@ -57,5 +57,11 @@
*/ */
#include <openssl/e_os2.h> #include <openssl/e_os2.h>
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
OPENSSL_EXTERN char *DES_version; /* SSLeay version string */ OPENSSL_EXTERN char *DES_version; /* SSLeay version string */
OPENSSL_EXTERN char *libdes_version; /* old libdes version string */ OPENSSL_EXTERN char *libdes_version; /* old libdes version string */
...@@ -128,6 +128,11 @@ ...@@ -128,6 +128,11 @@
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#ifdef OPENSSL_BUILD_SHLIBSSL
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
#define PKCS1_CHECK #define PKCS1_CHECK
#define c2l(c,l) (l = ((unsigned long)(*((c)++))) , \ #define c2l(c,l) (l = ((unsigned long)(*((c)++))) , \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册