Ozkan Sezer
5907bf2555
cmake: remove GetDpiForMonitor() assignment from shellscalingapi.h check
...
It always fails, because we don't set the needed link library, i.e. shcore.
Besides, SDL3.dll doesn't link to shcore.dll, it links to it at runtime, so
it is unnecessary to check for that symbol here.
Reference issue: https://github.com/libsdl-org/SDL/pull/13904
2025-09-09 04:55:32 +03:00
Ozkan Sezer
b2c6dfa4c5
dialog, windows: tweak includes and include order,
...
so that the set _WIN32_WINNT value is visible to the source.
Reference issue: https://github.com/libsdl-org/SDL/pull/13904
2025-09-09 04:55:24 +03:00
Ozkan Sezer
baf965c1ca
Revert "video/openvr: define OPENVR_API_NODLL"
...
This reverts commit 976ba1e750 .
2025-09-06 04:15:55 +03:00
Ozkan Sezer
976ba1e750
video/openvr: define OPENVR_API_NODLL
...
.. so that S_API doesn't expand to __declspec(dllimport)
2025-09-06 03:05:50 +03:00
Ozkan Sezer
cc9937201e
x11: fix a typo after PR/13855 and kill lots of trailing whitespace
2025-09-03 04:37:56 +03:00
Ozkan Sezer
83bb0f9105
cmake: simd detection clean-up for Apple multi-arch configs.
2025-09-02 22:34:10 +03:00
Ozkan Sezer
875653658a
cmake: revert commit 5d1bbd9 and change sse4.2 test
...
clang doesn't support -mcrc32 until version 14.0, therefore drop -mcrc32
use in sse 4.2 test, and change it to check _mm_cmpgt_epi64() instead of
_mm_crc32_u32(). without this, sse4.2 check was failing with clang <= 13
Fixes https://github.com/libsdl-org/SDL/pull/12223
2025-08-31 03:20:20 +03:00
Ozkan Sezer
c0e5fd55d2
CI: add OpenBSD workflow
2025-08-30 01:55:02 +03:00
Ozkan Sezer
98bed62259
cmake: fall back to -Wconversion if -Wfloat-conversion isn't available
...
... during checks for valid isinf/isinff/isnan/isnanf macros.
2025-08-27 22:20:02 +03:00
Ozkan Sezer
f241e8e8fd
windows: replace shobjidl_core.h usage with shobjidl.h except for when targeting xbox
...
Closes https://github.com/libsdl-org/SDL/pull/13571
2025-08-01 17:11:49 -07:00
Ozkan Sezer
83818eeb95
tests: c90 fixes (#endif comments) for consistency after commit 9e37839
2025-08-01 06:28:02 +03:00
Ozkan Sezer
9c54d686aa
arguably better wording..
2025-07-27 20:00:02 +03:00
Ozkan Sezer
fb0e03f262
fix ARM64 linkage with Visual Studio >= 17.14 when SDL_LIBC is disabled
...
Reference issue: https://github.com/libsdl-org/SDL/issues/13254
(cherry picked from commit 2fb6abb9ad )
2025-07-09 01:30:55 +03:00
Ozkan Sezer
af8bee2dd1
alsa: change an SDL_LogError into SDL_LogDebug.
...
it is informational only and seeing ERROR on the terminal was confusing
2025-06-22 21:04:44 -07:00
Ozkan Sezer
81e3066303
hidapi/libusb: disable C5287 warning in MSVC builds
...
A quick search implies that it is a bogus warning:
https://www.google.com/search?q=visual+studio+C5287
2025-06-21 07:15:53 -07:00
Ozkan Sezer
329b5f27d6
fix preprocessor directive for SDL_RESTRICT definition in C99 case.
2025-05-30 23:56:50 +03:00
Ozkan Sezer
0d58594e66
fix inverted __STDC_VERSION__ condition in SDL_RESTRICT definition.
2025-05-30 23:51:50 +03:00
Ozkan Sezer
25db127450
SDL_video.c: remove two stray line continuation chars .
2025-05-26 01:41:47 +03:00
Ozkan Sezer
d9e58baa6d
fixed the field of SDL_MouseMotionTransformCallback
2025-05-08 14:45:24 +03:00
Ozkan Sezer
17bba029ba
don't prototype strdup() for __clang_analyzer__ case in windows builds.
...
Fixes: https://github.com/libsdl-org/SDL/issues/12948 .
2025-05-04 10:35:31 -07:00
Ozkan Sezer
016ba86f93
tray, unix: make pointers g_object_ref and g_object_ref_sink static
...
Fixes: https://github.com/libsdl-org/SDL/issues/12908 .
2025-04-27 11:34:40 -04:00
Ozkan Sezer
0dbf585ace
fix SDL_audiocvt.c MSVC build.
2025-04-26 05:50:00 +03:00
Ozkan Sezer
360cc2791f
test/msdf_font.bmp: mark as non-executable.
2025-04-26 02:39:20 +03:00
Ozkan Sezer
b5ed0d0138
stb_image.h: apply mainstream PR/1736
...
Fix root-cause of CVE-2021-45340 : dereference of NULL ptr.
Patch authored by Henner Zeller <h.zeller@acm.org >
Mainstream pull request: https://github.com/nothings/stb/pull/1736
2025-04-23 17:55:02 +03:00
Ozkan Sezer
ab57ef9d7b
update sdlgenblit.pl after PR/12769
...
Closes: https://github.com/libsdl-org/SDL/issues/12774 .
2025-04-08 18:24:11 +03:00
Ozkan Sezer
b0a0d236d8
fix sdlgenblit.pl so that it actually matches the generated source
2025-04-08 18:24:11 +03:00
Ozkan Sezer
0fdfa925f2
rename local pointer vars 'pixel' to 'pixels'
...
Reference issue: https://github.com/libsdl-org/SDL/issues/12749 .
2025-04-08 18:20:03 +03:00
Ozkan Sezer
4c1a3ccd45
rename local vars 'pixel' to 'pixelvalue'
...
Reference issue: https://github.com/libsdl-org/SDL/issues/12749 .
2025-04-07 21:10:51 +03:00
Ozkan Sezer
433704e774
rename 'pixel' params of SDL_GetRGB, SDL_GetRGBA and SDL_LookupRGBAColor
...
Reference issue: https://github.com/libsdl-org/SDL/issues/12749 .
2025-04-07 21:10:51 +03:00
Ozkan Sezer
5a59b5f321
bool is 4 bytes in Apple MacOS X 32 bit PPC ABI
...
Reference issue: https://github.com/libsdl-org/SDL/issues/12749 .
2025-04-07 19:21:30 +03:00
Ozkan Sezer
87e6d2250f
examples, affine-textures: fix RISC-OS build.
2025-03-28 20:56:50 +03:00
Ozkan Sezer
ca3c5fd409
fix build: s/SDL_DetectSandbox/SDL_GetSandbox/
2025-03-02 19:40:02 +03:00
Ozkan Sezer
60c65f9fa4
SDL_camera.c: fix failure-return in SDL_PrepareCameraSurfaces().
2025-03-01 04:37:02 +03:00
Ozkan Sezer
73a8143581
timer, windows: allow building high resolution code with old SDKs.
2025-02-02 21:23:50 +03:00
Ozkan Sezer
e4fcc7b6e7
gpu/vulkan/SDL_gpu_vulkan.c: fix type redefinition error
...
src/gpu/vulkan/SDL_gpu_vulkan.c:763: error: redefinition of typedef 'VulkanUniformBuffer'
src/gpu/vulkan/SDL_gpu_vulkan.c:482: note: previous declaration of 'VulkanUniformBuffer' was here
2025-01-31 02:50:00 +03:00
Ozkan Sezer
5815372206
minor update to mingw-w64 build instructions.
2025-01-14 05:04:24 +03:00
Ozkan Sezer
307dac97ac
testcontroller.c: fix build errors due to -Wformat after commit b524af1
2025-01-12 22:00:02 +03:00
Ozkan Sezer
61f13b94d1
add a fallback SDL_TriggerBreakpoint() for MSVC after commit ebaa30d3.
2025-01-11 02:11:50 +03:00
Ozkan Sezer
8ec576ddab
tray, windows: fix logic error from commit 1167cf54e1
2025-01-07 10:15:40 +03:00
Ozkan Sezer
54752f8d1c
SDL_malloc.c: replace FORCEINLINE usage with SDL_FORCE_INLINE
2025-01-02 01:15:28 +01:00
Ozkan Sezer
c2121dd9a2
testcamera: fix MSVC build failure due to C4244 warning.
2024-12-29 21:28:02 +03:00
Ozkan Sezer
ec8a780ad4
tray, unix: fix -Wformat warnings
...
src/tray/unix/SDL_tray.c: In function 'get_tmp_filename':
src/tray/unix/SDL_tray.c:345: warning: format '%ld' expects type 'long int', but argument 2 has type 'size_t'
src/tray/unix/SDL_tray.c: In function 'get_appindicator_id':
src/tray/unix/SDL_tray.c:361: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int'
2024-12-28 18:37:56 +03:00
Ozkan Sezer
578509c326
windows/SDL_tray.c, video/windows/SDL_surface_utils.h: use SDL_windows.h
2024-12-27 12:28:02 +03:00
Ozkan Sezer
05932e05da
tray, windows: replace ZeroMemory() with SDL_zero()
2024-12-27 12:05:00 +03:00
Ozkan Sezer
cd1bb6247b
video/windows/SDL_surface_utils.c: replace ZeroMemory() with SDL_zero()
2024-12-27 06:03:37 +03:00
Ozkan Sezer
50fbae9302
tray, windows: define NOTIFYICON_VERSION_4 and NIF_SHOWTIP, if missing.
2024-12-27 05:30:50 +03:00
Ozkan Sezer
17ef0c1237
SDL_video.c: replace strlcpy with memcpy in SDL_ShowMessageBox()
2024-12-27 00:01:56 +03:00
Ozkan Sezer
6fa6297441
fix typo from commit b84f150d06
2024-12-17 11:15:56 +03:00
Ozkan Sezer
b84f150d06
fix macOS builds with hidapi disabled
...
Fixes: https://github.com/libsdl-org/SDL/issues/11647 .
2024-12-17 11:11:56 +03:00
Ozkan Sezer
d1b8fcd692
work around type redefinition errors in SDL_immdevice.h
2024-12-06 17:51:00 +03:00
Ozkan Sezer
5bfece34f9
ran gendynapi.pl after PR/11170.
2024-12-05 02:28:50 +03:00
Ozkan Sezer
830b132cd4
SDL_asyncio_liburing.c: replace __kernel_time64_t use with SDL's Sint64
2024-12-03 23:39:11 -05:00
Ozkan Sezer
4ac78706bf
SDL_asyncio_liburing.c: replace size_t casts on pointers with intptr_t
2024-12-03 23:39:11 -05:00
Ozkan Sezer
41b0d36a6c
fix MSVC projects after commit 51637495
2024-11-23 01:22:12 +03:00
Ozkan Sezer
7bf3cae02e
examples: fix cmake after commit 51637495
2024-11-23 00:56:40 +03:00
Ozkan Sezer
0f9e551d71
joystick/gdk/SDL_gameinputjoystick.c: fix build errors due to -Wformat
2024-11-17 00:45:02 +03:00
Ozkan Sezer
93471cf78d
video/openvr: minor clean-up:
...
- make all of function pointers static
- make EGLint context_attribs[] static
- comment out unused function pointer ov_wglGetCurrentContext
- remove unused SDL_DisplayMode openvr_dm_default
- move SDL_VideoDisplay openvr_vd_default to OPENVR_VideoInit()
context and eliminate its C99 initializers
- replace atoi() calls with SDL_atoi()
- replace atof() calls with SDL_atof()
2024-10-25 23:20:24 +03:00
Ozkan Sezer
3d2c8c510d
add GLES3 headers from Khronos for OpenVR video driver.
2024-10-19 10:23:55 -07:00
Ozkan Sezer
a6e5ab437f
video/openvr: Avoid type redefinition errors.
...
Also, let SDL handle stdint.h and stdbool.h.
2024-10-18 19:21:32 +03:00
Ozkan Sezer
569691797d
windows/SDL_systhread.c: fix permissions
2024-10-18 05:00:04 +03:00
Ozkan Sezer
4612db21a3
SDL_utils.c: restrict gethostname() usage to non-windows
...
Reference issue: https://github.com/libsdl-org/SDL/issues/11228 .
2024-10-17 12:47:02 +03:00
Ozkan Sezer
3ebfdb04be
SDL_stdinc.h: provide a prototype for strdup for __clang_analyzer__ case
...
Because strdup is not ANSI but POSIX, and its prototype might be hidden..
... and re-enable clang-tidy in CI for LoongArch64.
Fixes: https://github.com/libsdl-org/SDL/issues/11219 .
2024-10-16 21:50:40 +03:00
Ozkan Sezer
18410c03ea
cmake: fix checks for fdatasync() and gethostname()
2024-10-16 19:40:51 +03:00
Ozkan Sezer
638b50b69b
CI, LoongArch64: disable clang-tidy
...
Reference issue: https://github.com/libsdl-org/SDL/issues/11219 .
2024-10-15 21:05:20 +03:00
Ozkan Sezer
9fac4b9f5f
SDL_windowsmodes.c: Fix MSVC builds against SDKs older than 10.0.17134.0
...
workaround the missing DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL enum value
and DISPLAYCONFIG_SDR_WHITE_LEVEL struct.
Fixes: https://github.com/libsdl-org/SDL/issues/11193
Closes: https://github.com/libsdl-org/SDL/pull/11205
2024-10-14 09:04:25 -07:00
Ozkan Sezer
41dfe2c246
test/testautomation_stdlib.c: fix gcc warning on 32 bit
...
test/testautomation_stdlib.c:361: warning: integer constant is too large for 'long' type
2024-10-10 21:10:24 +03:00
Ozkan Sezer
7ff819141d
libm/e_exp.c: fix gcc warning on 32 bit:
...
src/libm/e_exp.c:105: warning: integer constant is too large for 'long' type
2024-10-10 18:23:20 +03:00
Ozkan Sezer
13c5d1092f
hidapi: update hid_write() for windows from mainstream.
...
Returns bytes_written if WriteFile returns synchronously
Relevant mainstream discussions:
https://github.com/libusb/hidapi/pull/697
https://github.com/libusb/hidapi/issues/695
2024-09-30 19:49:44 -07:00
Ozkan Sezer
5f304b3a47
Fix builed error after commit 0e45b824e3 due to -Wunused-variable
2024-09-29 15:40:02 +03:00
Ozkan Sezer
1088ea55fa
SDL_gpu_d3d11.c: define D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD for old toolchains
2024-09-27 23:55:02 +03:00
Ozkan Sezer
b736285053
examples/renderer/08-rotating-textures: Fix compiler warning on MSVC .
2024-09-22 12:02:50 +03:00
Ozkan Sezer
254b36361e
Add SDL_PRILL? format specifiers specifically for long long type.
2024-09-21 23:03:50 +03:00
Ozkan Sezer
88a01fbc96
testautomation_stdlib.c: fix -Wformat warnings from mingw with %lld/%llu
...
i.e.: unknown conversion type character 'l' in format
See https://github.com/libsdl-org/SDL/pull/10789#issuecomment-2354011906
2024-09-19 20:37:11 +03:00
Ozkan Sezer
7edf7fad66
fix bool define when SDL_DEFINE_STDBOOL is defined:
...
it should be unsigned.
2024-09-18 12:17:22 -07:00
Ozkan Sezer
ff90570a3c
define SDL_DEFINE_STDBOOL for gcc < 3
2024-09-18 12:17:22 -07:00
Ozkan Sezer
8caf25f7b3
testautomation_stdlib.c (stdlib_strtox): fix warning from gcc-4.9:
...
test/testautomation_stdlib.c: In function 'stdlib_strtox':
test/testautomation_stdlib.c:1339:9: warning: this decimal constant is unsigned only in ISO C90
STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967295", 10, 4294967295, 10);
^
test/testautomation_stdlib.c:1340:9: warning: this decimal constant is unsigned only in ISO C90
STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967296", 10, 4294967295, 10);
^
2024-09-18 01:03:10 +03:00
Ozkan Sezer
a833ee2e63
SDL_gpu.c: fixed build when SDL_GPU_DISABLED is defined.
2024-09-14 20:40:56 +03:00
Ozkan Sezer
c0b15e57f4
cmake: disable GPU backends for winrt
2024-09-05 22:39:02 +03:00
Ozkan Sezer
f494658f9c
SDL_gpu.c: remove BOM.
2024-09-05 22:39:02 +03:00
Ozkan Sezer
cb2919ac55
[GPU] MinGW build fixes:
...
- CreateEventEx() is guarded by _WIN32_WINNT >= 0x0600:
In SDL_gpu_d3d12.c, include core/windows/SDL_windows.h
that defines _WIN32_WINNT properly to account for that
- DXGIInfoQueue stuff is not available in all toolchains
such as mingw-w64 version 8.0.3
- SDL_gpu_d3d11.c: _WIN32 is always defined by MinGW, as
is the case for all windows-targeting compilers, so it
doesn't guarantee absence of DXGIInfoQueue stuff:
rely on __IDXGIInfoQueue_INTERFACE_DEFINED__, as it is
done elsewhere.
Fixes: https://github.com/libsdl-org/SDL/issues/10705 .
2024-09-05 22:39:02 +03:00
Ozkan Sezer
f317581c91
SDL_log.h: Use ASCII characters.
...
(was missed in commit 7ca676aeed for issue #10636 )
2024-09-04 14:56:40 +03:00
Ozkan Sezer
845212388e
RAWINPUT_JoystickOpen: add missing SDL_stack_free() calls.
...
Fixes https://github.com/libsdl-org/SDL/issues/10574 .
2024-08-25 11:05:40 +03:00
Ozkan Sezer
f93920a4f1
video, x11: fix linkage if SDL_VIDEO_DRIVER_X11_XINPUT2 isn't defined.
2024-08-10 15:55:00 +03:00
Ozkan Sezer
7d27a97402
d3d12.h, d3d12sdklayers.h: fix build against older mingw-w64 versions.
...
Fixes: https://github.com/libsdl-org/SDL/issues/10452 .
2024-08-01 21:45:02 +03:00
Ozkan Sezer
b24bfc2c98
fix RandFunc typedef
2024-07-30 21:15:04 +03:00
Ozkan Sezer
94827e0acd
SDL_mslibc.c: revert PR/10303 changes
2024-07-28 22:48:05 +03:00
Ozkan Sezer
70c1012e8c
SDL_stdinc.h (SDL_COMPILE_TIME_ASSERT): Keep C++ case alone (after PR/10331)
...
Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode.
Reference issue: https://github.com/libsdl-org/SDL/issues/6078 which was fixed by
https://github.com/libsdl-org/SDL/commit/f6b81125b340e00129978f2c9eebfba6a4d25692
2024-07-22 16:00:37 +03:00
Ozkan Sezer
2eda7b2c24
SDL_sysvideo.h: remove SDL_DisplayModeData typedef:
...
Fixes a type redefinition error:
In file included from /tmp/SDL3/test/../src/events/SDL_events_c.h:28,
from /tmp/SDL3/test/../src/events/SDL_pen.c:26,
from /tmp/SDL3/test/testautomation_pen.c:83:
/tmp/SDL3/test/../src/events/../video/SDL_sysvideo.h:34: error: redefinition of typedef 'SDL_DisplayModeData'
/tmp/SDL3/include/SDL3/SDL_video.h:78: note: previous declaration of 'SDL_DisplayModeData' was here
2024-07-17 12:30:32 +03:00
Ozkan Sezer
f437fe75f2
SDL_dynapi_overrides.h: remove left-over SDL_DestroyPixelFormat entry.
2024-07-11 18:56:40 +03:00
Ozkan Sezer
a4f962fd46
SDL_x11shape.c: fix build if SDL_VIDEO_DRIVER_X11_XSHAPE isn't defined
...
Fixes : https://github.com/libsdl-org/SDL/issues/10128 .
2024-06-27 05:47:50 +03:00
Ozkan Sezer
d6da494c1c
un-revert commit 65d911a:
...
SDL3 isn't using `long long` casts, so there are no issues there
SDL2 needs handling it right..
2024-06-14 18:37:50 +03:00
Ozkan Sezer
e25a7e88ce
revert commit 65d911a as it broke linux..
2024-06-14 14:56:24 +03:00
Ozkan Sezer
65d911aff0
SDL_events.c: override of SDL_PRIs64 for mingw is no longer needed
2024-06-14 14:50:50 +03:00
Ozkan Sezer
ca28bcb3b8
hidapi/windows/hid.c: avoid warnings with gcc < 8.
2024-06-04 06:10:24 +03:00
Ozkan Sezer
49b6c24722
always define PRI?64 using 'I64' when targeting windows
...
avoids -Wformat warnings from mingw toolchains -- e.g.:
src/test/SDL_test_harness.c:581:37: warning: unknown conversion type character 'l' in format [-Wformat=]
2024-06-01 22:35:40 +03:00
Ozkan Sezer
550d5b95c0
fix type redefinition errors after commit b1b4638cac.
2024-05-31 17:47:20 +03:00
Ozkan Sezer
5aa9ee8446
SDL_windowsmodes.c (WIN_GetDisplayNameVista): fix return after PR/9923
...
why haven't any of the build tests catch this..
2024-05-31 11:33:50 +03:00
Ozkan Sezer
e4518af377
move vista+ display config function ptr calls to device->driverdata
...
.. and change hdr code's display config function calls to use those
function ptrs.
2024-05-31 02:50:02 +03:00
Ozkan Sezer
d41e48e4c6
WIN_AdjustWindowRectWithStyle: silence gcc maybe-uninitialized warnings
...
/tmp/SDL3/src/video/windows/SDL_windowswindow.c: In function 'WIN_SetWindowPositionInternal':
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:216:17: warning: 'h' may be used uninitialized in this function [-Wmaybe-uninitialized]
rect.bottom = *height;
~~~~~~~~~~~~^~~~~~~~~
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:12: note: 'h' was declared here
int w, h;
^
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:215:16: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized]
rect.right = *width;
~~~~~~~~~~~^~~~~~~~
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:9: note: 'w' was declared here
int w, h;
^
2024-05-29 16:39:03 -07:00
Ozkan Sezer
384e5486bc
SDL_windows.h: set _WIN32_WINNT to 0xA00 dxgi1_6.h is available
...
to make sure DISPLAYCONFIG_SDR_WHITE_LEVEL is visible to us.
2024-05-30 00:05:55 +03:00