Skip to content

Commit 42fa2da

Browse files
committed
removed localtime_s for this pull request
1 parent 75e797d commit 42fa2da

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

libc/src/time/time_utils.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -135,33 +135,6 @@ LIBC_INLINE struct tm *localtime_internal(const time_t *timer, struct tm *buf) {
135135
return buf;
136136
}
137137

138-
// for windows only, implemented on gnu/linux for compatibility reasons
139-
LIBC_INLINE int localtime_s_internal(const time_t *t_ptr, struct tm *input) {
140-
if (input == NULL)
141-
return -1;
142-
143-
if ((*t_ptr < 0 || *t_ptr > cpp::numeric_limits<int64_t>::max()) &&
144-
input != NULL) {
145-
// setting values to -1 for compatibility reasons
146-
// https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/localtime-s-localtime32-s-localtime64-s
147-
input->tm_sec = -1;
148-
input->tm_min = -1;
149-
input->tm_hour = -1;
150-
input->tm_mday = -1;
151-
input->tm_mon = -1;
152-
input->tm_year = -1;
153-
input->tm_wday = -1;
154-
input->tm_yday = -1;
155-
input->tm_isdst = -1;
156-
157-
return -1;
158-
}
159-
160-
localtime_internal(t_ptr, input);
161-
162-
return 0;
163-
}
164-
165138
// Returns number of years from (1, year).
166139
LIBC_INLINE constexpr int64_t get_num_of_leap_years_before(int64_t year) {
167140
return (year / 4) - (year / 100) + (year / 400);

libc/test/src/time/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,6 @@ add_libc_unittest(
103103
libc.src.time.localtime_r
104104
)
105105

106-
add_libc_unittest(
107-
localtime_s_test
108-
SUITE
109-
libc_time_unittests
110-
SRCS
111-
localtime_s_test.cpp
112-
HDRS
113-
TmHelper.h
114-
TmMatcher.h
115-
CXX_STANDARD
116-
20
117-
DEPENDS
118-
libc.src.time.localtime_s
119-
)
120-
121106
add_libc_test(
122107
clock_gettime_test
123108
SUITE

0 commit comments

Comments
 (0)