dlnote: embed trailing semicolon in SDL_ELF_NOTE_DLOPEN macro

This commit is contained in:
Anonymous Maarten
2025-12-24 21:19:45 +01:00
committed by Özkan Sezer
parent e18b301c51
commit 9dd3e2305e
26 changed files with 47 additions and 45 deletions

View File

@@ -41,7 +41,7 @@
* "Support for video through SDL",
* SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
* "libSDL-1.2.so.0", "libSDL-2.0.so.0", "libSDL3.so.0"
* );
* )
* int main(int argc, char *argv[]) {
* return argc + argv[0][1];
* }
@@ -183,9 +183,11 @@
* "Support for loading PNG images using libpng (required for APNG)",
* SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
* "libpng12.so.0"
* );
* )
* ```
*
* A trailing semicolon is not needed.
*
* Or if you support multiple versions of a library, you can list them:
*
* ```c
@@ -195,7 +197,7 @@
* "Create windows through SDL video backend",
* SDL_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED
* "libSDL-1.2.so.0", "libSDL2-2.0.so.0", "libSDL3.so.0"
* );
* )
* ```
*
* This macro is not available for compilers that do not support variadic
@@ -213,7 +215,7 @@
"\",\"description\":\"" description \
"\",\"priority\":\"" priority \
"\",\"soname\":" SDL_DLNOTE_JSON_ARRAY(__VA_ARGS__) "}]", \
SDL_DLNOTE_UNIQUE_NAME)
SDL_DLNOTE_UNIQUE_NAME);
#elif defined(__GNUC__) && __GNUC__ < 3

View File

@@ -58,7 +58,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for audio through AAudio",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
LIB_AAUDIO_SO
);
)
typedef struct AAUDIO_Data
{

View File

@@ -214,7 +214,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for audio through libalsa",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_AUDIO_DRIVER_ALSA_DYNAMIC
);
)
static void UnloadALSALibrary(void)
{

View File

@@ -55,7 +55,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for audio through libjack",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_AUDIO_DRIVER_JACK_DYNAMIC
);
)
static const char *jack_library = SDL_AUDIO_DRIVER_JACK_DYNAMIC;
static SDL_SharedObject *jack_handle = NULL;

View File

@@ -98,7 +98,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for audio through libpipewire",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC
);
)
static const char *pipewire_library = SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC;
static SDL_SharedObject *pipewire_handle = NULL;

View File

@@ -138,7 +138,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for audio through libpulseaudio",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
);
)
static const char *pulseaudio_library = SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC;
static SDL_SharedObject *pulseaudio_handle = NULL;

View File

@@ -113,7 +113,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for audio through libsndio",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
);
)
static void UnloadSNDIOLibrary(void)
{

View File

@@ -114,7 +114,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for camera through libpipewire",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_CAMERA_DRIVER_PIPEWIRE_DYNAMIC
);
)
static const char *pipewire_library = SDL_CAMERA_DRIVER_PIPEWIRE_DYNAMIC;
static SDL_SharedObject *pipewire_handle = NULL;

View File

@@ -36,7 +36,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for D-Bus IPC",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_DRIVER_DBUS_DYNAMIC
);
)
static bool LoadDBUSSyms(void)
{

View File

@@ -51,7 +51,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for events through libudev",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_UDEV_DLNOTE_LIBS
);
)
static SDL_UDEV_PrivateData *_this = NULL;

View File

@@ -30,7 +30,7 @@ SDL_ELF_NOTE_DLOPEN(
"Bidirectional text support",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_FRIBIDI_DYNAMIC
);
)
#endif
SDL_FriBidi *SDL_FriBidi_Create(void)

View File

@@ -30,7 +30,7 @@ SDL_ELF_NOTE_DLOPEN(
"Thai language support",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_LIBTHAI_DYNAMIC
);
)
#endif

View File

@@ -46,7 +46,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for joysticks through libusb",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_LIBUSB_DYNAMIC
);
)
#endif
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)

View File

@@ -53,7 +53,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for async IO through liburing",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_DRIVER_LIBURING_DYNAMIC
);
)
#define SDL_LIBURING_FUNCS \
SDL_LIBURING_FUNC(int, io_uring_queue_init, (unsigned entries, struct io_uring *ring, unsigned flags)) \

View File

@@ -30,7 +30,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for joysticks through libusb",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_LIBUSB_DYNAMIC
);
)
#endif
static SDL_AtomicInt SDL_libusb_refcount;

View File

@@ -38,7 +38,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for Steam user storage",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_DRIVER_STEAMAPI_DYNAMIC
);
)
// !!! FIXME: Async API can use SteamRemoteStorage_ReadFileAsync
// !!! FIXME: Async API can use SteamRemoteStorage_WriteFileAsync

View File

@@ -116,31 +116,31 @@ SDL_ELF_NOTE_DLOPEN(
"Support for OpenGL",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_OGL, ALT_OGL
);
)
SDL_ELF_NOTE_DLOPEN(
"egl-egl",
"Support for EGL",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_EGL
);
)
SDL_ELF_NOTE_DLOPEN(
"egl-es2",
"Support for EGL ES2",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_OGL_ES2
);
)
SDL_ELF_NOTE_DLOPEN(
"egl-es-pvr",
"Support for EGL ES PVR",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_OGL_ES_PVR
);
)
SDL_ELF_NOTE_DLOPEN(
"egl-ogl-es",
"Support for OpenGL ES",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_OGL_ES
);
)
#endif // SDL_VIDEO_DRIVER_RPI
#if defined(SDL_VIDEO_OPENGL) && !defined(SDL_VIDEO_VITA_PVR_OGL)

View File

@@ -34,7 +34,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for KMSDRM",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC
);
)
typedef struct
{

View File

@@ -47,7 +47,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for Vulkan on KMSDRM",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_VULKAN
);
)
bool KMSDRM_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{

View File

@@ -47,7 +47,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for offscreen Vulkan",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
"libvulkan.so.1"
);
)
#if defined( SDL_PLATFORM_APPLE )
#include <dlfcn.h>

View File

@@ -64,7 +64,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for OpenVR video",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_OPENVR_DRIVER_DYNAMIC
);
)
#define MARKER_ID 0
#define MARKER_STR "vr-marker,frame_end,type,application"

View File

@@ -33,14 +33,14 @@ SDL_ELF_NOTE_DLOPEN(
"Support for Wayland video",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
);
)
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
SDL_ELF_NOTE_DLOPEN(
"wayland",
"Support for Wayland video",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
);
)
#endif
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
SDL_ELF_NOTE_DLOPEN(
@@ -48,7 +48,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for Wayland video",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
);
)
#endif
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
SDL_ELF_NOTE_DLOPEN(
@@ -56,7 +56,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for Wayland video",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
);
)
#endif
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
SDL_ELF_NOTE_DLOPEN(
@@ -64,7 +64,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for Wayland video",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
);
)
#endif
typedef struct

View File

@@ -46,7 +46,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for Vulkan on wayland backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_VULKAN
);
)
bool Wayland_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{

View File

@@ -43,7 +43,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for video through X11 backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_VIDEO_DRIVER_X11_DYNAMIC
);
)
#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
SDL_ELF_NOTE_DLOPEN(
@@ -51,7 +51,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for video through X11 backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
);
)
#else
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT NULL
#endif
@@ -62,7 +62,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for video through X11 backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR
);
)
#else
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR NULL
#endif
@@ -73,7 +73,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for video through X11 backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2
);
)
#else
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 NULL
#endif
@@ -84,7 +84,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for video through X11 backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES
);
)
#else
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES NULL
#endif
@@ -95,7 +95,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for video through X11 backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
);
)
#else
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR NULL
#endif
@@ -106,7 +106,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for video through X11 backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
);
)
#else
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS NULL
#endif
@@ -117,7 +117,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for video through X11 backend",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_VIDEO_DRIVER_X11_DYNAMIC_XTEST
);
)
#else
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XTEST NULL
#endif

View File

@@ -44,14 +44,14 @@ SDL_ELF_NOTE_DLOPEN(
"Support for vulkan on X11",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_VULKAN
);
)
SDL_ELF_NOTE_DLOPEN(
"x11-vulkan",
"Support for vulkan on X11",
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
DEFAULT_X11_XCB
);
)
/*
typedef uint32_t xcb_window_t;

View File

@@ -14,7 +14,7 @@ SDL_ELF_NOTE_DLOPEN(
"Support for loading PNG images using libpng",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
PNG_SHARED_LIBRARY
);
)
typedef int png_sig_cmp_fn(const unsigned char *sig, size_t start, size_t num_to_check);