Boost.Nowide
config.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2012 Artyom Beilis (Tonkikh)
3 // Copyright (c) 2019 - 2020 Alexander Grund
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE 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 // MinGW32 requires a __MSVCRT_VERSION__ defined to make some functions available, e.g. _stat64
21 // Hence define this here to target MSVC 7.0 which has the required functions and do it as early as possible
22 // as including a system header might default this to 0x0600 which is to low
23 #if defined(__MINGW32__) && !defined(__MSVCRT_VERSION__)
24 #define __MSVCRT_VERSION__ 0x0700
25 #endif
26 
27 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
28 #ifdef BOOST_NOWIDE_SOURCE
29 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_EXPORT
30 #else
31 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_IMPORT
32 #endif // BOOST_NOWIDE_SOURCE
33 #else
34 #define BOOST_NOWIDE_DECL
35 #endif // BOOST_NOWIDE_DYN_LINK
36 
37 //
38 // Automatically link to the correct build variant where possible.
39 //
40 #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NOWIDE_NO_LIB) && !defined(BOOST_NOWIDE_SOURCE)
41 //
42 // Set the name of our library, this will get undef'ed by auto_link.hpp
43 // once it's done with it:
44 //
45 #define BOOST_LIB_NAME boost_nowide
46 //
47 // If we're importing code from a dll, then tell auto_link.hpp about it:
48 //
49 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
50 #define BOOST_DYN_LINK
51 #endif
52 //
53 // And include the header that does the work:
54 //
55 #include <boost/config/auto_link.hpp>
56 #endif // auto-linking disabled
57 
59 
63 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
64 #define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 1
65 #else
66 #define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 0
67 #endif
68 
78 #if defined(BOOST_WINDOWS) || BOOST_NOWIDE_USE_WCHAR_OVERLOADS
79 #ifdef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
80 #undef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
81 #endif
82 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 1
83 #elif !defined(BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT)
84 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 0
85 #endif
86 
88 
89 #if BOOST_VERSION < 106500 && defined(BOOST_GCC) && __GNUC__ >= 7
90 #define BOOST_NOWIDE_FALLTHROUGH __attribute__((fallthrough))
91 #else
92 #define BOOST_NOWIDE_FALLTHROUGH BOOST_FALLTHROUGH
93 #endif
94 
96 
97 namespace boost {
104 namespace nowide {}
105 } // namespace boost
106 
107 #endif // boost/nowide/config.hpp