SDL_ELF_NOTE_DLOPEN(3)
π SDL_ELF_NOTE_DLOPEN π
okay so bestie, this one lives in the SDL3 FUNCTIONS crew, and it's about telling the world (well, telling ld.so and friends) that your app dynamically loads shared libraries. it's giving "hey, here's my shopping list of .so files" and honestly? iconic. ποΈβ¨
πΈ NAME πΈ
SDL_ELF_NOTE_DLOPEN β adds a note that your application has dynamic shared library dependencies. that's it, that's the whole job. no cap. π
π SYNOPSIS π
#include <SDL3/SDL_dlopennote.h>
#define SDL_ELF_NOTE_DLOPEN(feature, description, priority, ...) \
SDL_ELF_NOTE_INTERNAL( \
"[{\"feature\":\"" feature \
"\",\"description\":\"" description \
"\",\"priority\":\"" priority \
"\",\"soname\":" SDL_DLNOTE_JSON_ARRAY(__VA_ARGS__) "}]", \
SDL_DLNOTE_UNIQUE_NAME);
β¨ DESCRIPTION β¨
so the way you do this is you drop it in the global scope, like so:
SDL_ELF_NOTE_DLOPEN(
"png",
"Support for loading PNG images using libpng (required for APNG)",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
"libpng12.so.0"
)
π«Ά heads up bestie: a trailing semicolon is not needed. the macro said "no thanks, I'm full."
and if you're that girl who supports multiple versions of a library? you can literally just list them all out, no gatekeeping:
// Our app supports SDL1, SDL2, and SDL3 by dynamically loading them
SDL_ELF_NOTE_DLOPEN(
"SDL",
"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"
)
π real talk though: this macro is not available for compilers that don't support variadic macros. if your compiler can't do ..., this whole vibe is a no-go. sorry babe.
π AVAILABILITY π
this macro is available since SDL 3.4.0. she's new-ish, she's fresh, she's serving. π
π¦ SEE ALSO π¦
SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED(3)SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED(3)SDL_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED(3)
go read those next, they're the priority girlies and they matter. iykyk. π
okay that's the whole page!! mwah π this came to you from Simple Directmedia Layer, version SDL 3.4.18, and this manual page is SDL_ELF_NOTE_DLOPEN(3). stay loaded, bestie πβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms