Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lang/c++/impl/json/JsonDom.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace avro {

class AVRO_DECL InputStream;
class InputStream;

namespace json {
class Entity;
Expand Down Expand Up @@ -59,7 +59,7 @@ enum class EntityType {
Obj
};

const char *typeToString(EntityType t);
AVRO_DECL const char *typeToString(EntityType t);

inline std::ostream &operator<<(std::ostream &os, EntityType et) {
return os << typeToString(et);
Expand Down
4 changes: 2 additions & 2 deletions lang/c++/include/avro/Compiler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

namespace avro {

class AVRO_DECL InputStream;
class InputStream;

/// This class is used to implement an avro spec parser using a flex/bison
/// compiler. In order for the lexer to be reentrant, this class provides a
/// lexer object for each parse. The bison parser also uses this class to
/// build up an avro parse tree as the avro spec is parsed.

class AVRO_DECL ValidSchema;
class ValidSchema;

/// Given a stream containing a JSON schema, compiles the schema to a
/// ValidSchema object. Throws if the schema cannot be compiled to a valid
Expand Down
40 changes: 30 additions & 10 deletions lang/c++/include/avro/Config.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,45 @@
#ifndef avro_Config_hh
#define avro_Config_hh

// Windows DLL support

#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(disable : 4275 4251)
#endif // _MSC_VER

/*
* Symbol visibility macros:
* - AVRO_DLL_EXPORT annotation for exporting symbols
* - AVRO_DLL_IMPORT annotation for importing symbols
* - AVRO_DLL_HIDDEN annotation for hiding symbols
* - AVRO_DYN_LINK needs to be defined when compiling / linking avro as dynamic library
* - AVRO_SOURCE needs to be defined when compiling avro as library
* - AVRO_DECL contains the correct symbol visibility annotation depending on the two macros above
*/

#if defined _WIN32 || defined __CYGWIN__
#define AVRO_DLL_EXPORT __declspec(dllexport)
#define AVRO_DLL_IMPORT __declspec(dllimport)
#define AVRO_DLL_HIDDEN
#else
#define AVRO_DLL_EXPORT [[gnu::visibility("default")]]
#define AVRO_DLL_IMPORT [[gnu::visibility("default")]]
#define AVRO_DLL_HIDDEN [[gnu::visibility("hidden")]]
#endif // _WIN32 || __CYGWIN__

#if defined(AVRO_DYN_LINK)
#ifdef AVRO_DYN_LINK
#ifdef AVRO_SOURCE
#define AVRO_DECL __declspec(dllexport)
#define AVRO_DECL AVRO_DLL_EXPORT
#else
#define AVRO_DECL __declspec(dllimport)
#define AVRO_DECL AVRO_DLL_IMPORT
#endif // AVRO_SOURCE
#endif // AVRO_DYN_LINK

#include <intsafe.h>
using ssize_t = SSIZE_T;
#endif // _WIN32

#ifndef AVRO_DECL
#define AVRO_DECL
#endif

#ifdef _WIN32
#include <intsafe.h>
using ssize_t = SSIZE_T;
#endif // _WIN32

#endif
4 changes: 2 additions & 2 deletions lang/c++/include/avro/buffer/BufferStream.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace avro {
*
**/

class AVRO_DECL ostream : public std::ostream {
class ostream : public std::ostream {

public:
/// Default constructor, creates a new OutputBuffer.
Expand Down Expand Up @@ -65,7 +65,7 @@ protected:
*
**/

class AVRO_DECL istream : public std::istream {
class istream : public std::istream {

public:
/// Constructor, requires an InputBuffer to read from.
Expand Down
4 changes: 2 additions & 2 deletions lang/c++/include/avro/buffer/BufferStreambuf.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace avro {
* but we have no need since all writes are immediately stored in the buffer.
**/

class AVRO_DECL ostreambuf : public std::streambuf {
class ostreambuf : public std::streambuf {

public:
/// Default constructor creates a new OutputBuffer.
Expand Down Expand Up @@ -86,7 +86,7 @@ private:
*
**/

class AVRO_DECL istreambuf : public std::streambuf {
class istreambuf : public std::streambuf {

public:
/// Default constructor requires an InputBuffer to read from.
Expand Down