]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/nowide/standalone/config.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / nowide / standalone / config.hpp
1 //
2 // Copyright (c) 2012 Artyom Beilis (Tonkikh)
3 // Copyright (c) 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 NOWIDE_CONFIG_HPP_INCLUDED
10 #define NOWIDE_CONFIG_HPP_INCLUDED
11
12 #include <boost/nowide/replacement.hpp>
13
14 // MinGW32 requires a __MSVCRT_VERSION__ defined to make some functions available, e.g. _stat64
15 // Hence define this here to target MSVC 7.0 which has the required functions and do it as early as possible
16 // as including a system header might default this to 0x0600 which is to low
17 #if defined(__MINGW32__) && !defined(__MSVCRT_VERSION__)
18 #define __MSVCRT_VERSION__ 0x0700
19 #endif
20
21 #if(defined(__WIN32) || defined(_WIN32) || defined(WIN32)) && !defined(__CYGWIN__)
22 #define NOWIDE_WINDOWS
23 #endif
24
25 #ifdef _MSC_VER
26 #define NOWIDE_MSVC _MSC_VER
27 #endif
28
29 #ifdef __GNUC__
30 #define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
31 #endif
32
33 #ifndef BOOST_SYMBOL_VISIBLE
34 #define BOOST_SYMBOL_VISIBLE
35 #endif
36
37 #ifdef NOWIDE_WINDOWS
38 #define BOOST_SYMBOL_EXPORT __declspec(dllexport)
39 #define BOOST_SYMBOL_IMPORT __declspec(dllimport)
40 #else
41 #define BOOST_SYMBOL_EXPORT BOOST_SYMBOL_VISIBLE
42 #define BOOST_SYMBOL_IMPORT
43 #endif
44
45 #if defined(BOOST_NOWIDE_DYN_LINK)
46 #ifdef BOOST_NOWIDE_SOURCE
47 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_EXPORT
48 #else
49 #define BOOST_NOWIDE_DECL BOOST_SYMBOL_IMPORT
50 #endif // BOOST_NOWIDE_SOURCE
51 #else
52 #define BOOST_NOWIDE_DECL
53 #endif // BOOST_NOWIDE_DYN_LINK
54
55 #ifndef NOWIDE_DECL
56 #define NOWIDE_DECL
57 #endif
58
59 #if defined(NOWIDE_WINDOWS)
60 #ifdef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
61 #undef BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT
62 #endif
63 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 1
64 #elif !defined(BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT)
65 #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 0
66 #endif
67
68 #if defined(__GNUC__) && __GNUC__ >= 7
69 #define BOOST_NOWIDE_FALLTHROUGH __attribute__((fallthrough))
70 #else
71 #define BOOST_NOWIDE_FALLTHROUGH
72 #endif
73
74 #if defined __GNUC__
75 #define BOOST_LIKELY(x) __builtin_expect(x, 1)
76 #define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
77 #else
78 #if !defined(BOOST_LIKELY)
79 #define BOOST_LIKELY(x) x
80 #endif
81 #if !defined(BOOST_UNLIKELY)
82 #define BOOST_UNLIKELY(x) x
83 #endif
84 #endif
85
86 #endif