Fix dash compatible syntax issue

This commit is contained in:
Justine Tunney 2023-11-17 16:47:47 -08:00
parent 2c9d2943d6
commit 72ac5f18d9
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 13 additions and 4 deletions

View file

@ -18,6 +18,8 @@
*/ */
#include "libc/calls/syscall-nt.internal.h" #include "libc/calls/syscall-nt.internal.h"
#include "libc/calls/syscall_support-nt.internal.h" #include "libc/calls/syscall_support-nt.internal.h"
#include "libc/limits.h"
#include "libc/str/str.h"
textwindows int sys_faccessat_nt(int dirfd, const char *path, int mode, textwindows int sys_faccessat_nt(int dirfd, const char *path, int mode,
uint32_t flags) { uint32_t flags) {

View file

@ -17,8 +17,10 @@
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
*/ */
#include "libc/calls/syscall_support-nt.internal.h" #include "libc/calls/syscall_support-nt.internal.h"
#include "libc/limits.h"
#include "libc/nt/enum/fileflagandattributes.h" #include "libc/nt/enum/fileflagandattributes.h"
#include "libc/nt/files.h" #include "libc/nt/files.h"
#include "libc/str/str.h"
textwindows int sys_fchmodat_nt(int dirfd, const char *path, uint32_t mode, textwindows int sys_fchmodat_nt(int dirfd, const char *path, uint32_t mode,
int flags) { int flags) {

View file

@ -18,9 +18,11 @@
*/ */
#include "libc/calls/calls.h" #include "libc/calls/calls.h"
#include "libc/calls/syscall_support-nt.internal.h" #include "libc/calls/syscall_support-nt.internal.h"
#include "libc/limits.h"
#include "libc/nt/files.h" #include "libc/nt/files.h"
#include "libc/nt/runtime.h" #include "libc/nt/runtime.h"
#include "libc/runtime/stack.h" #include "libc/runtime/stack.h"
#include "libc/str/str.h"
textwindows int sys_linkat_nt(int olddirfd, const char *oldpath, int newdirfd, textwindows int sys_linkat_nt(int olddirfd, const char *oldpath, int newdirfd,
const char *newpath) { const char *newpath) {

View file

@ -19,6 +19,7 @@
#include "libc/calls/syscall-nt.internal.h" #include "libc/calls/syscall-nt.internal.h"
#include "libc/calls/syscall_support-nt.internal.h" #include "libc/calls/syscall_support-nt.internal.h"
#include "libc/nt/files.h" #include "libc/nt/files.h"
#include "libc/str/str.h"
textwindows int sys_mkdirat_nt(int dirfd, const char *path, uint32_t mode) { textwindows int sys_mkdirat_nt(int dirfd, const char *path, uint32_t mode) {
char16_t path16[PATH_MAX]; char16_t path16[PATH_MAX];

View file

@ -32,6 +32,7 @@
#include "libc/nt/struct/tokenprivileges.h" #include "libc/nt/struct/tokenprivileges.h"
#include "libc/nt/thunk/msabi.h" #include "libc/nt/thunk/msabi.h"
#include "libc/runtime/stack.h" #include "libc/runtime/stack.h"
#include "libc/str/str.h"
#include "libc/sysv/errfuns.h" #include "libc/sysv/errfuns.h"
static struct { static struct {

View file

@ -13,7 +13,6 @@ char16_t *__create_pipe_name(char16_t *);
size_t __normntpath(char16_t *, size_t); size_t __normntpath(char16_t *, size_t);
int __mkntpath(const char *, char16_t[hasatleast PATH_MAX]); int __mkntpath(const char *, char16_t[hasatleast PATH_MAX]);
int __mkntpath2(const char *, char16_t[hasatleast PATH_MAX], int); int __mkntpath2(const char *, char16_t[hasatleast PATH_MAX], int);
int __mkntpathat(int, const char *, int, char16_t[hasatleast PATH_MAX]);
int __mkntpathath(int64_t, const char *, int, char16_t[hasatleast PATH_MAX]); int __mkntpathath(int64_t, const char *, int, char16_t[hasatleast PATH_MAX]);
int ntaccesscheck(const char16_t *, uint32_t) paramsnonnull(); int ntaccesscheck(const char16_t *, uint32_t) paramsnonnull();
int sys_fcntl_nt_setfl(int, unsigned); int sys_fcntl_nt_setfl(int, unsigned);

View file

@ -29,6 +29,7 @@
#include "libc/nt/files.h" #include "libc/nt/files.h"
#include "libc/nt/runtime.h" #include "libc/nt/runtime.h"
#include "libc/nt/synchronization.h" #include "libc/nt/synchronization.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/at.h" #include "libc/sysv/consts/at.h"
#include "libc/sysv/consts/utime.h" #include "libc/sysv/consts/utime.h"
#include "libc/sysv/errfuns.h" #include "libc/sysv/errfuns.h"

View file

@ -210,6 +210,7 @@ axdx_t tprecode16to8(char *, size_t, const char16_t *);
bool32 wcsstartswith(const wchar_t *, const wchar_t *) strlenesque; bool32 wcsstartswith(const wchar_t *, const wchar_t *) strlenesque;
bool32 wcsendswith(const wchar_t *, const wchar_t *) strlenesque; bool32 wcsendswith(const wchar_t *, const wchar_t *) strlenesque;
char *__join_paths(char *, size_t, const char *, const char *) __wur; char *__join_paths(char *, size_t, const char *, const char *) __wur;
int __mkntpathat(int, const char *, int, char16_t[hasatleast 1024]);
#endif /* _COSMO_SOURCE */ #endif /* _COSMO_SOURCE */
#if defined(_COSMO_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || \ #if defined(_COSMO_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || \

View file

@ -180,12 +180,12 @@ for x; do
elif [ x"$x" = x"-march=native" ]; then elif [ x"$x" = x"-march=native" ]; then
fatal_error "-march=native can't be used when building fat binaries" fatal_error "-march=native can't be used when building fat binaries"
elif [ x"$x" != x"${x#-Xx86_64}" ]; then elif [ x"$x" != x"${x#-Xx86_64}" ]; then
x=${x#-Xx86_64} # e.g. -Xx86_64,-msse3,-mavx,-mavx2,-mf16c,-mfma x=${x#-Xx86_64} # e.g. cosmocc "-Xx86_64 -msse3 -mavx -mavx2 -mf16c -mfma"
FLAGS_X86_64="$FLAGS_X86_64 ${x//,/ }" FLAGS_X86_64="$FLAGS_X86_64 ${x#-Xx86_64}"
continue continue
elif [ x"$x" != x"${x#-Xaarch64}" ]; then elif [ x"$x" != x"${x#-Xaarch64}" ]; then
x=${x#-Xaarch64} x=${x#-Xaarch64}
FLAGS_aarch64="$FLAGS_aarch64 ${x//,/ }" FLAGS_aarch64="$FLAGS_aarch64 $x"
continue continue
elif [ x"$x" = x"-dumpversion" ]; then elif [ x"$x" = x"-dumpversion" ]; then
echo $GCC_VERSION echo $GCC_VERSION