Removed
Link Here
|
1 |
Slightly modified: |
2 |
|
3 |
From 04c9b181cc2c7741fcb134ccc43f2bafc1f86f19 Mon Sep 17 00:00:00 2001 |
4 |
From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= <piponazo@gmail.com> |
5 |
Date: Sat, 12 Jan 2019 12:15:27 +0000 |
6 |
Subject: [PATCH] Fix #644. Export specializations of BasicError |
7 |
|
8 |
- Only export BasicError::setMsg which is the only implementation present in the .cpp |
9 |
- Only export BasicError specialization on __APPLE__ |
10 |
|
11 |
It seems that gcc automatically adds the attribute when the visibility |
12 |
settings are set to hidden. See this link for more information: |
13 |
https://reviews.llvm.org/D35388 |
14 |
--- |
15 |
cmake/mainSetup.cmake | 6 ++++-- |
16 |
include/exiv2/error.hpp | 3 ++- |
17 |
src/error.cpp | 6 ++++-- |
18 |
3 files changed, 10 insertions(+), 5 deletions(-) |
19 |
|
20 |
diff --git a/cmake/mainSetup.cmake b/cmake/mainSetup.cmake |
21 |
index 05c16004d..a4d983d4c 100644 |
22 |
--- cmake/mainSetup.cmake |
23 |
+++ cmake/mainSetup.cmake |
24 |
@@ -13,8 +13,10 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
25 |
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) |
26 |
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) |
27 |
|
28 |
-set(CMAKE_CXX_VISIBILITY_PRESET hidden) |
29 |
-set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) |
30 |
+if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
31 |
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden) |
32 |
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) |
33 |
+endif() |
34 |
|
35 |
set(CMAKE_CXX_STANDARD 98) |
36 |
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
37 |
diff --git a/include/exiv2/error.hpp b/include/exiv2/error.hpp |
38 |
index 0f9714e5b..42a0959c4 100644 |
39 |
--- include/exiv2/error.hpp |
40 |
+++ include/exiv2/error.hpp |
41 |
@@ -315,7 +315,7 @@ namespace Exiv2 { |
42 |
std::basic_string<charT> arg3_; //!< Third argument |
43 |
std::string msg_; //!< Complete error message |
44 |
#ifdef EXV_UNICODE_PATH |
45 |
- std::wstring wmsg_; //!< Complete error message as a wide string |
46 |
+ std::wstring wmsg_; //!< Complete error message as a wide string |
47 |
#endif |
48 |
}; // class BasicError |
49 |
|
50 |
@@ -389,6 +389,7 @@ namespace Exiv2 { |
51 |
return wmsg_.c_str(); |
52 |
} |
53 |
#endif |
54 |
+ |
55 |
#ifdef _MSC_VER |
56 |
# pragma warning( default : 4275 ) |
57 |
#endif |
58 |
diff --git a/src/error.cpp b/src/error.cpp |
59 |
index 6d3a24bd8..c8e2d9e0d 100644 |
60 |
--- src/error.cpp |
61 |
+++ src/error.cpp |
62 |
@@ -224,7 +224,6 @@ namespace Exiv2 { |
63 |
{ |
64 |
} |
65 |
|
66 |
- //! @cond IGNORE |
67 |
template<> |
68 |
void BasicError<char>::setMsg() |
69 |
{ |
70 |
@@ -257,7 +256,9 @@ namespace Exiv2 { |
71 |
wmsg_ = s2ws(msg); |
72 |
#endif |
73 |
} |
74 |
- //! @endcond |
75 |
+#ifdef __FreeBSD__ |
76 |
+ template class EXIV2API BasicError<char>; |
77 |
+#endif |
78 |
|
79 |
#ifdef EXV_UNICODE_PATH |
80 |
template<> |
81 |
@@ -291,6 +292,7 @@ namespace Exiv2 { |
82 |
wmsg_ = wmsg; |
83 |
msg_ = ws2s(wmsg); |
84 |
} |
85 |
+ template class EXIV2API BasicError<wchar_t>; |
86 |
#endif |
87 |
|
88 |
const char* errMsg(int code) |