File tree Expand file tree Collapse file tree 5 files changed +38
-18
lines changed
Expand file tree Collapse file tree 5 files changed +38
-18
lines changed Original file line number Diff line number Diff line change 3131
3232namespace avro {
3333
34- class AVRO_DECL InputStream;
34+ class InputStream ;
3535
3636namespace json {
3737class Entity ;
@@ -59,7 +59,7 @@ enum class EntityType {
5959 Obj
6060};
6161
62- const char *typeToString (EntityType t);
62+ AVRO_DECL const char *typeToString (EntityType t);
6363
6464inline std::ostream &operator <<(std::ostream &os, EntityType et) {
6565 return os << typeToString (et);
Original file line number Diff line number Diff line change 2525
2626namespace avro {
2727
28- class AVRO_DECL InputStream;
28+ class InputStream ;
2929
3030// / This class is used to implement an avro spec parser using a flex/bison
3131// / compiler. In order for the lexer to be reentrant, this class provides a
3232// / lexer object for each parse. The bison parser also uses this class to
3333// / build up an avro parse tree as the avro spec is parsed.
3434
35- class AVRO_DECL ValidSchema;
35+ class ValidSchema ;
3636
3737// / Given a stream containing a JSON schema, compiles the schema to a
3838// / ValidSchema object. Throws if the schema cannot be compiled to a valid
Original file line number Diff line number Diff line change 1919#ifndef avro_Config_hh
2020#define avro_Config_hh
2121
22- // Windows DLL support
23-
24- #ifdef _WIN32
22+ #ifdef _MSC_VER
2523#pragma warning(disable : 4275 4251)
24+ #endif // _MSC_VER
25+
26+ /*
27+ * Symbol visibility macros:
28+ * - AVRO_DLL_EXPORT annotation for exporting symbols
29+ * - AVRO_DLL_IMPORT annotation for importing symbols
30+ * - AVRO_DLL_HIDDEN annotation for hiding symbols
31+ * - AVRO_DYN_LINK needs to be defined when compiling / linking avro as dynamic library
32+ * - AVRO_SOURCE needs to be defined when compiling avro as library
33+ * - AVRO_DECL contains the correct symbol visibility annotation depending on the two macros above
34+ */
35+
36+ #if defined _WIN32 || defined __CYGWIN__
37+ #define AVRO_DLL_EXPORT __declspec (dllexport)
38+ #define AVRO_DLL_IMPORT __declspec (dllimport)
39+ #define AVRO_DLL_HIDDEN
40+ #else
41+ #define AVRO_DLL_EXPORT [[gnu::visibility(" default" )]]
42+ #define AVRO_DLL_IMPORT [[gnu::visibility(" default" )]]
43+ #define AVRO_DLL_HIDDEN [[gnu::visibility(" hidden" )]]
44+ #endif // _WIN32 || __CYGWIN__
2645
27- #if defined( AVRO_DYN_LINK)
46+ #ifdef AVRO_DYN_LINK
2847#ifdef AVRO_SOURCE
29- #define AVRO_DECL __declspec (dllexport)
48+ #define AVRO_DECL AVRO_DLL_EXPORT
3049#else
31- #define AVRO_DECL __declspec (dllimport)
50+ #define AVRO_DECL AVRO_DLL_IMPORT
3251#endif // AVRO_SOURCE
3352#endif // AVRO_DYN_LINK
3453
35- #include < intsafe.h>
36- using ssize_t = SSIZE_T;
37- #endif // _WIN32
38-
3954#ifndef AVRO_DECL
4055#define AVRO_DECL
4156#endif
4257
58+ #ifdef _WIN32
59+ #include < intsafe.h>
60+ using ssize_t = SSIZE_T;
61+ #endif // _WIN32
62+
4363#endif
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ namespace avro {
3535 *
3636 **/
3737
38- class AVRO_DECL ostream : public std::ostream {
38+ class ostream : public std ::ostream {
3939
4040public:
4141 // / Default constructor, creates a new OutputBuffer.
@@ -65,7 +65,7 @@ protected:
6565 *
6666 **/
6767
68- class AVRO_DECL istream : public std::istream {
68+ class istream : public std ::istream {
6969
7070public:
7171 // / Constructor, requires an InputBuffer to read from.
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ namespace avro {
4141 * but we have no need since all writes are immediately stored in the buffer.
4242 **/
4343
44- class AVRO_DECL ostreambuf : public std::streambuf {
44+ class ostreambuf : public std ::streambuf {
4545
4646public:
4747 // / Default constructor creates a new OutputBuffer.
@@ -86,7 +86,7 @@ private:
8686 *
8787 **/
8888
89- class AVRO_DECL istreambuf : public std::streambuf {
89+ class istreambuf : public std ::streambuf {
9090
9191public:
9292 // / Default constructor requires an InputBuffer to read from.
You can’t perform that action at this time.
0 commit comments