mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-16 07:39:56 +00:00
Fix issues for latest GCC toolchain
This commit is contained in:
parent
5cb9b2658c
commit
3b086af91b
22 changed files with 148 additions and 166 deletions
|
@ -16,10 +16,8 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/syscall_support-nt.internal.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/nt/enum/fileflagandattributes.h"
|
||||
#include "libc/nt/files.h"
|
||||
#include "libc/nt/thunk/msabi.h"
|
||||
|
||||
|
@ -27,15 +25,12 @@ __msabi extern typeof(GetFileAttributes) *const __imp_GetFileAttributesW;
|
|||
|
||||
/**
|
||||
* Gets file info on the New Technology.
|
||||
*
|
||||
* @return handle, or -1u on failure
|
||||
* @note this wrapper takes care of ABI, STRACE(), and __winerr()
|
||||
*/
|
||||
textwindows uint32_t GetFileAttributes(const char16_t *lpPathName) {
|
||||
uint32_t flags;
|
||||
flags = __imp_GetFileAttributesW(lpPathName);
|
||||
if (flags == -1u) __winerr();
|
||||
NTTRACE("GetFileAttributes(%#hs) → %s% m", lpPathName,
|
||||
NTTRACE("GetFileAttributes(%#hs) → %s", lpPathName,
|
||||
DescribeNtFileFlagAttr(flags));
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/syscall_support-nt.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/nt/files.h"
|
||||
#include "libc/nt/thunk/msabi.h"
|
||||
|
@ -25,12 +24,10 @@ __msabi extern typeof(RemoveDirectory) *const __imp_RemoveDirectoryW;
|
|||
|
||||
/**
|
||||
* Deletes existing empty directory on the New Technology.
|
||||
* @note this wrapper takes care of ABI, STRACE(), and __winerr()
|
||||
*/
|
||||
textwindows bool32 RemoveDirectory(const char16_t *lpPathName) {
|
||||
bool32 ok;
|
||||
ok = __imp_RemoveDirectoryW(lpPathName);
|
||||
if (!ok) __winerr();
|
||||
NTTRACE("RemoveDirectory(%#hs) → %hhhd% m", lpPathName, ok);
|
||||
NTTRACE("RemoveDirectory(%#hs) → %hhhd", lpPathName, ok);
|
||||
return ok;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue