Fix #644. Export specializations of BasicError
- Only export BasicError::setMsg which is the only implementation present in the .cpp - Only export BasicError specialization on __APPLE__ It seems that gcc automatically adds the attribute when the visibility settings are set to hidden. See this link for more information: https://reviews.llvm.org/D35388
This commit is contained in:
@@ -13,8 +13,10 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace Exiv2 {
|
||||
std::basic_string<charT> arg3_; //!< Third argument
|
||||
std::string msg_; //!< Complete error message
|
||||
#ifdef EXV_UNICODE_PATH
|
||||
std::wstring wmsg_; //!< Complete error message as a wide string
|
||||
std::wstring wmsg_; //!< Complete error message as a wide string
|
||||
#endif
|
||||
}; // class BasicError
|
||||
|
||||
@@ -389,6 +389,7 @@ namespace Exiv2 {
|
||||
return wmsg_.c_str();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( default : 4275 )
|
||||
#endif
|
||||
|
||||
+4
-2
@@ -224,7 +224,6 @@ namespace Exiv2 {
|
||||
{
|
||||
}
|
||||
|
||||
//! @cond IGNORE
|
||||
template<>
|
||||
void BasicError<char>::setMsg()
|
||||
{
|
||||
@@ -257,7 +256,9 @@ namespace Exiv2 {
|
||||
wmsg_ = s2ws(msg);
|
||||
#endif
|
||||
}
|
||||
//! @endcond
|
||||
#ifdef __APPLE__
|
||||
template class EXIV2API BasicError<char>;
|
||||
#endif
|
||||
|
||||
#ifdef EXV_UNICODE_PATH
|
||||
template<>
|
||||
@@ -291,6 +292,7 @@ namespace Exiv2 {
|
||||
wmsg_ = wmsg;
|
||||
msg_ = ws2s(wmsg);
|
||||
}
|
||||
template class EXIV2API BasicError<wchar_t>;
|
||||
#endif
|
||||
|
||||
const char* errMsg(int code)
|
||||
|
||||
Reference in New Issue
Block a user