Skip to content

Commit e3e526d

Browse files
committed
[libc++] Add "using-if-exists" to timespec_get in modules
Picolibc does not provide timespec_get function. Adding "using-if-exists" attribute fixes the modules.
1 parent 3b54337 commit e3e526d

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

libcxx/modules/std.compat/ctime.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ export {
2424
using ::mktime;
2525
using ::strftime;
2626
using ::time;
27-
using ::timespec_get;
27+
using ::timespec_get _LIBCPP_USING_IF_EXISTS;
2828
} // export

libcxx/modules/std/ctime.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ export namespace std {
2424
using std::mktime;
2525
using std::strftime;
2626
using std::time;
27-
using std::timespec_get;
27+
using std::timespec_get _LIBCPP_USING_IF_EXISTS;
2828
} // namespace std

libcxx/test/std/modules/std.compat.pass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
// UNSUPPORTED: libcpp-has-no-std-modules
1212
// UNSUPPORTED: clang-modules-build
1313

14-
// picolibc does not provide the required timespec_get function, and the
15-
// "using-if-exists" mechanism apparently did not work here.
16-
// XFAIL: LIBCXX-PICOLIBC-FIXME
17-
1814
// A minimal test to validate import works.
1915

2016
import std.compat;

0 commit comments

Comments
 (0)