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 
18 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
19 #ifdef BOOST_NOWIDE_SOURCE
20 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_EXPORT
21 #else
22 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_IMPORT
23 #endif // BOOST_NOWIDE_SOURCE
24 #else
25 #define BOOST_NOWIDE_DECL
26 #endif // BOOST_NOWIDE_DYN_LINK
27 
28 //
29 // Automatically link to the correct build variant where possible.
30 //
31 #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NOWIDE_NO_LIB) && !defined(BOOST_NOWIDE_SOURCE)
32 //
33 // Set the name of our library, this will get undef'ed by auto_link.hpp
34 // once it's done with it:
35 //
36 #define BOOST_LIB_NAME boost_nowide
37 //
38 // If we're importing code from a dll, then tell auto_link.hpp about it:
39 //
40 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
41 #define BOOST_DYN_LINK
42 #endif
43 //
44 // And include the header that does the work:
45 //
46 #include <boost/config/auto_link.hpp>
47 #endif // auto-linking disabled
48 
52 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
53 #define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 1
54 #else
55 #define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 0
56 #endif
57 
67 #if defined(BOOST_WINDOWS) || BOOST_NOWIDE_USE_WCHAR_OVERLOADS
68 #ifdef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
69 #undef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
70 #endif
71 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 1
72 #elif !defined(BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT)
73 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 0
74 #endif
75 
76 #if BOOST_VERSION < 106500 && defined(BOOST_GCC) && __GNUC__ >= 7
77 #define BOOST_NOWIDE_FALLTHROUGH __attribute__((fallthrough))
78 #else
79 #define BOOST_NOWIDE_FALLTHROUGH BOOST_FALLTHROUGH
80 #endif
81 
82 // MSVC 2015 (1900) has reasonable C++11 support (especially auto-generated move ctors)
83 // libstdc++ < 5 does not support movable streams
84 #if(__cplusplus >= 201103L || (defined(BOOST_MSVC) && BOOST_MSVC >= 1900)) \
85  && (!defined(BOOST_LIBSTDCXX_VERSION) || BOOST_LIBSTDCXX_VERSION >= 50000)
86 #define BOOST_NOWIDE_CXX11 1
87 #else
88 #define BOOST_NOWIDE_CXX11 0
89 #endif
90 
91 namespace boost {
98 namespace nowide {}
99 } // namespace boost
100 
101 #endif // boost/nowide/config.hpp