Boost.Nowide
config.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2012 Artyom Beilis (Tonkikh)
3 // Copyright (c) 2019 Alexander Grund
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9 #ifndef BOOST_NOWIDE_CONFIG_HPP_INCLUDED
10 #define BOOST_NOWIDE_CONFIG_HPP_INCLUDED
11 
13 
14 #include <boost/config.hpp>
16 #include <boost/version.hpp>
17 
19 
20 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
21 #ifdef BOOST_NOWIDE_SOURCE
22 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_EXPORT
23 #else
24 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_IMPORT
25 #endif // BOOST_NOWIDE_SOURCE
26 #else
27 #define BOOST_NOWIDE_DECL
28 #endif // BOOST_NOWIDE_DYN_LINK
29 
30 //
31 // Automatically link to the correct build variant where possible.
32 //
33 #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NOWIDE_NO_LIB) && !defined(BOOST_NOWIDE_SOURCE)
34 //
35 // Set the name of our library, this will get undef'ed by auto_link.hpp
36 // once it's done with it:
37 //
38 #define BOOST_LIB_NAME boost_nowide
39 //
40 // If we're importing code from a dll, then tell auto_link.hpp about it:
41 //
42 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
43 #define BOOST_DYN_LINK
44 #endif
45 //
46 // And include the header that does the work:
47 //
48 #include <boost/config/auto_link.hpp>
49 #endif // auto-linking disabled
50 
52 
56 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
57 #define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 1
58 #else
59 #define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 0
60 #endif
61 
71 #if defined(BOOST_WINDOWS) || BOOST_NOWIDE_USE_WCHAR_OVERLOADS
72 #ifdef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
73 #undef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
74 #endif
75 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 1
76 #elif !defined(BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT)
77 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 0
78 #endif
79 
81 
82 #if BOOST_VERSION < 106500 && defined(BOOST_GCC) && __GNUC__ >= 7
83 #define BOOST_NOWIDE_FALLTHROUGH __attribute__((fallthrough))
84 #else
85 #define BOOST_NOWIDE_FALLTHROUGH BOOST_FALLTHROUGH
86 #endif
87 
88 // MSVC 2015 (1900) has reasonable C++11 support (especially auto-generated move ctors)
89 // libstdc++ < 5 does not support movable streams
90 #if(__cplusplus >= 201103L || (defined(BOOST_MSVC) && BOOST_MSVC >= 1900)) \
91  && (!defined(BOOST_LIBSTDCXX_VERSION) || BOOST_LIBSTDCXX_VERSION >= 50000)
92 #define BOOST_NOWIDE_CXX11 1
93 #else
94 #define BOOST_NOWIDE_CXX11 0
95 #endif
96 
98 
99 namespace boost {
106 namespace nowide {}
107 } // namespace boost
108 
109 #endif // boost/nowide/config.hpp