Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions .github/workflows/create-test-plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Msys2Platform(Enum):
Mingw64 = "mingw64"
Clang64 = "clang64"
Ucrt64 = "ucrt64"
Msys = "msys"


class IntelCompiler(Enum):
Expand Down Expand Up @@ -110,6 +111,7 @@ class JobSpec:
"msys2-mingw64": JobSpec(name="Windows (msys2, mingw64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64", msys2_platform=Msys2Platform.Mingw64, ),
"msys2-clang64": JobSpec(name="Windows (msys2, clang64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-clang", msys2_platform=Msys2Platform.Clang64, ),
"msys2-ucrt64": JobSpec(name="Windows (msys2, ucrt64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-ucrt", msys2_platform=Msys2Platform.Ucrt64, ),
"msys2-msys": JobSpec(name="Windows (msys2, msys)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-msys", msys2_platform=Msys2Platform.Msys, ),
"msvc-x64": JobSpec(name="Windows (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_project="VisualC/SDL.sln", ),
"msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ),
"msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ),
Expand Down Expand Up @@ -161,6 +163,7 @@ class StaticLibType(Enum):

class SharedLibType(Enum):
WIN32 = "SDL3.dll"
MSYS = "msys-SDL3-0.dll"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't done a full review, but the output of the build should be a compatible SDL3.dll with no additional dependencies.

We already do a mingw build that I believe uses msys already, is that right @madebr?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page explains the msys2 environments.
msys is the posix-like build environment, used as a base to target multiple platforms (mingw32, mingw64, clang32, clang64, clangarm64, ucrt64, ...)

Looking at what packages the msys layer provides,all packages are meant for developers, not for users.

I don't think this layer is meant for shipping guis and other user facing programs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MSYS environment under MSys2 is like Cygwin and needs an extra dll to provide some Unix like support.

And you are correct that the MSys2 people have no desire to support GUIs via MSYS environment.

Tim S.

@stahta01 stahta01 May 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you all approve the first 3 commits that support both Cygwin and MSYS builds?
Because I am willing to support the MSYS part just by myself patching the MSys2 [arch Linux style] package I have already created. I could then do a slight rename of the PR to match the change.

SO_0 = "libSDL3.so.0"
SO = "libSDL3.so"
DYLIB = "libSDL3.0.dylib"
Expand Down Expand Up @@ -744,26 +747,37 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool, ctest_args
job.shell = "msys2 {0}"
assert spec.msys2_platform
job.msys2_msystem = spec.msys2_platform.value
job.shared_lib = SharedLibType.WIN32
if spec.msys2_platform == Msys2Platform.Msys:
job.shared_lib = SharedLibType.MSYS
job.cmake_arguments.append("-DSDLTEST_GDB=ON")
else:
job.shared_lib = SharedLibType.WIN32
job.static_lib = StaticLibType.A
msys2_env = {
"mingw32": "mingw-w64-i686",
"mingw64": "mingw-w64-x86_64",
"clang64": "mingw-w64-clang-x86_64",
"ucrt64": "mingw-w64-ucrt-x86_64",
"mingw32": "mingw-w64-i686-",
"mingw64": "mingw-w64-x86_64-",
"clang64": "mingw-w64-clang-x86_64-",
"ucrt64": "mingw-w64-ucrt-x86_64-",
"msys": "",
}[spec.msys2_platform.value]
job.msys2_packages.extend([
f"{msys2_env}-cc",
f"{msys2_env}-cmake",
f"{msys2_env}-ffmpeg",
f"{msys2_env}-ninja",
f"{msys2_env}-pkg-config",
f"{msys2_env}cmake",
f"{msys2_env}ninja",
f"{msys2_env}pkg-config",
])
if spec.msys2_platform in (Msys2Platform.Msys, ):
job.msys2_packages.append(f"{msys2_env}gcc")
job.msys2_packages.append(f"{msys2_env}gdb")
job.msys2_packages.append(f"{msys2_env}git") # might not be needed
if spec.msys2_platform not in (Msys2Platform.Msys, ):
job.msys2_packages.append(f"{msys2_env}cc")
job.msys2_packages.append(f"{msys2_env}ffmpeg")
if spec.msys2_platform not in (Msys2Platform.Mingw32, ):
job.msys2_packages.append(f"{msys2_env}-perl")
job.msys2_packages.append(f"{msys2_env}-clang-tools-extra")
job.msys2_packages.append(f"{msys2_env}perl")
if spec.msys2_platform not in (Msys2Platform.Mingw32, Msys2Platform.Msys, ):
job.msys2_packages.append(f"{msys2_env}clang-tools-extra")
if job.ccache:
job.msys2_packages.append(f"{msys2_env}-ccache")
job.msys2_packages.append(f"{msys2_env}ccache")
case SdlPlatform.Riscos:
job.ccache = False # FIXME: enable when container gets upgrade
# FIXME: Enable SDL_WERROR
Expand Down
45 changes: 16 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ list(APPEND CMAKE_REQUIRED_LINK_OPTIONS ${SDL_CHECK_REQUIRED_LINK_OPTIONS})
SDL_DetectCMakePlatform()

# Don't mistake macOS for unix
if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT RISCOS)
if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT RISCOS AND NOT MSYS)
set(UNIX_SYS ON)
else()
set(UNIX_SYS OFF)
Expand Down Expand Up @@ -272,7 +272,7 @@ if(SDL_FRAMEWORK)
set(SDL_STATIC_AVAILABLE FALSE)
endif()

if(UNIX AND NOT ANDROID AND NOT RISCOS AND NOT SDL_FRAMEWORK)
if(UNIX AND NOT ANDROID AND NOT RISCOS AND NOT SDL_FRAMEWORK AND NOT MSYS)
set(SDL_RPATH_DEFAULT ON)
else()
set(SDL_RPATH_DEFAULT OFF)
Expand Down Expand Up @@ -367,16 +367,16 @@ dep_option(SDL_WAYLAND_LIBDECOR_SHARED "Dynamically load libdecor support" O
dep_option(SDL_RPI "Use Raspberry Pi video driver" ON "SDL_VIDEO;UNIX_SYS;SDL_CPU_ARM32 OR SDL_CPU_ARM64" OFF)
dep_option(SDL_ROCKCHIP "Use ROCKCHIP Hardware Acceleration video driver" ON "SDL_VIDEO;UNIX_SYS;SDL_CPU_ARM32 OR SDL_CPU_ARM64" OFF)
dep_option(SDL_COCOA "Use Cocoa video driver" ON "APPLE" OFF)
dep_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ON "SDL_AUDIO OR SDL_VIDEO;WINDOWS" OFF)
dep_option(SDL_XINPUT "Use Xinput for Windows" ON "WINDOWS" OFF)
dep_option(SDL_WASAPI "Use the Windows WASAPI audio driver" ON "WINDOWS;SDL_AUDIO" OFF)
dep_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ON "SDL_AUDIO OR SDL_VIDEO;WINDOWS OR CYGWIN" OFF)
dep_option(SDL_XINPUT "Use Xinput for Windows" ON "WINDOWS OR CYGWIN" OFF)
dep_option(SDL_WASAPI "Use the Windows WASAPI audio driver" ON "WINDOWS OR CYGWIN;SDL_AUDIO" OFF)
dep_option(SDL_RENDER_D3D "Enable the Direct3D 9 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
dep_option(SDL_RENDER_D3D11 "Enable the Direct3D 11 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
dep_option(SDL_RENDER_D3D12 "Enable the Direct3D 12 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
dep_option(SDL_RENDER_METAL "Enable the Metal render driver" ON "SDL_RENDER;APPLE" OFF)
dep_option(SDL_RENDER_GPU "Enable the SDL_GPU render driver" ON "SDL_RENDER;SDL_GPU" OFF)
dep_option(SDL_VIVANTE "Use Vivante EGL video driver" ON "${UNIX_SYS};SDL_CPU_ARM32" OFF)
dep_option(SDL_VULKAN "Enable Vulkan support" "${SDL_VULKAN_DEFAULT}" "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR OPENBSD OR WINDOWS" OFF)
dep_option(SDL_VULKAN "Enable Vulkan support" "${SDL_VULKAN_DEFAULT}" "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR OPENBSD OR WINDOWS OR CYGWIN" OFF)
dep_option(SDL_RENDER_VULKAN "Enable the Vulkan render driver" ON "SDL_RENDER;SDL_VULKAN" OFF)
dep_option(SDL_METAL "Enable Metal support" ON "APPLE" OFF)
set_option(SDL_OPENVR "Use OpenVR video driver" OFF)
Expand Down Expand Up @@ -563,19 +563,6 @@ else()
endif()
endif()

if(CYGWIN)
# We build SDL on cygwin without the UNIX emulation layer
sdl_include_directories(PUBLIC SYSTEM "/usr/include/mingw")
cmake_push_check_state()
string(APPEND CMAKE_REQUIRED_FLAGS " -mno-cygwin")
check_c_source_compiles("int main(int argc, char **argv) { return 0; }"
HAVE_GCC_NO_CYGWIN)
cmake_pop_check_state()
if(HAVE_GCC_NO_CYGWIN)
sdl_shared_link_options("-mno-cygwin")
endif()
endif()
Comment on lines -566 to -577

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer relevant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct it has not been relevant for about 10 years. Note: The few people using Cygwin 32 might still need it.

Tim S.

@stahta01 stahta01 May 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is a stopper, I can skip removing it at this time. This line is likely needed to be removed to get the CYGWIN CI posted in the other PR to work. And the comment above this line, partly goes with this line.
sdl_include_directories(PUBLIC SYSTEM "/usr/include/mingw")

Tim S.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about cygwin. @sezero might know.

I don't think this is a blocker.
If you're building SDL3 on the cygwin/msys platform, you're also subscribing to its family of runtime dependencies.


# General includes
sdl_compile_definitions(PRIVATE "USING_GENERATED_CONFIG_H")
sdl_include_directories(
Expand Down Expand Up @@ -1128,7 +1115,7 @@ if(SDL_LIBC)
vsnprintf vsscanf
wcsnlen wcscmp wcsdup wcslcat wcslcpy wcslen wcsncmp wcsstr wcstol
)
if(WINDOWS)
if(WINDOWS OR CYGWIN)
list(APPEND symbols_to_check
_copysign _fseeki64 _strrev _ui64toa _uitoa _ultoa _wcsdup
)
Expand Down Expand Up @@ -1407,7 +1394,7 @@ if(SDL_CAMERA)
#endif()
endif()

if(UNIX OR APPLE)
if((UNIX OR APPLE) AND (NOT CYGWIN))
# Relevant for Unix/Darwin only
set(DYNAPI_NEEDS_DLOPEN 1)
CheckDLOPEN()
Expand Down Expand Up @@ -1806,7 +1793,7 @@ elseif(EMSCRIPTEN)
CheckPTHREAD()
CheckLibUnwind()

elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
elseif(UNIX AND NOT (APPLE OR RISCOS OR HAIKU OR CYGWIN))

set(SDL_DISABLE_DLOPEN_NOTES TRUE)
if(SDL_DLOPEN_NOTES)
Expand Down Expand Up @@ -2197,7 +2184,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
set (HAVE_VSNPRINTF 0)
set (USE_POSIX_SPAWN 1)
endif()
elseif(WINDOWS)
elseif(WINDOWS OR CYGWIN)
enable_language(CXX)
check_c_source_compiles("
#include <windows.h>
Expand Down Expand Up @@ -2231,7 +2218,7 @@ elseif(WINDOWS)
if(DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700)
set(USE_WINSDK_DIRECTX TRUE)
endif()
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
if(NOT (MINGW OR CYGWIN) AND NOT USE_WINSDK_DIRECTX)
if("$ENV{DXSDK_DIR}" STREQUAL "")
message(FATAL_ERROR "DIRECTX requires the \$DXSDK_DIR environment variable to be set")
endif()
Expand All @@ -2250,7 +2237,7 @@ elseif(WINDOWS)
cmake_pop_check_state()
if(HAVE_D3D9_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H)
set(HAVE_DIRECTX TRUE)
if(NOT MINGW AND NOT USE_WINSDK_DIRECTX)
if(NOT (MINGW OR CYGWIN) AND NOT USE_WINSDK_DIRECTX)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PROCESSOR_ARCH "x64")
else()
Expand Down Expand Up @@ -3497,7 +3484,7 @@ if (SDL_DIALOG)
if(ANDROID)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/android/SDL_androiddialog.c)
set(HAVE_SDL_DIALOG TRUE)
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU AND NOT MSYS)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/unix/SDL_unixdialog.c)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/unix/SDL_portaldialog.c)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/unix/SDL_portaldialog.h)
Expand All @@ -3507,21 +3494,21 @@ if (SDL_DIALOG)
elseif(HAIKU)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/haiku/SDL_haikudialog.cc)
set(HAVE_SDL_DIALOG TRUE)
elseif(WINDOWS)
elseif(WINDOWS OR MSYS)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/windows/SDL_windowsdialog.c)
set(HAVE_SDL_DIALOG TRUE)
elseif(MACOS)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/cocoa/SDL_cocoadialog.m)
set(HAVE_SDL_DIALOG TRUE)
endif()
endif()
if(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
if(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU AND NOT MSYS)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/unix/SDL_zenitymessagebox.h)
sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/unix/SDL_zenitymessagebox.c)
endif()

sdl_sources("${SDL3_SOURCE_DIR}/src/process/SDL_process.c")
if(WINDOWS)
if(WINDOWS OR MSYS)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/process/windows/*.c"
"${SDL3_SOURCE_DIR}/src/process/windows/*.h"
Expand Down
2 changes: 1 addition & 1 deletion cmake/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ function(SDL_PrintSummary)
message(STATUS "")
endif()

if(UNIX AND NOT (ANDROID OR APPLE OR EMSCRIPTEN OR HAIKU OR RISCOS OR DJGPP))
if(UNIX AND NOT (ANDROID OR APPLE OR EMSCRIPTEN OR HAIKU OR RISCOS OR DJGPP OR CYGWIN))
if(NOT (HAVE_X11 OR HAVE_WAYLAND))
if(NOT SDL_UNIX_CONSOLE_BUILD)
message(FATAL_ERROR
Expand Down
2 changes: 1 addition & 1 deletion include/SDL3/SDL_egl.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ typedef void *EGLNativeDisplayType;
typedef void *EGLNativePixmapType;
typedef void *EGLNativeWindowType;

#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#elif defined(_WIN32) || defined(__MSYS__) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/SDL3/SDL_opengl.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
# else
# define GLAPIENTRY __stdcall
# endif
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) && !defined(__MSYS__) /* use native windows opengl32 */
# define GLAPI extern
# define GLAPIENTRY __stdcall
#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
Expand Down
6 changes: 3 additions & 3 deletions include/SDL3/SDL_platform_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
#define SDL_PLATFORM_SOLARIS 1
#endif

#if defined(__CYGWIN__)
#if defined(__CYGWIN__) && !defined(__MSYS__)

/**
* A preprocessor macro that is only defined if compiling for Cygwin.
Expand All @@ -317,7 +317,7 @@
#define SDL_PLATFORM_CYGWIN 1
#endif

#if (defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)) && !defined(__NGAGE__)
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(__NGAGE__)

/**
* A preprocessor macro that is only defined if compiling for Windows.
Expand Down Expand Up @@ -417,7 +417,7 @@
#define SDL_PLATFORM_WIN32 1

#endif
#endif /* defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN) */
#endif /* (defined(_WIN32) || defined(__CYGWIN__)) && !defined(__NGAGE__) */


/* This is to support generic "any GDK" separate from a platform-specific GDK */
Expand Down
23 changes: 18 additions & 5 deletions include/SDL3/SDL_stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ typedef Sint64 SDL_Time;
* <inttypes.h> should define these but this is not true all platforms.
* (for example win32) */
#ifndef SDL_PRIs64
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(__CYGWIN__)
#define SDL_PRIs64 "I64d"
#elif defined(PRId64)
#define SDL_PRIs64 PRId64
Expand All @@ -750,7 +750,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIu64
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(__CYGWIN__)
#define SDL_PRIu64 "I64u"
#elif defined(PRIu64)
#define SDL_PRIu64 PRIu64
Expand All @@ -761,7 +761,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIx64
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(__CYGWIN__)
#define SDL_PRIx64 "I64x"
#elif defined(PRIx64)
#define SDL_PRIx64 PRIx64
Expand All @@ -772,7 +772,7 @@ typedef Sint64 SDL_Time;
#endif
#endif
#ifndef SDL_PRIX64
#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(__CYGWIN__)
#define SDL_PRIX64 "I64X"
#elif defined(PRIX64)
#define SDL_PRIX64 PRIX64
Expand Down Expand Up @@ -810,8 +810,21 @@ typedef Sint64 SDL_Time;
#define SDL_PRIX32 "X"
#endif
#endif
#if defined(__CYGWIN__)
#define SDL_PRIlDWORD "d"
#define SDL_PRIuDWORD "u"
#define SDL_PRIdHRESULT "d"
#define SDL_PRIxHRESULT "x"
#define SDL_PRIdLONG "d"
#else
#define SDL_PRIlDWORD "ld"
#define SDL_PRIuDWORD "lu"
#define SDL_PRIdHRESULT "ld"
#define SDL_PRIxHRESULT "lx"
#define SDL_PRIdLONG "ld"
#endif
/* Specifically for the `long long` -- SDL-specific. */
#ifdef SDL_PLATFORM_WINDOWS
#if defined(SDL_PLATFORM_WINDOWS) && !defined(__CYGWIN__)
#ifndef SDL_NOLONGLONG
SDL_COMPILE_TIME_ASSERT(longlong_size64, sizeof(long long) == 8); /* using I64 for windows - make sure `long long` is 64 bits. */
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/SDL3/SDL_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/* Thread synchronization primitives */
#include <SDL3/SDL_atomic.h>

#if defined(SDL_PLATFORM_WINDOWS)
#if defined(SDL_PLATFORM_WINDOWS) && !defined(__CYGWIN__)
#include <process.h> /* _beginthreadex() and _endthreadex() */
#endif

Expand Down Expand Up @@ -296,7 +296,7 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_Prop

/* The real implementation, hidden from the wiki, so it can show this as real functions that don't have macro magic. */
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
# if defined(SDL_PLATFORM_WINDOWS)
# if defined(SDL_PLATFORM_WINDOWS) && !defined(__CYGWIN__)
# ifndef SDL_BeginThreadFunction
# define SDL_BeginThreadFunction _beginthreadex
# endif
Expand Down
2 changes: 1 addition & 1 deletion src/audio/wasapi/SDL_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ static bool mgmtthrtask_PrepDevice(void *userdata)
ret = IAudioClient2_SetClientProperties(client2, &audioProps);
if (FAILED(ret)) {
// This isn't fatal, let's log it instead of failing
SDL_LogWarn(SDL_LOG_CATEGORY_AUDIO, "IAudioClient2_SetClientProperties failed: 0x%lx", ret);
SDL_LogWarn(SDL_LOG_CATEGORY_AUDIO, "IAudioClient2_SetClientProperties failed: 0x%" SDL_PRIxHRESULT, ret);
}
IAudioClient2_Release(client2);
}
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/windows/SDL_windowsdialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ void windows_ShowFileDialog(void *ptr)
const char *opts[1] = { NULL };
callback(userdata, opts, getFilterIndex(dialog.nFilterIndex));
} else {
SDL_SetError("Windows error, CommDlgExtendedError: %ld", pCommDlgExtendedError());
SDL_SetError("Windows error, CommDlgExtendedError: %" SDL_PRIlDWORD, pCommDlgExtendedError());
callback(userdata, NULL, -1);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/dynapi/SDL_dynapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// These headers have system specific definitions, so aren't included above
#include <SDL3/SDL_vulkan.h>

#if defined(WIN32) || defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
Expand Down Expand Up @@ -451,7 +451,7 @@ Sint32 SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize)

// Obviously we can't use SDL_LoadObject() to load SDL. :)
// Also obviously, we never close the loaded library, once we accept it.
#if defined(WIN32) || defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
static HMODULE sdlapi_lib = NULL; // The handle to the other SDL library, loaded with SDL_DYNAMIC_API_ENVVAR

static SDL_INLINE void unload_sdlapi_library(void)
Expand Down Expand Up @@ -509,7 +509,7 @@ static void dynapi_warn(const char *msg)
const char *caption = "SDL Dynamic API Failure!";
(void)caption;
// SDL_ShowSimpleMessageBox() is a too heavy for here.
#if (defined(WIN32) || defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
#if (defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
MessageBoxA(NULL, msg, caption, MB_OK | MB_ICONERROR);
#elif defined(HAVE_STDIO_H)
fprintf(stderr, "\n\n%s\n%s\n\n", caption, msg);
Expand Down
Loading
Loading