File: 0002-Fix-visibility-of-exception-classes.patch

package info (click to toggle)
fastcdr 1.0.26-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,268 kB
  • sloc: cpp: 14,183; ansic: 77; makefile: 20; sh: 19
file content (228 lines) | stat: -rw-r--r-- 7,188 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
From: =?utf-8?q?Timo_R=C3=B6hling?= <timo@gaussglocke.de>
Date: Tue, 24 Nov 2020 10:38:48 +0100
Subject: Fix visibility of exception classes

Forwarded: https://github.com/eProsima/Fast-CDR/pull/88

C++ exceptions which are potentially thrown across DSO boundaries need
to have their type info exported.
---
 include/fastcdr/exceptions/BadParamException.h        | 16 ++++++++--------
 include/fastcdr/exceptions/Exception.h                | 18 +++++++++---------
 include/fastcdr/exceptions/NotEnoughMemoryException.h | 18 +++++++++---------
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/include/fastcdr/exceptions/BadParamException.h b/include/fastcdr/exceptions/BadParamException.h
index 95838ed..9c56748 100644
--- a/include/fastcdr/exceptions/BadParamException.h
+++ b/include/fastcdr/exceptions/BadParamException.h
@@ -24,7 +24,7 @@ namespace exception {
  * @brief This class is thrown as an exception when a invalid parameter was being serialized.
  * @ingroup EXCEPTIONMODULE
  */
-class BadParamException : public Exception
+class Cdr_DllAPI BadParamException : public Exception
 {
 public:
 
@@ -33,7 +33,7 @@ public:
      *
      * @param message A error message. This message pointer is copied.
      */
-    Cdr_DllAPI BadParamException(
+    BadParamException(
             const char* const& message) noexcept;
 
     /*!
@@ -41,7 +41,7 @@ public:
      *
      * @param ex BadParamException that will be copied.
      */
-    Cdr_DllAPI BadParamException(
+    BadParamException(
             const BadParamException& ex) noexcept;
 
 #if HAVE_CXX0X
@@ -50,7 +50,7 @@ public:
      *
      * @param ex BadParamException that will be moved.
      */
-    Cdr_DllAPI BadParamException(
+    BadParamException(
             BadParamException&& ex) noexcept;
 #endif // if HAVE_CXX0X
 
@@ -59,7 +59,7 @@ public:
      *
      * @param ex BadParamException that will be copied.
      */
-    Cdr_DllAPI BadParamException& operator =(
+    BadParamException& operator =(
             const BadParamException& ex) noexcept;
 
 #if HAVE_CXX0X
@@ -73,13 +73,13 @@ public:
 #endif // if HAVE_CXX0X
 
     //! @brief Default constructor
-    virtual Cdr_DllAPI ~BadParamException() noexcept;
+    virtual ~BadParamException() noexcept;
 
     //! @brief This function throws the object as exception.
-    virtual Cdr_DllAPI void raise() const;
+    virtual void raise() const;
 
     //! @brief Default message used in the library.
-    static Cdr_DllAPI const char* const BAD_PARAM_MESSAGE_DEFAULT;
+    static const char* const BAD_PARAM_MESSAGE_DEFAULT;
 };
 }         //namespace exception
 }     //namespace fastcdr
diff --git a/include/fastcdr/exceptions/Exception.h b/include/fastcdr/exceptions/Exception.h
index b371332..d9de9e6 100644
--- a/include/fastcdr/exceptions/Exception.h
+++ b/include/fastcdr/exceptions/Exception.h
@@ -26,22 +26,22 @@ namespace exception {
  * @brief This abstract class is used to create exceptions.
  * @ingroup EXCEPTIONMODULE
  */
-class Exception : public std::exception
+class Cdr_DllAPI Exception : public std::exception
 {
 public:
 
     //! \brief Default destructor.
-    virtual Cdr_DllAPI ~Exception() noexcept;
+    virtual ~Exception() noexcept;
 
     //! \brief This function throws the object as exception.
-    virtual Cdr_DllAPI void raise() const = 0;
+    virtual void raise() const = 0;
 
     /*!
      * @brief This function returns the error message.
      *
      * @return The error message.
      */
-    virtual Cdr_DllAPI const char* what() const noexcept override;
+    virtual const char* what() const noexcept override;
 
 protected:
 
@@ -50,7 +50,7 @@ protected:
      *
      * @param message A error message. This message pointer is copied.
      */
-    Cdr_DllAPI Exception(
+    Exception(
             const char* const& message) noexcept;
 
     /*!
@@ -58,7 +58,7 @@ protected:
      *
      * @param ex Exception that will be copied.
      */
-    Cdr_DllAPI Exception(
+    Exception(
             const Exception& ex) noexcept;
 
 #if HAVE_CXX0X
@@ -67,7 +67,7 @@ protected:
      *
      * @param ex Exception that will be moved.
      */
-    Cdr_DllAPI Exception(
+    Exception(
             Exception&& ex) noexcept;
 #endif // if HAVE_CXX0X
 
@@ -76,7 +76,7 @@ protected:
      *
      * @param ex Exception that will be copied.
      */
-    Cdr_DllAPI Exception& operator =(
+    Exception& operator =(
             const Exception& ex) noexcept;
 
 #if HAVE_CXX0X
@@ -85,7 +85,7 @@ protected:
      *
      * @param ex Exception that will be moved.
      */
-    Cdr_DllAPI Exception& operator =(
+    Exception& operator =(
             Exception&&) noexcept;
 #endif // if HAVE_CXX0X
 
diff --git a/include/fastcdr/exceptions/NotEnoughMemoryException.h b/include/fastcdr/exceptions/NotEnoughMemoryException.h
index 3a190c5..06377d2 100644
--- a/include/fastcdr/exceptions/NotEnoughMemoryException.h
+++ b/include/fastcdr/exceptions/NotEnoughMemoryException.h
@@ -24,7 +24,7 @@ namespace exception {
  * @brief This class is thrown as an exception when the buffer's internal memory reachs its size limit.
  * @ingroup EXCEPTIONMODULE
  */
-class NotEnoughMemoryException : public Exception
+class Cdr_DllAPI NotEnoughMemoryException : public Exception
 {
 public:
 
@@ -33,7 +33,7 @@ public:
      *
      * @param message A error message. This message pointer is copied.
      */
-    Cdr_DllAPI NotEnoughMemoryException(
+    NotEnoughMemoryException(
             const char* const& message) noexcept;
 
     /*!
@@ -41,7 +41,7 @@ public:
      *
      * @param ex NotEnoughMemoryException that will be copied.
      */
-    Cdr_DllAPI NotEnoughMemoryException(
+    NotEnoughMemoryException(
             const NotEnoughMemoryException& ex) noexcept;
 
 #if HAVE_CXX0X
@@ -50,7 +50,7 @@ public:
      *
      * @param ex NotEnoughMemoryException that will be moved.
      */
-    Cdr_DllAPI NotEnoughMemoryException(
+    NotEnoughMemoryException(
             NotEnoughMemoryException&& ex) noexcept;
 #endif // if HAVE_CXX0X
 
@@ -59,7 +59,7 @@ public:
      *
      * @param ex NotEnoughMemoryException that will be copied.
      */
-    Cdr_DllAPI NotEnoughMemoryException& operator =(
+    NotEnoughMemoryException& operator =(
             const NotEnoughMemoryException& ex) noexcept;
 
 #if HAVE_CXX0X
@@ -68,18 +68,18 @@ public:
      *
      * @param ex NotEnoughMemoryException that will be moved.
      */
-    Cdr_DllAPI NotEnoughMemoryException& operator =(
+    NotEnoughMemoryException& operator =(
             NotEnoughMemoryException&& ex) noexcept;
 #endif // if HAVE_CXX0X
 
     //! @brief Default constructor
-    virtual Cdr_DllAPI ~NotEnoughMemoryException() noexcept;
+    virtual ~NotEnoughMemoryException() noexcept;
 
     //! @brief This function throws the object as exception.
-    virtual Cdr_DllAPI void raise() const override;
+    virtual void raise() const override;
 
     //! @brief Default message used in the library.
-    static Cdr_DllAPI const char* const NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT;
+    static const char* const NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT;
 };
 }         //namespace exception
 }     //namespace fastcdr