Boost.Nowide

config.hpp
Go to the documentation of this file.
1//
2// Copyright (c) 2012 Artyom Beilis (Tonkikh)
3// Copyright (c) 2019 - 2022 Alexander Grund
4//
5// Distributed under the Boost Software License, Version 1.0.
6// https://www.boost.org/LICENSE_1_0.txt
7
8#ifndef BOOST_NOWIDE_CONFIG_HPP_INCLUDED
9#define BOOST_NOWIDE_CONFIG_HPP_INCLUDED
10
12
13#include <boost/config.hpp>
14#include <boost/nowide/replacement.hpp>
15#include <boost/version.hpp>
16
18
19#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
20#ifdef BOOST_NOWIDE_SOURCE
21#define BOOST_NOWIDE_DECL BOOST_SYMBOL_EXPORT
22#else
23#define BOOST_NOWIDE_DECL BOOST_SYMBOL_IMPORT
24#endif // BOOST_NOWIDE_SOURCE
25#else
26#define BOOST_NOWIDE_DECL
27#endif // BOOST_NOWIDE_DYN_LINK
28
29// Automatically link to the correct build variant where possible.
30#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NOWIDE_NO_LIB) && !defined(BOOST_NOWIDE_SOURCE)
31//
32// Set the name of our library, this will get undef'ed by auto_link.hpp
33// once it's done with it:
34//
35#define BOOST_LIB_NAME boost_nowide
36//
37// If we're importing code from a dll, then tell auto_link.hpp about it:
38//
39#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
40#define BOOST_DYN_LINK
41#endif
42//
43// And include the header that does the work:
44//
45#include <boost/config/auto_link.hpp>
46#endif // auto-linking disabled
47
49
54#ifndef BOOST_NOWIDE_USE_WCHAR_OVERLOADS
55#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(BOOST_NOWIDE_DOXYGEN)
56#define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 1
57#else
58#define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 0
59#endif
60#endif
61
72#if defined(BOOST_WINDOWS) || defined(BOOST_NOWIDE_DOXYGEN)
73#ifdef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
74#undef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
75#endif
76#define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 1
77#elif !defined(BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT)
78#define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT BOOST_NOWIDE_USE_WCHAR_OVERLOADS
79#endif
80
82
83#if BOOST_VERSION < 106500 && defined(__GNUC__) && __GNUC__ >= 7
84#define BOOST_NOWIDE_FALLTHROUGH __attribute__((fallthrough))
85#else
86#define BOOST_NOWIDE_FALLTHROUGH BOOST_FALLTHROUGH
87#endif
88
89// The std::codecvt<char16/32_t, char, std::mbstate_t> are deprecated in C++20
90// These macros can suppress this warning
91#if defined(_MSC_VER)
92#define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_BEGIN __pragma(warning(push)) __pragma(warning(disable : 4996))
93#define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_END __pragma(warning(pop))
94#elif(__cplusplus >= 202002L) && defined(__clang__)
95#define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_BEGIN \
96 _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
97#define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_END _Pragma("clang diagnostic pop")
98#elif(__cplusplus >= 202002L) && defined(__GNUC__)
99#define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_BEGIN \
100 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
101#define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_END _Pragma("GCC diagnostic pop")
102#else
103#define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_BEGIN
104#define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_END
105#endif
106
108
109 namespace boost {
116 namespace nowide {}
117} // namespace boost
118
119#endif
replacement.hpp