From: Brendan Hansen Date: Fri, 11 Feb 2022 19:04:56 +0000 (-0600) Subject: fixing GetEnvironmentVariableA X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=f686343f0e31acaaf236baa40b1e0e73e3773f76;p=onyx.git fixing GetEnvironmentVariableA --- diff --git a/include/small_windows.h b/include/small_windows.h index 21b605af..07062261 100644 --- a/include/small_windows.h +++ b/include/small_windows.h @@ -324,8 +324,6 @@ GB_DLL_IMPORT BOOL WINAPI CreatePipe (HANDLE *hReadPipe, HANDLE *hWri GB_DLL_IMPORT BOOL WINAPI TerminateProcess (HANDLE hProcess, UINT uExitCode); GB_DLL_IMPORT BOOL WINAPI SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags); -GB_DLL_IMPORT BOOL WINAPI GetEnvironmentVariable(char const * lpName, char * lpBuffer, DWORD nSize); - uintptr_t _beginthreadex( // NATIVE CODE void *security, unsigned stack_size, @@ -433,4 +431,5 @@ GB_DLL_IMPORT void WINAPI GetSystemTimeAsFileTime (FILETIME *system_time_as_fil GB_DLL_IMPORT void WINAPI Sleep(DWORD milliseconds); GB_DLL_IMPORT void WINAPI ExitProcess(UINT exit_code); -GB_DLL_IMPORT BOOL WINAPI SetEnvironmentVariableA(char const *name, char const *value); +GB_DLL_IMPORT BOOL WINAPI SetEnvironmentVariableA(char const *name, char const *value); +GB_DLL_IMPORT DWORD WINAPI GetEnvironmentVariableA(char const * lpName, char * lpBuffer, DWORD nSize); diff --git a/src/onyx.c b/src/onyx.c index dca16482..a28a295a 100644 --- a/src/onyx.c +++ b/src/onyx.c @@ -93,7 +93,7 @@ static CompileOptions compile_opts_parse(bh_allocator alloc, int argc, char *arg #endif #ifdef _BH_WINDOWS core_installation = bh_alloc_array(global_heap_allocator, u8, 512); - GetEnvironmentVariable("ONYX_PATH", core_installation, 512); + GetEnvironmentVariableA("ONYX_PATH", core_installation, 512); #endif // NOTE: Add the current folder