mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 02:08:30 +00:00
parent
0ea0d33a77
commit
e62d7b8789
2 changed files with 7 additions and 17 deletions
|
@ -47,7 +47,7 @@
|
||||||
: "X"(FUNC), "X"(IMAGE_BASE_VIRTUAL) \
|
: "X"(FUNC), "X"(IMAGE_BASE_VIRTUAL) \
|
||||||
: "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r10", \
|
: "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r10", \
|
||||||
"r11", "memory", "cc"); \
|
"r11", "memory", "cc"); \
|
||||||
0; \
|
(void)0; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define _NOPL1(SECTION, FUNC, ARG) \
|
#define _NOPL1(SECTION, FUNC, ARG) \
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
: "X"(FUNC), "X"(IMAGE_BASE_VIRTUAL) \
|
: "X"(FUNC), "X"(IMAGE_BASE_VIRTUAL) \
|
||||||
: "rax", "rsi", "rdx", "rcx", "r8", "r9", "r10", "r11", \
|
: "rax", "rsi", "rdx", "rcx", "r8", "r9", "r10", "r11", \
|
||||||
"memory", "cc"); \
|
"memory", "cc"); \
|
||||||
0; \
|
(void)0; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#endif /* !ASSEMBLER && !LINKER && GNUC && !CHIBICC && !LLVM && !ANSI */
|
#endif /* !ASSEMBLER && !LINKER && GNUC && !CHIBICC && !LLVM && !ANSI */
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
│vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│
|
│vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#define LOCALTIME_IMPLEMENTATION
|
#define LOCALTIME_IMPLEMENTATION
|
||||||
#include "libc/intrin/bits.h"
|
|
||||||
#include "libc/calls/calls.h"
|
#include "libc/calls/calls.h"
|
||||||
|
#include "libc/intrin/bits.h"
|
||||||
#include "libc/intrin/nopl.h"
|
#include "libc/intrin/nopl.h"
|
||||||
#include "libc/intrin/pthread.h"
|
#include "libc/intrin/pthread.h"
|
||||||
#include "libc/intrin/spinlock.h"
|
#include "libc/intrin/spinlock.h"
|
||||||
|
@ -1417,8 +1417,7 @@ localtime_tzset_unlocked(void)
|
||||||
void
|
void
|
||||||
tzset(void)
|
tzset(void)
|
||||||
{
|
{
|
||||||
if (localtime_lock() != 0)
|
localtime_lock();
|
||||||
return;
|
|
||||||
localtime_tzset_unlocked();
|
localtime_tzset_unlocked();
|
||||||
localtime_unlock();
|
localtime_unlock();
|
||||||
}
|
}
|
||||||
|
@ -1432,8 +1431,7 @@ static void
|
||||||
localtime_gmtcheck(void)
|
localtime_gmtcheck(void)
|
||||||
{
|
{
|
||||||
static bool gmt_is_set;
|
static bool gmt_is_set;
|
||||||
if (localtime_lock() != 0)
|
localtime_lock();
|
||||||
return;
|
|
||||||
if (! gmt_is_set) {
|
if (! gmt_is_set) {
|
||||||
gmtptr = malloc(sizeof *gmtptr);
|
gmtptr = malloc(sizeof *gmtptr);
|
||||||
__cxa_atexit(FreeGmt, gmtptr, 0);
|
__cxa_atexit(FreeGmt, gmtptr, 0);
|
||||||
|
@ -1545,11 +1543,7 @@ localsub(struct state const *sp, time_t const *timep, int_fast32_t setname,
|
||||||
static struct tm *
|
static struct tm *
|
||||||
localtime_tzset(time_t const *timep, struct tm *tmp, bool setname)
|
localtime_tzset(time_t const *timep, struct tm *tmp, bool setname)
|
||||||
{
|
{
|
||||||
int err = localtime_lock();
|
localtime_lock();
|
||||||
if (err) {
|
|
||||||
errno = err;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (setname || !lcl_is_set)
|
if (setname || !lcl_is_set)
|
||||||
localtime_tzset_unlocked();
|
localtime_tzset_unlocked();
|
||||||
tmp = localsub(lclptr, timep, setname, tmp);
|
tmp = localsub(lclptr, timep, setname, tmp);
|
||||||
|
@ -2160,11 +2154,7 @@ time_t
|
||||||
mktime(struct tm *tmp)
|
mktime(struct tm *tmp)
|
||||||
{
|
{
|
||||||
time_t t;
|
time_t t;
|
||||||
int err = localtime_lock();
|
localtime_lock();
|
||||||
if (err) {
|
|
||||||
errno = err;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
localtime_tzset_unlocked();
|
localtime_tzset_unlocked();
|
||||||
t = mktime_tzname(lclptr, tmp, true);
|
t = mktime_tzname(lclptr, tmp, true);
|
||||||
localtime_unlock();
|
localtime_unlock();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue