Fix last commit missing one changed file, also fixup line endings

This commit is contained in:
UnknownShadow200 2022-01-05 15:16:10 +11:00
parent 9fda93eaac
commit fdd6e58063
5 changed files with 37 additions and 32 deletions

View file

@ -22,7 +22,7 @@
<ProjectGuid>{8A7D82BD-178A-4785-B41B-70EDE998920A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ClassiCube</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -41,7 +41,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

View file

@ -460,7 +460,7 @@ static void PrintRegisters(cc_string* str, void* ctx) {
}
#elif defined CC_BUILD_DARWIN && __DARWIN_UNIX03
/* See /usr/include/mach/i386/_structs.h (macOS 10.5+) */
static void PrintRegisters(cc_string* str, void* ctx) {
static void PrintRegisters(cc_string* str, void* ctx) {
mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext;
#if defined __i386__
#define REG_GET(reg, ign) &r->__ss.__e##reg
@ -495,7 +495,7 @@ static void PrintRegisters(cc_string* str, void* ctx) {
}
#elif defined CC_BUILD_DARWIN
/* See /usr/include/mach/i386/thread_status.h (macOS 10.4) */
static void PrintRegisters(cc_string* str, void* ctx) {
static void PrintRegisters(cc_string* str, void* ctx) {
mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext;
#if defined __i386__
#define REG_GET(reg, ign) &r->ss.e##reg
@ -515,11 +515,11 @@ static void PrintRegisters(cc_string* str, void* ctx) {
}
#elif defined CC_BUILD_LINUX || defined CC_BUILD_ANDROID
/* See /usr/include/sys/ucontext.h */
static void PrintRegisters(cc_string* str, void* ctx) {
#if __PPC__ && __WORDSIZE == 32
/* See sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h in glibc */
mcontext_t r = *((ucontext_t*)ctx)->uc_mcontext.uc_regs;
#else
static void PrintRegisters(cc_string* str, void* ctx) {
#if __PPC__ && __WORDSIZE == 32
/* See sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h in glibc */
mcontext_t r = *((ucontext_t*)ctx)->uc_mcontext.uc_regs;
#else
mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext;
#endif
@ -577,7 +577,7 @@ static void PrintRegisters(cc_string* str, void* ctx) {
}
#elif defined CC_BUILD_SOLARIS
/* See /usr/include/sys/regset.h */
static void PrintRegisters(cc_string* str, void* ctx) {
static void PrintRegisters(cc_string* str, void* ctx) {
mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext;
#if defined __i386__
@ -592,7 +592,7 @@ static void PrintRegisters(cc_string* str, void* ctx) {
}
#elif defined CC_BUILD_NETBSD
/* See /usr/include/i386/mcontext.h */
static void PrintRegisters(cc_string* str, void* ctx) {
static void PrintRegisters(cc_string* str, void* ctx) {
mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext;
#if defined __i386__
#define REG_GET(ign, reg) &r.__gregs[_REG_E##reg]
@ -606,7 +606,7 @@ static void PrintRegisters(cc_string* str, void* ctx) {
}
#elif defined CC_BUILD_FREEBSD
/* See /usr/include/machine/ucontext.h */
static void PrintRegisters(cc_string* str, void* ctx) {
static void PrintRegisters(cc_string* str, void* ctx) {
mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext;
#if defined __i386__
#define REG_GET(reg, ign) &r.mc_e##reg
@ -620,7 +620,7 @@ static void PrintRegisters(cc_string* str, void* ctx) {
}
#elif defined CC_BUILD_OPENBSD
/* See /usr/include/machine/signal.h */
static void PrintRegisters(cc_string* str, void* ctx) {
static void PrintRegisters(cc_string* str, void* ctx) {
struct sigcontext r = *((ucontext_t*)ctx);
#if defined __i386__
#define REG_GET(reg, ign) &r.sc_e##reg
@ -633,7 +633,7 @@ static void PrintRegisters(cc_string* str, void* ctx) {
#endif
}
#elif defined CC_BUILD_HAIKU
static void PrintRegisters(cc_string* str, void* ctx) {
static void PrintRegisters(cc_string* str, void* ctx) {
mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext;
#if defined __i386__
#define REG_GET(reg, ign) &r.me##reg
@ -646,7 +646,7 @@ static void PrintRegisters(cc_string* str, void* ctx) {
#endif
}
#endif
static void DumpRegisters(void* ctx) {
static void DumpRegisters(void* ctx) {
cc_string str; char strBuffer[768];
String_InitArray(str, strBuffer);

View file

@ -1136,10 +1136,10 @@ static cc_result GetMachineID(cc_uint32* key) {
/* Possible alternatives: kenv("smbios.system.uuid"), /etc/hostid */
static cc_result GetMachineID(cc_uint32* key) {
static int mib[2] = { CTL_KERN, KERN_HOSTUUID };
char buf[128];
size_t size = 128;
if (sysctl(mib, 2, buf, &size, NULL, 0) == -1) return errno;
char buf[128];
size_t size = 128;
if (sysctl(mib, 2, buf, &size, NULL, 0) == -1) return errno;
DecodeMachineID(buf, size, key);
return 0;
}
@ -1147,20 +1147,20 @@ static cc_result GetMachineID(cc_uint32* key) {
/* Use hw.uuid sysctl for the key */
static cc_result GetMachineID(cc_uint32* key) {
static int mib[2] = { CTL_HW, HW_UUID };
char buf[128];
size_t size = 128;
if (sysctl(mib, 2, buf, &size, NULL, 0) == -1) return errno;
char buf[128];
size_t size = 128;
if (sysctl(mib, 2, buf, &size, NULL, 0) == -1) return errno;
DecodeMachineID(buf, size, key);
return 0;
}
#elif defined CC_BUILD_NETBSD
/* Use hw.uuid for the key */
static cc_result GetMachineID(cc_uint32* key) {
char buf[128];
size_t size = 128;
if (sysctlbyname("machdep.dmi.system-uuid", buf, &size, NULL, 0) == -1) return errno;
char buf[128];
size_t size = 128;
if (sysctlbyname("machdep.dmi.system-uuid", buf, &size, NULL, 0) == -1) return errno;
DecodeMachineID(buf, size, key);
return 0;
}

View file

@ -368,8 +368,13 @@ void Process_Exit(cc_result code) {
extern int interop_OpenTab(const char* url);
cc_result Process_StartOpen(const cc_string* args) {
char str[NATIVE_STR_LEN];
cc_result res;
Platform_EncodeUtf8(str, args);
return interop_OpenTab(str);
res = interop_OpenTab(str);
/* interop error code -> ClassiCube error code */
if (res == 1) res = ERR_INVALID_OPEN_URL;
return res;
}

View file

@ -570,10 +570,10 @@ EMSCRIPTEN_KEEPALIVE void Window_OnTextChanged(const char* src) {
void Window_OpenKeyboard(const struct OpenKeyboardArgs* args) {
char str[NATIVE_STR_LEN];
keyboardOpen = true;
if (!Input_TouchMode) return;
Platform_EncodeUtf8(str, args->text);
keyboardOpen = true;
if (!Input_TouchMode) return;
Platform_EncodeUtf8(str, args->text);
Platform_LogConst("OPEN SESAME");
interop_OpenKeyboard(str, args->type, args->placeholder);
}