From 5d693d72f89492a3691193afbfe7700dd60392bb Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 3 Jul 2026 13:34:30 -0700
Subject: [PATCH] Fix -Wstrict-prototypes warnings
e.g.
SDL3/src/hidapi/libusb/hid.c:636:31: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
636 | static void start_event_thread()
---
src/hidapi/libusb/hid.c | 4 ++--
src/notification/cocoa/SDL_cocoanotification.m | 4 ++--
src/video/cocoa/SDL_cocoamouse.h | 2 +-
src/video/cocoa/SDL_cocoamouse.m | 2 +-
src/video/cocoa/SDL_cocoawindow.m | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c
index 66cf3375367ae..a49cf172161a9 100644
--- a/src/hidapi/libusb/hid.c
+++ b/src/hidapi/libusb/hid.c
@@ -633,7 +633,7 @@ static void *event_thread(void *param)
return NULL;
}
-static void start_event_thread()
+static void start_event_thread(void)
{
if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
int res = libusb_hotplug_register_callback(usb_context, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY, hotplug_callback, NULL, &hotplug_callback_handle);
@@ -645,7 +645,7 @@ static void start_event_thread()
hidapi_thread_create(&event_thread_state, event_thread, NULL);
}
-static void stop_event_thread()
+static void stop_event_thread(void)
{
shutdown_event_thread = 1;
libusb_interrupt_event_handler(usb_context);
diff --git a/src/notification/cocoa/SDL_cocoanotification.m b/src/notification/cocoa/SDL_cocoanotification.m
index e540963af723d..34f98e47a252d 100644
--- a/src/notification/cocoa/SDL_cocoanotification.m
+++ b/src/notification/cocoa/SDL_cocoanotification.m
@@ -88,7 +88,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNoti
static UNUserNotificationCenter *center;
static SDLNotificationDelegate *delegate;
-static bool ShouldEnableNotifications()
+static bool ShouldEnableNotifications(void)
{
#if defined(SDL_PLATFORM_MACOS)
/* Notifications outside of an app bundle are unsupported, and will crash with an
@@ -354,7 +354,7 @@ bool SDL_RemoveNotification(SDL_NotificationID notification)
}
#endif
-void SDL_CleanupNotifications()
+void SDL_CleanupNotifications(void)
{
// TODO: Anything to do here?
}
diff --git a/src/video/cocoa/SDL_cocoamouse.h b/src/video/cocoa/SDL_cocoamouse.h
index d9ce0e841d0fd..c53056c8df2bc 100644
--- a/src/video/cocoa/SDL_cocoamouse.h
+++ b/src/video/cocoa/SDL_cocoamouse.h
@@ -26,7 +26,7 @@
#include "SDL_cocoavideo.h"
extern bool Cocoa_InitMouse(SDL_VideoDevice *_this);
-extern NSWindow *Cocoa_GetMouseFocus();
+extern NSWindow *Cocoa_GetMouseFocus(void);
extern void Cocoa_HandleMouseEvent(SDL_VideoDevice *_this, NSEvent *event);
extern void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event);
extern void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y);
diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m
index 1322a3a2c3832..dc4dd39927443 100644
--- a/src/video/cocoa/SDL_cocoamouse.m
+++ b/src/video/cocoa/SDL_cocoamouse.m
@@ -768,7 +768,7 @@ static void Cocoa_HandleTitleButtonEvent(SDL_VideoDevice *_this, NSEvent *event)
static NSWindow *Cocoa_MouseFocus;
-NSWindow *Cocoa_GetMouseFocus()
+NSWindow *Cocoa_GetMouseFocus(void)
{
return Cocoa_MouseFocus;
}
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index ce74e5bdbcacb..193aebec363ec 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -2241,7 +2241,7 @@ - (void)updateTrackingAreas
}
@end
-static void Cocoa_UpdateMouseFocus()
+static void Cocoa_UpdateMouseFocus(void)
{
const NSPoint mouseLocation = [NSEvent mouseLocation];