Skip to content

Commit 2acfab1

Browse files
DanielaEvprus
authored andcommitted
Fix config_file compilation errors with MSVC
Previous fix 4ae33c for ticket #6797 introduced a new problem with Visual Studio compilers about two missing methods in 'common_config_file_iterator'. Adding those seemingly not required methods as empty methods fixes the issue. As an added bonus, the bogus warnings about DLL-interfaces get a silencing treatment, too. Tests were run with vc10, vc11, and vc12. Without this fix, the affected test cases fail on all 3 compilers. With the fix in place, all tests pass. Signed-off-by: Daniela Engert <[email protected]>
1 parent 4ae33ce commit 2acfab1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/boost/program_options/detail/config_file.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#include <boost/type_traits/is_same.hpp>
2828
#include <boost/shared_ptr.hpp>
2929

30+
#ifdef BOOST_MSVC
31+
# pragma warning(push)
32+
# pragma warning(disable: 4251) // class XYZ needs to have dll-interface to be used by clients of class XYZ
33+
#endif
34+
3035

3136

3237
namespace boost { namespace program_options { namespace detail {
@@ -77,6 +82,11 @@ namespace boost { namespace program_options { namespace detail {
7782

7883
void get();
7984

85+
#if BOOST_WORKAROUND(_MSC_VER, <= 1800)
86+
void decrement() {}
87+
void advance(difference_type) {}
88+
#endif
89+
8090
protected: // Stubs for derived classes
8191

8292
// Obtains next line from the config file
@@ -177,4 +187,8 @@ namespace boost { namespace program_options { namespace detail {
177187

178188
}}}
179189

190+
#ifdef BOOST_MSVC
191+
# pragma warning(pop)
192+
#endif
193+
180194
#endif

0 commit comments

Comments
 (0)