aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted/boost/locale/src/util/foreach_char.hpp
blob: 1c0dc35ff0142d5faf9c061455e300dec608d25e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Copyright (c) 2023-2023 Alexander Grund
//
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt

#ifndef BOOST_LOCALE_UTIL_FOREACH_CHAR_HPP
#define BOOST_LOCALE_UTIL_FOREACH_CHAR_HPP

#include <boost/locale/config.hpp>

#ifdef __cpp_lib_char8_t
#    define BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F) F(char8_t)
#    define BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F) F(char8_t)
#elif defined(__cpp_char8_t)
#    define BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F) F(char8_t)
#    define BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F)
#else
#    define BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F)
#    define BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F)
#endif
#ifdef BOOST_LOCALE_ENABLE_CHAR16_T
#    define BOOST_LOCALE_FOREACH_CHAR_I_CHAR16_T(F) F(char16_t)
#else
#    define BOOST_LOCALE_FOREACH_CHAR_I_CHAR16_T(F)
#endif
#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
#    define BOOST_LOCALE_FOREACH_CHAR_I_CHAR32_T(F) F(char32_t)
#else
#    define BOOST_LOCALE_FOREACH_CHAR_I_CHAR32_T(F)
#endif

#define BOOST_LOCALE_FOREACH_CHAR(F)        \
    F(char)                                 \
    F(wchar_t)                              \
    BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F)  \
    BOOST_LOCALE_FOREACH_CHAR_I_CHAR16_T(F) \
    BOOST_LOCALE_FOREACH_CHAR_I_CHAR32_T(F)

// Same but only where std::basic_string<C> is available
#define BOOST_LOCALE_FOREACH_CHAR_STRING(F) \
    F(char)                                 \
    F(wchar_t)                              \
    BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F) \
    BOOST_LOCALE_FOREACH_CHAR_I_CHAR16_T(F) \
    BOOST_LOCALE_FOREACH_CHAR_I_CHAR32_T(F)

#endif