- More implementations and dependencies for Linux Wayland support

This commit is contained in:
2025-07-26 20:57:25 -04:00
parent 7ea2710ee0
commit 7493b5252a
78 changed files with 3733 additions and 316 deletions

View File

@@ -16,7 +16,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================
#include <fennec/platform/linux/wayland/lib/sym_def.h>
#include <fennec/platform/linux/wayland/lib/wayland-client.h>
#include <fennec/platform/linux/wayland/lib/dyn.h>
namespace fennec
@@ -31,7 +31,6 @@ static int _load_count = 0;
// Create private variables
#define FENNEC_LIB(lib) static shared_lib _FENNEC_LIB_##lib = { nullptr, FENNEC_LIB_##lib };
#define FENNEC_SYMBOL(...)
#include <fennec/platform/linux/wayland/lib/sym.h>
bool load_symbols(linux_platform* platform) {
@@ -39,14 +38,20 @@ bool load_symbols(linux_platform* platform) {
return true;
}
shared_lib* current_lib = nullptr;
#define FENNEC_LIB(lib) _FENNEC_LIB_##lib._lib = platform->load_object(_FENNEC_LIB_##lib._name); \
FENNEC_HAS_LIB_##lib = _FENNEC_LIB_##lib._lib != nullptr; \
if(not FENNEC_HAS_LIB_##lib) { \
unload_symbols(platform); \
return false; \
} \
shared_lib& current_lib = _FENNEC_LIB_##lib;
#define FENNEC_SYMBOL(ret, fn, ...) fn = (sym_##fn)(platform->find_symbol(current_lib._lib, #fn));
current_lib = &_FENNEC_LIB_##lib;
#define FENNEC_SYMBOL(ret, fn, ...) fn = (sym_##fn)(platform->find_symbol(current_lib->_lib, #fn)); \
assertf(fn != nullptr, "Failed to find symbol: " #fn);
#define FENNEC_GLOBAL(type, name) name = (type*)(platform->find_symbol(current_lib->_lib, #name)); \
assertf(name != nullptr, "Failed to find global: " #name);
#include <fennec/platform/linux/wayland/lib/sym.h>
return true;
@@ -60,6 +65,7 @@ void unload_symbols(linux_platform* platform) {
#define FENNEC_LIB(lib) platform->unload_object(_FENNEC_LIB_##lib._lib); \
_FENNEC_LIB_##lib._lib = nullptr;
#define FENNEC_SYMBOL(ret, fn, ...) fn = nullptr;
#define FENNEC_GLOBAL(type, name) name = nullptr;
#include <fennec/platform/linux/wayland/lib/sym.h>
}