File tree Expand file tree Collapse file tree 15 files changed +53
-46
lines changed
test/src/__support/time/linux Expand file tree Collapse file tree 15 files changed +53
-46
lines changed Original file line number Diff line number Diff line change 1515#include <linux/errno.h>
1616
1717#include "include/llvm-libc-macros/error-number-macros.h"
18- #else // __linux__
18+ #elif defined(__APPLE__ )
19+ #include <sys/errno.h>
20+ #else // __APPLE__
1921#include "include/llvm-libc-macros/generic-error-number-macros.h"
2022#endif
2123
Original file line number Diff line number Diff line change 2121
2222#include "llvm-libc-macros/linux/error-number-macros.h"
2323
24- #else // __linux__
24+ #elif defined(__APPLE__)
25+
26+ #include <sys/errno.h>
27+
28+ #else // __APPLE__
29+
2530#include "llvm-libc-macros/generic-error-number-macros.h"
31+
2632#endif
2733
2834__BEGIN_C_DECLS
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ add_header_library(
2121 libc.src.__support.CPP.atomic
2222 libc.src.__support.CPP.limits
2323 libc.src.__support.CPP.optional
24- libc.src.__support.time.linux. abs_timeout
24+ libc.src.__support.time.abs_timeout
2525)
2626
2727set (monotonicity_flags)
@@ -38,8 +38,8 @@ add_header_library(
3838 DEPENDS
3939 .futex_utils
4040 libc.src.__support.threads.sleep
41- libc.src.__support.time.linux. abs_timeout
42- libc.src.__support.time.linux. monotonicity
41+ libc.src.__support.time.abs_timeout
42+ libc.src.__support.time.monotonicity
4343 libc.src.__support.CPP.optional
4444 libc.hdr.types.pid_t
4545 COMPILE_OPTIONS
Original file line number Diff line number Diff line change 1616#include " src/__support/macros/attributes.h"
1717#include " src/__support/macros/config.h"
1818#include " src/__support/threads/linux/futex_word.h"
19- #include " src/__support/time/linux/ abs_timeout.h"
19+ #include " src/__support/time/abs_timeout.h"
2020#include < linux/errno.h>
2121#include < linux/futex.h>
2222
Original file line number Diff line number Diff line change 1717#include " src/__support/threads/linux/futex_utils.h"
1818#include " src/__support/threads/linux/futex_word.h"
1919#include " src/__support/threads/sleep.h"
20- #include " src/__support/time/linux/ abs_timeout.h"
20+ #include " src/__support/time/abs_timeout.h"
2121
2222#ifndef LIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY
2323#define LIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY 1
2424#endif
2525
2626#if LIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY
27- #include " src/__support/time/linux/ monotonicity.h"
27+ #include " src/__support/time/monotonicity.h"
2828#endif
2929
3030#ifndef LIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT
Original file line number Diff line number Diff line change 3535#endif
3636
3737#if LIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY
38- #include " src/__support/time/linux/ monotonicity.h"
38+ #include " src/__support/time/monotonicity.h"
3939#endif
4040
4141namespace LIBC_NAMESPACE_DECL {
Original file line number Diff line number Diff line change @@ -37,3 +37,23 @@ if(TARGET libc.src.__support.time.${LIBC_TARGET_OS}.clock_settime)
3737 libc.src.__support.time.${LIBC_TARGET_OS} .clock_settime
3838 )
3939endif ()
40+
41+ add_header_library(
42+ abs_timeout
43+ HDRS
44+ abs_timeout.h
45+ DEPENDS
46+ libc.hdr.types.struct_timespec
47+ libc.src.__support.time.units
48+ libc.src.__support.CPP.expected
49+ )
50+
51+ add_header_library(
52+ monotonicity
53+ HDRS
54+ monotonicity.h
55+ DEPENDS
56+ .clock_conversion
57+ .abs_timeout
58+ libc.hdr.time_macros
59+ )
Original file line number Diff line number Diff line change 1- // ===--- Linux absolute timeout ---------------------------------*- C++ -*-===//
1+ // ===--- absolute timeout ------ ---------------------------------*- C++ -*-===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
88
9- #ifndef LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_ABS_TIMEOUT_H
10- #define LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_ABS_TIMEOUT_H
9+ #ifndef LLVM_LIBC_SRC___SUPPORT_TIME_ABS_TIMEOUT_H
10+ #define LLVM_LIBC_SRC___SUPPORT_TIME_ABS_TIMEOUT_H
1111
1212#include " hdr/time_macros.h"
1313#include " hdr/types/struct_timespec.h"
@@ -47,4 +47,4 @@ class AbsTimeout {
4747} // namespace internal
4848} // namespace LIBC_NAMESPACE_DECL
4949
50- #endif // LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_ABS_TIMEOUT_H
50+ #endif // LLVM_LIBC_SRC___SUPPORT_TIME_ABS_TIMEOUT_H
Original file line number Diff line number Diff line change @@ -28,24 +28,3 @@ add_object_library(
2828 libc.src.__support.error_or
2929 libc.src.__support.OSUtil.osutil
3030)
31-
32-
33- add_header_library(
34- abs_timeout
35- HDRS
36- abs_timeout.h
37- DEPENDS
38- libc.hdr.types.struct_timespec
39- libc.src.__support.time.units
40- libc.src.__support.CPP.expected
41- )
42-
43- add_header_library(
44- monotonicity
45- HDRS
46- monotonicity.h
47- DEPENDS
48- .abs_timeout
49- libc.hdr.time_macros
50- libc.src.__support.time.clock_conversion
51- )
Original file line number Diff line number Diff line change 1- // ===--- timeout linux implementation ---------------------------*- C++ -*-===//
1+ // ===--- timeout implementation ------ ---------------------------*- C++ -*-===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
88
9- #ifndef LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_MONOTONICITY_H
10- #define LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_MONOTONICITY_H
9+ #ifndef LLVM_LIBC_SRC___SUPPORT_TIME_MONOTONICITY_H
10+ #define LLVM_LIBC_SRC___SUPPORT_TIME_MONOTONICITY_H
1111
1212#include " hdr/time_macros.h"
1313#include " src/__support/libc_assert.h"
1414#include " src/__support/macros/config.h"
15+ #include " src/__support/time/abs_timeout.h"
1516#include " src/__support/time/clock_conversion.h"
16- #include " src/__support/time/linux/abs_timeout.h"
1717namespace LIBC_NAMESPACE_DECL {
1818namespace internal {
1919// This function is separated from abs_timeout.
@@ -41,4 +41,4 @@ LIBC_INLINE void ensure_monotonicity(AbsTimeout &timeout) {
4141} // namespace internal
4242} // namespace LIBC_NAMESPACE_DECL
4343
44- #endif // LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_MONOTONICITY_H
44+ #endif // LLVM_LIBC_SRC___SUPPORT_TIME_MONOTONICITY_H
You can’t perform that action at this time.
0 commit comments