Skip to content

Commit ddfaf00

Browse files
authored
Merge pull request #106 from boostorg/pr/exception-visibility
Mark exception classes as BOOST_SYMBOL_VISIBLE
2 parents ce6a40b + 7a7f0ce commit ddfaf00

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

include/boost/program_options/errors.hpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace boost { namespace program_options {
3535
}
3636

3737
/** Base class for all errors in the library. */
38-
class BOOST_PROGRAM_OPTIONS_DECL error : public std::logic_error {
38+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE error : public std::logic_error {
3939
public:
4040
error(const std::string& xwhat) : std::logic_error(xwhat) {}
4141
};
@@ -44,23 +44,23 @@ namespace boost { namespace program_options {
4444
/** Class thrown when there are too many positional options.
4545
This is a programming error.
4646
*/
47-
class BOOST_PROGRAM_OPTIONS_DECL too_many_positional_options_error : public error {
47+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE too_many_positional_options_error : public error {
4848
public:
4949
too_many_positional_options_error()
5050
: error("too many positional options have been specified on the command line")
5151
{}
5252
};
5353

5454
/** Class thrown when there are programming error related to style */
55-
class BOOST_PROGRAM_OPTIONS_DECL invalid_command_line_style : public error {
55+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE invalid_command_line_style : public error {
5656
public:
5757
invalid_command_line_style(const std::string& msg)
5858
: error(msg)
5959
{}
6060
};
6161

6262
/** Class thrown if config file can not be read */
63-
class BOOST_PROGRAM_OPTIONS_DECL reading_file : public error {
63+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE reading_file : public error {
6464
public:
6565
reading_file(const char* filename)
6666
: error(std::string("can not read options configuration file '").append(filename).append("'"))
@@ -91,7 +91,7 @@ namespace boost { namespace program_options {
9191
* or without a prefix (from a configuration file)
9292
*
9393
* */
94-
class BOOST_PROGRAM_OPTIONS_DECL error_with_option_name : public error {
94+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE error_with_option_name : public error {
9595

9696
protected:
9797
/** can be
@@ -204,7 +204,7 @@ namespace boost { namespace program_options {
204204

205205
/** Class thrown when there are several option values, but
206206
user called a method which cannot return them all. */
207-
class BOOST_PROGRAM_OPTIONS_DECL multiple_values : public error_with_option_name {
207+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE multiple_values : public error_with_option_name {
208208
public:
209209
multiple_values()
210210
: error_with_option_name("option '%canonical_option%' only takes a single argument"){}
@@ -215,7 +215,7 @@ namespace boost { namespace program_options {
215215
/** Class thrown when there are several occurrences of an
216216
option, but user called a method which cannot return
217217
them all. */
218-
class BOOST_PROGRAM_OPTIONS_DECL multiple_occurrences : public error_with_option_name {
218+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE multiple_occurrences : public error_with_option_name {
219219
public:
220220
multiple_occurrences()
221221
: error_with_option_name("option '%canonical_option%' cannot be specified more than once"){}
@@ -225,7 +225,7 @@ namespace boost { namespace program_options {
225225
};
226226

227227
/** Class thrown when a required/mandatory option is missing */
228-
class BOOST_PROGRAM_OPTIONS_DECL required_option : public error_with_option_name {
228+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE required_option : public error_with_option_name {
229229
public:
230230
// option name is constructed by the option_descriptor and never on the fly
231231
required_option(const std::string& option_name)
@@ -247,7 +247,7 @@ namespace boost { namespace program_options {
247247
* a lot easier, even if the name indicates some sort of conceptual dissonance!
248248
*
249249
* */
250-
class BOOST_PROGRAM_OPTIONS_DECL error_with_no_option_name : public error_with_option_name {
250+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE error_with_no_option_name : public error_with_option_name {
251251
public:
252252
error_with_no_option_name(const std::string& template_,
253253
const std::string& original_token = "")
@@ -263,7 +263,7 @@ namespace boost { namespace program_options {
263263

264264

265265
/** Class thrown when option name is not recognized. */
266-
class BOOST_PROGRAM_OPTIONS_DECL unknown_option : public error_with_no_option_name {
266+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE unknown_option : public error_with_no_option_name {
267267
public:
268268
unknown_option(const std::string& original_token = "")
269269
: error_with_no_option_name("unrecognised option '%canonical_option%'", original_token)
@@ -276,7 +276,7 @@ namespace boost { namespace program_options {
276276

277277

278278
/** Class thrown when there's ambiguity amoung several possible options. */
279-
class BOOST_PROGRAM_OPTIONS_DECL ambiguous_option : public error_with_no_option_name {
279+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE ambiguous_option : public error_with_no_option_name {
280280
public:
281281
ambiguous_option(const std::vector<std::string>& xalternatives)
282282
: error_with_no_option_name("option '%canonical_option%' is ambiguous"),
@@ -299,7 +299,7 @@ namespace boost { namespace program_options {
299299
/** Class thrown when there's syntax error either for command
300300
* line or config file options. See derived children for
301301
* concrete classes. */
302-
class BOOST_PROGRAM_OPTIONS_DECL invalid_syntax : public error_with_option_name {
302+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE invalid_syntax : public error_with_option_name {
303303
public:
304304
enum kind_t {
305305
long_not_allowed = 30,
@@ -332,7 +332,7 @@ namespace boost { namespace program_options {
332332
kind_t m_kind;
333333
};
334334

335-
class BOOST_PROGRAM_OPTIONS_DECL invalid_config_file_syntax : public invalid_syntax {
335+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE invalid_config_file_syntax : public invalid_syntax {
336336
public:
337337
invalid_config_file_syntax(const std::string& invalid_line, kind_t kind):
338338
invalid_syntax(kind)
@@ -348,7 +348,7 @@ namespace boost { namespace program_options {
348348

349349

350350
/** Class thrown when there are syntax errors in given command line */
351-
class BOOST_PROGRAM_OPTIONS_DECL invalid_command_line_syntax : public invalid_syntax {
351+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE invalid_command_line_syntax : public invalid_syntax {
352352
public:
353353
invalid_command_line_syntax(kind_t kind,
354354
const std::string& option_name = "",
@@ -360,7 +360,7 @@ namespace boost { namespace program_options {
360360

361361

362362
/** Class thrown when value of option is incorrect. */
363-
class BOOST_PROGRAM_OPTIONS_DECL validation_error : public error_with_option_name {
363+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE validation_error : public error_with_option_name {
364364
public:
365365
enum kind_t {
366366
multiple_values_not_allowed = 30,
@@ -391,7 +391,7 @@ namespace boost { namespace program_options {
391391
};
392392

393393
/** Class thrown if there is an invalid option value given */
394-
class BOOST_PROGRAM_OPTIONS_DECL invalid_option_value
394+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE invalid_option_value
395395
: public validation_error
396396
{
397397
public:
@@ -402,7 +402,7 @@ namespace boost { namespace program_options {
402402
};
403403

404404
/** Class thrown if there is an invalid bool value given */
405-
class BOOST_PROGRAM_OPTIONS_DECL invalid_bool_value
405+
class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE invalid_bool_value
406406
: public validation_error
407407
{
408408
public:

0 commit comments

Comments
 (0)