Skip to content

Commit 205652c

Browse files
committed
List of changes:
- Define macro unconditionally when the compiler is clang. - Remove preprocessor logic that isn't needed anymore. - Define new libcxx test feature for the AIX platform. - Mark tests as xfail in the platforms whose C library doesn't support the char8_t functions.
1 parent 27129d4 commit 205652c

File tree

6 files changed

+21
-26
lines changed

6 files changed

+21
-26
lines changed

libcxx/include/__config

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,27 +1021,16 @@ typedef __char32_t char32_t;
10211021
// the latter depends on internal GNU libc details that are not appropriate
10221022
// to depend on here, so any declarations present when __cpp_char8_t is not
10231023
// defined are ignored.
1024-
//
1025-
// picolibc 1.8.9 and newer declare the two functions unconditionally.
1026-
//
1027-
// Apple C library, Microsoft C Runtime, AIX C library and FreeBSD libc do not
1028-
// yet support these functions.
10291024
# if defined(_LIBCPP_GLIBC_PREREQ)
1030-
# if defined(__cpp_char8_t) && _LIBCPP_GLIBC_PREREQ(2, 36)
1031-
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
1032-
# else
1033-
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
1034-
# endif
1035-
# elif defined(_LIBCPP_PICOLIBC_PREREQ)
1036-
# if _LIBCPP_PICOLIBC_PREREQ(1, 8, 9)
1025+
# if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)
10371026
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
10381027
# else
10391028
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
10401029
# endif
1041-
# elif defined(__APPLE__) || defined(_MSC_VER) || defined(_LIBCPP_UCRT) || defined(_AIX) || defined(__FreeBSD__)
1042-
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
1043-
# else
1030+
# elif defined(__clang__)
10441031
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
1032+
# else
1033+
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
10451034
# endif
10461035

10471036
// There are a handful of public standard library types that are intended to

libcxx/include/__configuration/platform.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@
4747
// user code. Move code paths that need _NEWLIB_VERSION to another customization mechanism.
4848
#if __has_include(<picolibc.h>)
4949
# include <picolibc.h>
50-
# define _LIBCPP_PICOLIBC_VERSION_INT(maj, min, patch) (maj * 10000 + min * 100 + patch)
51-
# define _LIBCPP_PICOLIBC_PREREQ(maj, min, patch) \
52-
_LIBCPP_PICOLIBC_VERSION_INT(__PICOLIBC__, __PICOLIBC_MINOR__, __PICOLIBC_PATCHLEVEL__) >= \
53-
_LIBCPP_PICOLIBC_VERSION_INT(maj, min, patch)
54-
#endif
55-
56-
#if __has_include(<corecrt.h>)
57-
# include <corecrt.h>
58-
# if defined(_UCRT)
59-
# define _LIBCPP_UCRT
60-
# endif
6150
#endif
6251

6352
#ifndef __BYTE_ORDER__

libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
// Apple platforms don't provide <uchar.h> yet, so these tests fail.
1212
// XFAIL: target={{.+}}-apple-{{.+}}
1313

14+
// The following platforms do not provide mbrtoc8 and c8rtomb so the tests fail
15+
// XFAIL: aix
16+
// XFAIL: freebsd
17+
// XFAIL: windows
18+
1419
// mbrtoc16 not defined.
1520
// XFAIL: LIBCXX-PICOLIBC-FIXME
1621

libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
// Apple platforms don't provide <uchar.h> yet, so these tests fail.
1212
// XFAIL: target={{.+}}-apple-{{.+}}
1313

14+
// The following platforms do not provide mbrtoc8 and c8rtomb so the tests fail
15+
// XFAIL: aix
16+
// XFAIL: freebsd
17+
// XFAIL: windows
18+
1419
// mbrtoc16 not defined.
1520
// XFAIL: LIBCXX-PICOLIBC-FIXME
1621

libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
// UNSUPPORTED: c++03
1010

11+
// The following platforms do not provide mbrtoc8 and c8rtomb so the tests fail
12+
// XFAIL: aix
13+
// XFAIL: darwin
14+
// XFAIL: freebsd
15+
// XFAIL: windows
16+
1117
#include <uchar.h>
1218

1319
#include "test_macros.h"

libcxx/utils/libcxx/test/features.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ def _getLocaleFlagsAction(cfg, locale, alts, members):
669669
""",
670670
),
671671
),
672+
Feature(name="aix", when=lambda cfg: "_AIX" in compilerMacros(cfg)),
672673
]
673674

674675
# Add features representing the build host platform name.

0 commit comments

Comments
 (0)