[rcore][win32] fixes from review/for gcc

This commit is contained in:
Jonathan Marler 2025-04-18 07:41:36 -06:00
parent afe367817a
commit df5a3cee4a
2 changed files with 8 additions and 22 deletions

View File

@ -342,6 +342,10 @@ ifeq ($(PLATFORM_OS), LINUX)
CFLAGS += -fPIC CFLAGS += -fPIC
endif endif
ifeq ($(PLATFORM_OS),WINDOWS)
CFLAGS += -DUNICODE
endif
ifeq ($(RAYLIB_BUILD_MODE),DEBUG) ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += -g -D_DEBUG CFLAGS += -g -D_DEBUG
endif endif
@ -628,6 +632,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
LDLIBS += -latomic LDLIBS += -latomic
endif endif
endif endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
LDLIBS = -lgdi32 -lwinmm -lopengl32 -lshcore
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm
endif endif

View File

@ -129,7 +129,6 @@ static bool ResizableFromStyle(DWORD style)
} }
static bool DecoratedFromStyle(DWORD style) static bool DecoratedFromStyle(DWORD style)
{ {
bool is_off;
if (style & STYLE_FLAGS_UNDECORATED_ON) { if (style & STYLE_FLAGS_UNDECORATED_ON) {
if (style & STYLE_FLAGS_UNDECORATED_OFF) { if (style & STYLE_FLAGS_UNDECORATED_OFF) {
TRACELOG(LOG_ERROR, "style 0x%x has both undecorated on/off flags", style); TRACELOG(LOG_ERROR, "style 0x%x has both undecorated on/off flags", style);
@ -471,7 +470,7 @@ static BOOL IsWindows10Version1703OrGreaterWin32(void)
LogFail("GetProcAddress 'RtlVerifyVersionInfo'", GetLastError()); LogFail("GetProcAddress 'RtlVerifyVersionInfo'", GetLastError());
return 0; return 0;
} }
OSVERSIONINFOEX osvi = { 0 }; RTL_OSVERSIONINFOEXW osvi = { 0 };
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
osvi.dwMajorVersion = 10; osvi.dwMajorVersion = 10;
osvi.dwMinorVersion = 0; osvi.dwMinorVersion = 0;
@ -713,26 +712,6 @@ static LPCWSTR GetCursorName(int cursor)
} }
static UINT GetMonitorDpi(HMONITOR monitor)
{
UINT dpi_x;
UINT dpi_y;
HRESULT hr = GetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &dpi_x, &dpi_y);
if (hr < 0) {
LogFailHr("GetDpiForMonitor", hr);
abort();
}
if (dpi_x != dpi_y) {
TRACELOG(LOG_ERROR, "DPI X (%lu) != DPI Y (%lu)", dpi_x, dpi_y);
abort();
}
if (dpi_x < 96) {
TRACELOG(LOG_ERROR, "unexpected dpi %lu", dpi_x);
abort();
}
return dpi_x;
}
static BOOL CALLBACK CountMonitorsProc(HMONITOR handle, HDC _, LPRECT rect, LPARAM lparam) static BOOL CALLBACK CountMonitorsProc(HMONITOR handle, HDC _, LPRECT rect, LPARAM lparam)
{ {
int* count = (int*)lparam; int* count = (int*)lparam;