Skip to content

Commit f941ba8

Browse files
committed
Avoid macro redefinition warnings
1 parent dbec456 commit f941ba8

11 files changed

+33
-14
lines changed

src/cmdline.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// (See accompanying file LICENSE_1_0.txt
44
// or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define BOOST_PROGRAM_OPTIONS_SOURCE
6+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
7+
# define BOOST_PROGRAM_OPTIONS_SOURCE
8+
#endif
79
#include <boost/program_options/config.hpp>
810

911
#include <boost/config.hpp>

src/config_file.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
// (See accompanying file LICENSE_1_0.txt
44
// or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
7-
#define BOOST_PROGRAM_OPTIONS_SOURCE
6+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
7+
# define BOOST_PROGRAM_OPTIONS_SOURCE
8+
#endif
89
#include <boost/program_options/config.hpp>
910

1011
#include <boost/program_options/detail/config_file.hpp>

src/convert.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
#include <boost/config.hpp>
1515

16-
#define BOOST_PROGRAM_OPTIONS_SOURCE
16+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
17+
# define BOOST_PROGRAM_OPTIONS_SOURCE
18+
#endif
1719
#include <boost/program_options/config.hpp>
1820
#include <boost/program_options/detail/convert.hpp>
1921
#include <boost/program_options/detail/utf8_codecvt_facet.hpp>

src/options_description.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
// (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7-
8-
#define BOOST_PROGRAM_OPTIONS_SOURCE
7+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
8+
# define BOOST_PROGRAM_OPTIONS_SOURCE
9+
#endif
910
#include <boost/program_options/config.hpp>
1011
#include <boost/program_options/options_description.hpp>
1112
// FIXME: this is only to get multiple_occurrences class

src/parsers.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
#include <boost/config.hpp>
88

9-
#define BOOST_PROGRAM_OPTIONS_SOURCE
9+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
10+
# define BOOST_PROGRAM_OPTIONS_SOURCE
11+
#endif
1012
#include <boost/program_options/config.hpp>
1113
#include <boost/program_options/parsers.hpp>
1214
#include <boost/program_options/options_description.hpp>

src/positional_options.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// (See accompanying file LICENSE_1_0.txt
44
// or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define BOOST_PROGRAM_OPTIONS_SOURCE
6+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
7+
# define BOOST_PROGRAM_OPTIONS_SOURCE
8+
#endif
79
#include <boost/program_options/config.hpp>
810

911
#include <boost/program_options/positional_options.hpp>

src/split.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// (See accompanying file LICENSE_1_0.txt
44
// or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define BOOST_PROGRAM_OPTIONS_SOURCE
6+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
7+
# define BOOST_PROGRAM_OPTIONS_SOURCE
8+
#endif
79

810
#include <boost/program_options/parsers.hpp>
911
#include <boost/tokenizer.hpp>

src/utf8_codecvt_facet.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// (See accompanying file LICENSE_1_0.txt
44
// or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define BOOST_PROGRAM_OPTIONS_SOURCE
6+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
7+
# define BOOST_PROGRAM_OPTIONS_SOURCE
8+
#endif
79
#include <boost/program_options/config.hpp>
810

911
#define BOOST_UTF8_BEGIN_NAMESPACE \

src/value_semantic.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// (See accompanying file LICENSE_1_0.txt
44
// or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define BOOST_PROGRAM_OPTIONS_SOURCE
6+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
7+
# define BOOST_PROGRAM_OPTIONS_SOURCE
8+
#endif
79
#include <boost/program_options/config.hpp>
810
#include <boost/program_options/value_semantic.hpp>
911
#include <boost/program_options/detail/convert.hpp>

src/variables_map.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
// (See accompanying file LICENSE_1_0.txt
44
// or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
7-
#define BOOST_PROGRAM_OPTIONS_SOURCE
6+
#ifndef BOOST_PROGRAM_OPTIONS_SOURCE
7+
# define BOOST_PROGRAM_OPTIONS_SOURCE
8+
#endif
89
#include <boost/program_options/config.hpp>
910
#include <boost/program_options/parsers.hpp>
1011
#include <boost/program_options/options_description.hpp>

0 commit comments

Comments
 (0)