mirror of
https://github.com/AxioDL/nod.git
synced 2025-12-08 13:14:59 +00:00
Compare commits
1 Commits
c1635245b8
...
0985c63958
| Author | SHA1 | Date | |
|---|---|---|---|
| 0985c63958 |
@@ -1,11 +1,15 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#include <array>
|
||||
|
||||
#define OS_CONSTEXPR constexpr
|
||||
|
||||
extern "C" {
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define OS_CONSTEXPR
|
||||
|
||||
typedef uint8_t char8_t;
|
||||
typedef uint16_t char16_t;
|
||||
typedef uint32_t char32_t;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#if _WIN32 && UNICODE
|
||||
#if _WIN32
|
||||
#include <array>
|
||||
#include <cwctype>
|
||||
#include <direct.h>
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
@@ -88,7 +89,7 @@ static inline int Stat(const char* path, Sstat* statout) {
|
||||
return _wstat64(wpath.get(), statout);
|
||||
}
|
||||
#else
|
||||
static inline int Mkdir(const char* path, mode_t mode) { return CreateDirectoryA(path, mode); }
|
||||
static inline int Mkdir(const char* path, mode_t mode) { return mkdir(path, mode); }
|
||||
|
||||
typedef struct stat Sstat;
|
||||
static inline int Stat(const char* path, Sstat* statout) { return stat(path, statout); }
|
||||
@@ -235,14 +236,14 @@ static inline bool CheckFreeSpace(const char* path, size_t reqSz) {
|
||||
wchar_t* end = nullptr;
|
||||
DWORD ret = GetFullPathNameW(wpath.get(), 1024, buf.data(), &end);
|
||||
if (ret == 0 || ret > 1024) {
|
||||
LogModule.report(logvisor::Error, FMT_STRING("GetFullPathNameA {}"), path);
|
||||
LogModule.report(logvisor::Error, FMT_STRING("GetFullPathNameW {}"), path);
|
||||
return false;
|
||||
}
|
||||
if (end != nullptr) {
|
||||
end[0] = L'\0';
|
||||
}
|
||||
if (!GetDiskFreeSpaceExW(buf.data(), &freeBytes, nullptr, nullptr)) {
|
||||
LogModule.report(logvisor::Error, FMT_STRING("GetDiskFreeSpaceExA {}: {}"), path, GetLastError());
|
||||
LogModule.report(logvisor::Error, FMT_STRING("GetDiskFreeSpaceExW {}: {}"), path, GetLastError());
|
||||
return false;
|
||||
}
|
||||
return reqSz < freeBytes.QuadPart;
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
#include "nod/DirectoryEnumerator.hpp"
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#ifdef __cpp_lib_ranges
|
||||
#include <ranges>
|
||||
#endif
|
||||
|
||||
namespace nod {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "nod/OSUTF.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
|
||||
static const char16_t Sjis00[256] = {
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
|
||||
2
logvisor
2
logvisor
Submodule logvisor updated: df3c283186...4f7f3f2147
Reference in New Issue
Block a user