From 0fac593dd693574395089bd89c3d4033f00cb702 Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Sun, 17 Oct 2021 03:56:54 -0300 Subject: [PATCH] Update libqb.cpp to allow manual compilation in WinXP Oh, well... there's still life for XP. --- internal/c/libqb.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index f3173dab9..f3633f409 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -18573,8 +18573,9 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ //Creating/destroying an image surface: int32 func__newimage(int32 x,int32 y,int32 bpp,int32 passed){ - #ifdef QB64_WINDOWS && WINVER >= 0x0600 //this block is not compatible with XP - static bool j; + #ifdef QB64_WINDOWS + #if WINVER >= 0x0600 //this block is not compatible with XP + static bool j; if(j != 1){ FARPROC dpiaware; HMODULE user32 = LoadLibrary(TEXT("user32.dll")); @@ -18588,6 +18589,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ FreeLibrary(user32); } } + #endif #endif static int32 i; if (new_error) return 0; @@ -21556,7 +21558,12 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ } else { #ifdef QB64_WINDOWS + #if WINVER >= 0x0600 _putenv_s(buf, separator + 1); + #else + *separator = '='; + _putenv(buf); + #endif #else setenv(buf, separator + 1, 1); #endif @@ -30011,7 +30018,8 @@ void sub__numlock(int32 options){ } void sub__consolefont(qbs* FontName, int FontSize){ - #ifdef QB64_WINDOWS && WINVER >= 0x0600 //this block is not compatible with XP + #ifdef QB64_WINDOWS + #if WINVER >= 0x0600 //this block is not compatible with XP SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1}; HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0); static int OneTimePause; @@ -30033,6 +30041,7 @@ void sub__consolefont(qbs* FontName, int FontSize){ SetCurrentConsoleFontEx(cl_conout, NULL, &info); #endif + #endif }