From ae33d629786717178492867cc7a22b66039d3491 Mon Sep 17 00:00:00 2001 From: Leandro Benedet Garcia Date: Wed, 27 Nov 2019 15:25:25 -0300 Subject: [PATCH] general: Update EXPCL declarations to be MinGW-friendly (#792) --- .gitignore | 3 +++ dtool/src/dtoolutil/textEncoder.h | 3 +-- panda/src/bullet/bulletDebugNode.h | 2 +- panda/src/express/virtualFileMountRamdisk.h | 6 ++--- panda/src/gobj/geom.h | 2 +- panda/src/gobj/lens.h | 2 +- panda/src/gobj/vertexDataSaveFile.cxx | 2 +- panda/src/pnmimage/convert_srgb.h | 28 +++++++++------------ 8 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index de3e59aef4..cec770566c 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,6 @@ __pycache__/ .tox/ .cache/ .pytest_cache/ +/.settings/ +/.cproject +/.project diff --git a/dtool/src/dtoolutil/textEncoder.h b/dtool/src/dtoolutil/textEncoder.h index 1e1d9eeda4..217f52d271 100644 --- a/dtool/src/dtoolutil/textEncoder.h +++ b/dtool/src/dtoolutil/textEncoder.h @@ -151,8 +151,7 @@ operator >> (std::istream &in, TextEncoder::Encoding &encoding); // This function is declared inline to minimize the risk of link conflicts // should another third-party module also define the same output operator. -INLINE EXPCL_DTOOL_DTOOLUTIL std::ostream & -operator << (std::ostream &out, const std::wstring &str); +INLINE std::ostream & operator << (std::ostream &out, const std::wstring &str); #include "textEncoder.I" diff --git a/panda/src/bullet/bulletDebugNode.h b/panda/src/bullet/bulletDebugNode.h index f42bd4722d..2426cdac63 100644 --- a/panda/src/bullet/bulletDebugNode.h +++ b/panda/src/bullet/bulletDebugNode.h @@ -74,7 +74,7 @@ private: UnalignedLVecBase4 _color; }; - class DebugDraw : public btIDebugDraw { + class EXPCL_PANDABULLET DebugDraw : public btIDebugDraw { public: DebugDraw() {}; diff --git a/panda/src/express/virtualFileMountRamdisk.h b/panda/src/express/virtualFileMountRamdisk.h index ae87105473..ad51e2da98 100644 --- a/panda/src/express/virtualFileMountRamdisk.h +++ b/panda/src/express/virtualFileMountRamdisk.h @@ -65,7 +65,7 @@ private: class File; class Directory; - class FileBase : public TypedReferenceCount { + class EXPCL_PANDA_EXPRESS FileBase : public TypedReferenceCount { public: INLINE FileBase(const std::string &basename); virtual ~FileBase(); @@ -94,7 +94,7 @@ private: static TypeHandle _type_handle; }; - class File : public FileBase { + class EXPCL_PANDA_EXPRESS File : public FileBase { public: INLINE File(const std::string &basename); @@ -121,7 +121,7 @@ private: typedef pset > Files; - class Directory : public FileBase { + class EXPCL_PANDA_EXPRESS Directory : public FileBase { public: INLINE Directory(const std::string &basename); diff --git a/panda/src/gobj/geom.h b/panda/src/gobj/geom.h index a1e0b960e4..a51f5847f6 100644 --- a/panda/src/gobj/geom.h +++ b/panda/src/gobj/geom.h @@ -295,7 +295,7 @@ public: } private: - static TypeHandle _type_handle; + static EXPCL_PANDA_GOBJ TypeHandle _type_handle; }; typedef pmap > Cache; diff --git a/panda/src/gobj/lens.h b/panda/src/gobj/lens.h index b0ac72d907..22b7fece23 100644 --- a/panda/src/gobj/lens.h +++ b/panda/src/gobj/lens.h @@ -399,7 +399,7 @@ private: static TypeHandle _type_handle; }; -EXPCL_PANDA_GOBJ INLINE std::ostream &operator << (std::ostream &out, const Lens &lens); +INLINE std::ostream &operator << (std::ostream &out, const Lens &lens); #include "lens.I" diff --git a/panda/src/gobj/vertexDataSaveFile.cxx b/panda/src/gobj/vertexDataSaveFile.cxx index 37839099dc..1cc96719c7 100644 --- a/panda/src/gobj/vertexDataSaveFile.cxx +++ b/panda/src/gobj/vertexDataSaveFile.cxx @@ -313,7 +313,7 @@ read_data(unsigned char *data, size_t size, VertexDataSaveBlock *block) { } success = GetOverlappedResult(_handle, &overlapped, &bytes_read, false); } - nassertr(bytes_read == size, nullptr); + nassertr(bytes_read == size, false); double finish_time = ClockObject::get_global_clock()->get_real_time(); if (gobj_cat.is_debug()) { gobj_cat.debug() diff --git a/panda/src/pnmimage/convert_srgb.h b/panda/src/pnmimage/convert_srgb.h index 86bc8b07bf..2ae71f571a 100644 --- a/panda/src/pnmimage/convert_srgb.h +++ b/panda/src/pnmimage/convert_srgb.h @@ -27,29 +27,25 @@ extern EXPCL_PANDA_PNMIMAGE const float to_linear_float_table[256]; BEGIN_PUBLISH -EXPCL_PANDA_PNMIMAGE INLINE float decode_sRGB_float(unsigned char val); -EXPCL_PANDA_PNMIMAGE INLINE float decode_sRGB_float(float val); -EXPCL_PANDA_PNMIMAGE INLINE unsigned char decode_sRGB_uchar(unsigned char val); -EXPCL_PANDA_PNMIMAGE INLINE unsigned char decode_sRGB_uchar(float val); +INLINE float decode_sRGB_float(unsigned char val); +INLINE float decode_sRGB_float(float val); +INLINE unsigned char decode_sRGB_uchar(unsigned char val); +INLINE unsigned char decode_sRGB_uchar(float val); -EXPCL_PANDA_PNMIMAGE INLINE float encode_sRGB_float(unsigned char val); -EXPCL_PANDA_PNMIMAGE INLINE float encode_sRGB_float(float val); -EXPCL_PANDA_PNMIMAGE INLINE unsigned char encode_sRGB_uchar(unsigned char val); -EXPCL_PANDA_PNMIMAGE INLINE unsigned char encode_sRGB_uchar(float val); +INLINE float encode_sRGB_float(unsigned char val); +INLINE float encode_sRGB_float(float val); +INLINE unsigned char encode_sRGB_uchar(unsigned char val); +INLINE unsigned char encode_sRGB_uchar(float val); END_PUBLISH // These functions convert more than one component in one go, which can be // faster due to vectorization. -EXPCL_PANDA_PNMIMAGE INLINE void encode_sRGB_uchar(const LColorf &from, - xel &into); -EXPCL_PANDA_PNMIMAGE INLINE void encode_sRGB_uchar(const LColorf &from, - xel &into, xelval &into_alpha); +INLINE void encode_sRGB_uchar(const LColorf &from, xel &into); +INLINE void encode_sRGB_uchar(const LColorf &from, xel &into, xelval &into_alpha); -EXPCL_PANDA_PNMIMAGE INLINE void encode_sRGB_uchar(const LColord &from, - xel &into); -EXPCL_PANDA_PNMIMAGE INLINE void encode_sRGB_uchar(const LColord &from, - xel &into, xelval &into_alpha); +INLINE void encode_sRGB_uchar(const LColord &from, xel &into); +INLINE void encode_sRGB_uchar(const LColord &from, xel &into, xelval &into_alpha); // Use these functions if you know that SSE2 support is available. Otherwise, // they will crash!