Skip to content

Commit

Permalink
Fix exports when compiling DLLs enabled with mingw
Browse files Browse the repository at this point in the history
mingw seems to be more strict about dll import/export than msvc, inline
functions should not be tagged as either.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Aug 27, 2019
1 parent b4d5d86 commit 3674dd2
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 21 deletions.
10 changes: 5 additions & 5 deletions IlmBase/Iex/IexBaseExc.h
Expand Up @@ -132,11 +132,11 @@ class BaseExc: public std::exception
class name: public base \
{ \
public: \
exp name() throw(): base (0) {} \
exp name (const char* text) throw(): base (text) {} \
exp name (const std::string &text) throw(): base (text) {} \
exp name (std::stringstream &text) throw(): base (text) {} \
exp ~name() throw() { } \
inline name() throw(): base (0) {} \
inline name (const char* text) throw(): base (text) {} \
inline name (const std::string &text) throw(): base (text) {} \
inline name (std::stringstream &text) throw(): base (text) {} \
inline ~name() throw() { } \
};

// For backward compatibility.
Expand Down
6 changes: 6 additions & 0 deletions OpenEXR/IlmImf/ImfGenericInputFile.cpp
Expand Up @@ -41,6 +41,12 @@

OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER

GenericInputFile::~GenericInputFile ()
{}

GenericInputFile::GenericInputFile ()
{}

void GenericInputFile::readMagicNumberAndVersionField(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, int& version)
{
//
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfGenericInputFile.h
Expand Up @@ -46,11 +46,11 @@ class GenericInputFile
{
public:
IMF_EXPORT
virtual ~GenericInputFile() {}
virtual ~GenericInputFile();

protected:
IMF_EXPORT
GenericInputFile() {}
GenericInputFile();
IMF_EXPORT
void readMagicNumberAndVersionField(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, int& version);
};
Expand Down
10 changes: 7 additions & 3 deletions OpenEXR/IlmImf/ImfGenericOutputFile.cpp
Expand Up @@ -50,11 +50,15 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER

using namespace std;

GenericOutputFile::~GenericOutputFile ()
{}

GenericOutputFile::GenericOutputFile ()
{}


void
GenericOutputFile::writeMagicNumberAndVersionField (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os,
const Header& header)
GenericOutputFile::writeMagicNumberAndVersionField (
OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os, const Header& header)
{
OPENEXR_IMF_INTERNAL_NAMESPACE::Xdr::write <OPENEXR_IMF_INTERNAL_NAMESPACE::StreamIO> (os, MAGIC);

Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfGenericOutputFile.h
Expand Up @@ -49,11 +49,11 @@ class GenericOutputFile
{
public:
IMF_EXPORT
virtual ~GenericOutputFile() {}
virtual ~GenericOutputFile();

protected:
IMF_EXPORT
GenericOutputFile() {}
GenericOutputFile();
IMF_EXPORT
void writeMagicNumberAndVersionField (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os, const Header& header);
IMF_EXPORT
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfName.h
Expand Up @@ -77,9 +77,9 @@ class Name
// Access to the string
//---------------------

IMF_EXPORT
inline
const char * text () const {return _text;}
IMF_EXPORT
inline
const char * operator * () const {return _text;}

//---------------
Expand Down
12 changes: 6 additions & 6 deletions OpenEXR/IlmImf/ImfPreviewImage.h
Expand Up @@ -109,26 +109,26 @@ class PreviewImage
// Access to width, height and to the pixel array
//-----------------------------------------------

IMF_EXPORT
inline
unsigned int width () const {return _width;}
IMF_EXPORT
inline
unsigned int height () const {return _height;}

IMF_EXPORT
inline
PreviewRgba * pixels () {return _pixels;}
IMF_EXPORT
inline
const PreviewRgba * pixels () const {return _pixels;}


//----------------------------
// Access to individual pixels
//----------------------------

IMF_EXPORT
inline
PreviewRgba & pixel (unsigned int x, unsigned int y)
{return _pixels[y * _width + x];}

IMF_EXPORT
inline
const PreviewRgba & pixel (unsigned int x, unsigned int y) const
{return _pixels[y * _width + x];}

Expand Down
5 changes: 5 additions & 0 deletions OpenEXR/IlmImf/ImfStdIO.cpp
Expand Up @@ -375,5 +375,10 @@ StdOSStream::seekp (Int64 pos)
checkError (_os);
}

std::string
StdOSStream::str () const
{
return _os.str ();
}

OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfStdIO.h
Expand Up @@ -165,7 +165,7 @@ class StdOSStream: public OPENEXR_IMF_INTERNAL_NAMESPACE::OStream
virtual void seekp (Int64 pos);

IMF_EXPORT
std::string str () const {return _os.str();}
std::string str () const;

private:

Expand Down

0 comments on commit 3674dd2

Please sign in to comment.