Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:49:03

0001 //
0002 // Copyright (c) 2012 Artyom Beilis (Tonkikh)
0003 // Copyright (c) 2019 - 2022 Alexander Grund
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // https://www.boost.org/LICENSE_1_0.txt
0007 
0008 #ifndef BOOST_NOWIDE_CONFIG_HPP_INCLUDED
0009 #define BOOST_NOWIDE_CONFIG_HPP_INCLUDED
0010 
0011 /// @file
0012 
0013 #include <boost/config.hpp>
0014 #include <boost/nowide/replacement.hpp>
0015 #include <boost/version.hpp>
0016 
0017 //! @cond Doxygen_Suppress
0018 
0019 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
0020 #ifdef BOOST_NOWIDE_SOURCE
0021 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_EXPORT
0022 #else
0023 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_IMPORT
0024 #endif // BOOST_NOWIDE_SOURCE
0025 #else
0026 #define BOOST_NOWIDE_DECL
0027 #endif // BOOST_NOWIDE_DYN_LINK
0028 
0029 // Automatically link to the correct build variant where possible.
0030 #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NOWIDE_NO_LIB) && !defined(BOOST_NOWIDE_SOURCE)
0031 //
0032 // Set the name of our library, this will get undef'ed by auto_link.hpp
0033 // once it's done with it:
0034 //
0035 #define BOOST_LIB_NAME boost_nowide
0036 //
0037 // If we're importing code from a dll, then tell auto_link.hpp about it:
0038 //
0039 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK)
0040 #define BOOST_DYN_LINK
0041 #endif
0042 //
0043 // And include the header that does the work:
0044 //
0045 #include <boost/config/auto_link.hpp>
0046 #endif // auto-linking disabled
0047 
0048 //! @endcond
0049 
0050 /// @def BOOST_NOWIDE_USE_WCHAR_OVERLOADS
0051 /// @brief Whether to use the wchar_t* overloads in fstream-classes.
0052 ///
0053 /// Enabled by default on Windows and Cygwin as the latter may use wchar_t in filesystem::path.
0054 #ifndef BOOST_NOWIDE_USE_WCHAR_OVERLOADS
0055 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(BOOST_NOWIDE_DOXYGEN)
0056 #define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 1
0057 #else
0058 #define BOOST_NOWIDE_USE_WCHAR_OVERLOADS 0
0059 #endif
0060 #endif
0061 
0062 /// @def BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
0063 /// @brief Define to 1 to use the class from <filebuf.hpp> that is used on Windows.
0064 ///
0065 /// - On Windows: No effect, always overwritten to 1
0066 /// - Others (including Cygwin): Defaults to the value of #BOOST_NOWIDE_USE_WCHAR_OVERLOADS if not set.
0067 ///
0068 /// When set to 0 boost::nowide::basic_filebuf will be an alias for std::basic_filebuf.
0069 ///
0070 /// Affects boost::nowide::basic_filebuf,
0071 /// boost::nowide::basic_ofstream, boost::nowide::basic_ifstream, boost::nowide::basic_fstream
0072 #if defined(BOOST_WINDOWS) || defined(BOOST_NOWIDE_DOXYGEN)
0073 #ifdef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
0074 #undef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
0075 #endif
0076 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 1
0077 #elif !defined(BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT)
0078 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT BOOST_NOWIDE_USE_WCHAR_OVERLOADS
0079 #endif
0080 
0081 //! @cond Doxygen_Suppress
0082 
0083 #if BOOST_VERSION < 106500 && defined(__GNUC__) && __GNUC__ >= 7
0084 #define BOOST_NOWIDE_FALLTHROUGH __attribute__((fallthrough))
0085 #else
0086 #define BOOST_NOWIDE_FALLTHROUGH BOOST_FALLTHROUGH
0087 #endif
0088 
0089 // The std::codecvt<char16/32_t, char, std::mbstate_t> are deprecated in C++20
0090 // These macros can suppress this warning
0091 #if defined(_MSC_VER)
0092 #define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_BEGIN __pragma(warning(push)) __pragma(warning(disable : 4996))
0093 #define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_END __pragma(warning(pop))
0094 #elif(__cplusplus >= 202002L) && defined(__clang__)
0095 #define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_BEGIN \
0096     _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
0097 #define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_END _Pragma("clang diagnostic pop")
0098 #elif(__cplusplus >= 202002L) && defined(__GNUC__)
0099 #define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_BEGIN \
0100     _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
0101 #define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_END _Pragma("GCC diagnostic pop")
0102 #else
0103 #define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_BEGIN
0104 #define BOOST_NOWIDE_SUPPRESS_UTF_CODECVT_DEPRECATION_END
0105 #endif
0106 
0107 //! @endcond
0108 
0109 namespace boost {
0110 ///
0111 /// \brief This namespace includes implementations of the standard library functions and
0112 /// classes such that they accept UTF-8 strings on Windows.
0113 /// On other platforms (i.e. not on Windows) those functions and classes are just aliases
0114 /// of the corresponding ones from the std namespace or behave like them.
0115 ///
0116 namespace nowide {}
0117 } // namespace boost
0118 
0119 #endif