#include <openssl/symhacks.h>
+#ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
type *d2i_##name(type **a, unsigned char **in, long len); \
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) \
type *d2i_##name(type **a, const unsigned char **in, long len); \
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) \
name *name##_new(void); \
#define HEADER_ASN1T_H
#include <stddef.h>
+#include <openssl/e_os2.h>
#include <openssl/asn1.h>
+#ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+#endif
+
/* ASN1 template defines, structures and functions */
#ifdef __cplusplus
#define ASN1_ITEM_TEMPLATE_END(tname) \
;\
- const ASN1_ITEM tname##_it = { \
+ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_PRIMITIVE,\
-1,\
&tname##_item_tt,\
#define ASN1_SEQUENCE_END_name(stname, tname) \
;\
- const ASN1_ITEM tname##_it = { \
+ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_SEQUENCE,\
V_ASN1_SEQUENCE,\
tname##_seq_tt,\
#define ASN1_SEQUENCE_END_ref(stname, tname) \
;\
- const ASN1_ITEM tname##_it = { \
+ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_SEQUENCE,\
V_ASN1_SEQUENCE,\
tname##_seq_tt,\
#define ASN1_CHOICE_END_selector(stname, tname, selname) \
;\
- const ASN1_ITEM tname##_it = { \
+ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_CHOICE,\
offsetof(stname,selname) ,\
tname##_ch_tt,\
#define ASN1_CHOICE_END_cb(stname, tname, selname) \
;\
- const ASN1_ITEM tname##_it = { \
+ OPENSSL_GLOBAL const ASN1_ITEM tname##_it = { \
ASN1_ITYPE_CHOICE,\
offsetof(stname,selname) ,\
tname##_ch_tt,\
(ASN1_d2i_func *)d2i_##sname, \
(ASN1_i2d_func *)i2d_##sname, \
}; \
- ASN1_ITEM const sname##_it = { \
+ OPENSSL_GLOBAL ASN1_ITEM const sname##_it = { \
ASN1_ITYPE_COMPAT, \
tag, \
NULL, \
}
#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
- const ASN1_ITEM sname##_it = { \
+ OPENSSL_GLOBAL const ASN1_ITEM sname##_it = { \
ASN1_ITYPE_EXTERN, \
tag, \
NULL, \
/* external definitions for primitive types */
-extern const ASN1_ITEM ASN1_BOOLEAN_it;
-extern const ASN1_ITEM ASN1_TBOOLEAN_it;
-extern const ASN1_ITEM ASN1_FBOOLEAN_it;
-extern const ASN1_ITEM ASN1_OBJECT_it;
-extern const ASN1_ITEM ASN1_ANY_it;
-extern const ASN1_ITEM ASN1_SEQUENCE_it;
-extern const ASN1_ITEM CBIGNUM_it;
-extern const ASN1_ITEM BIGNUM_it;
-extern const ASN1_ITEM LONG_it;
-extern const ASN1_ITEM ZLONG_it;
+OPENSSL_EXTERN const ASN1_ITEM ASN1_BOOLEAN_it;
+OPENSSL_EXTERN const ASN1_ITEM ASN1_TBOOLEAN_it;
+OPENSSL_EXTERN const ASN1_ITEM ASN1_FBOOLEAN_it;
+OPENSSL_EXTERN const ASN1_ITEM ASN1_OBJECT_it;
+OPENSSL_EXTERN const ASN1_ITEM ASN1_ANY_it;
+OPENSSL_EXTERN const ASN1_ITEM ASN1_SEQUENCE_it;
+OPENSSL_EXTERN const ASN1_ITEM CBIGNUM_it;
+OPENSSL_EXTERN const ASN1_ITEM BIGNUM_it;
+OPENSSL_EXTERN const ASN1_ITEM LONG_it;
+OPENSSL_EXTERN const ASN1_ITEM ZLONG_it;
DECLARE_STACK_OF(ASN1_VALUE)