mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Improve LLVM compatibility a little bit
This commit is contained in:
parent
3057315a1b
commit
1a3d22b2fd
7 changed files with 14 additions and 12 deletions
|
@ -59,7 +59,7 @@ static int add_to_file_actions(posix_spawn_file_actions_t *file_actions,
|
|||
int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *file_actions,
|
||||
int fildes) {
|
||||
char temp[100];
|
||||
sprintf(temp, "close(%d)", fildes);
|
||||
(sprintf)(temp, "close(%d)", fildes);
|
||||
return add_to_file_actions(file_actions, temp);
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *file_actions,
|
|||
int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *file_actions,
|
||||
int fildes, int newfildes) {
|
||||
char temp[100];
|
||||
sprintf(temp, "dup2(%d,%d)", fildes, newfildes);
|
||||
(sprintf)(temp, "dup2(%d,%d)", fildes, newfildes);
|
||||
return add_to_file_actions(file_actions, temp);
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,6 @@ int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *file_actions,
|
|||
int fildes, const char *path, int oflag,
|
||||
unsigned mode) {
|
||||
char temp[100];
|
||||
sprintf(temp, "open(%d,%s*%o,%o)", fildes, path, oflag, mode);
|
||||
(sprintf)(temp, "open(%d,%s*%o,%o)", fildes, path, oflag, mode);
|
||||
return add_to_file_actions(file_actions, temp);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ FILE *tmpfile(void) {
|
|||
char *tmp, *sep, tpl[PATH_MAX];
|
||||
tmp = firstnonnull(getenv("TMPDIR"), kTmpPath);
|
||||
sep = !isempty(tmp) && !endswith(tmp, "/") ? "/" : "";
|
||||
if (snprintf(tpl, PATH_MAX, "%s%stmp.XXXXXX", tmp, sep) < PATH_MAX) {
|
||||
if ((snprintf)(tpl, PATH_MAX, "%s%stmp.XXXXXX", tmp, sep) < PATH_MAX) {
|
||||
if ((fd = mkostemps(tpl, 0, 0)) != -1) {
|
||||
return fdopen(fd, "w+");
|
||||
}
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
#include "libc/macros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
static const int (*const kWcTypeFuncs[])(wint_t) = {
|
||||
typedef int (*isw_f)(wint_t);
|
||||
|
||||
static const isw_f kWcTypeFuncs[] = {
|
||||
iswalnum, //
|
||||
iswalpha, //
|
||||
iswblank, //
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue