From 1a7c4a24f7ea8985cd815c8c82553a495fec9969 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 17 Jul 2020 20:07:19 +1000 Subject: [PATCH] I am altering the API. Pray I don't alter it any further. Readd obsolete Dynamic_Get/Load because some plugins depend on it --- src/Platform.c | 10 ++++++++++ src/Platform.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/Platform.c b/src/Platform.c index 152d2a2b5..6d0a8be2c 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -1467,6 +1467,16 @@ cc_bool DynamicLib_DescribeError(String* dst) { } #endif +cc_result DynamicLib_Load(const String* path, void** lib) { + *lib = DynamicLib_Load2(path); + return *lib == NULL; +} +cc_result DynamicLib_Get(void* lib, const char* name, void** symbol) { + *symbol = DynamicLib_Get2(lib, name); + return *symbol == NULL; +} + + cc_bool DynamicLib_GetAll(void* lib, const struct DynamicLibSym* syms, int count) { int i, loaded = 0; void* addr; diff --git a/src/Platform.h b/src/Platform.h index 060c88a2a..1eb96677e 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -88,6 +88,8 @@ CC_API cc_bool DynamicLib_DescribeError(String* dst); /* The default file extension used for dynamic libraries on this platform. */ extern const String DynamicLib_Ext; +CC_API cc_result DynamicLib_Load(const String* path, void** lib); /* OBSOLETE */ +CC_API cc_result DynamicLib_Get(void* lib, const char* name, void** symbol); /* OBSOLETE */ /* Represents a name, and a pointer to variable that will hold the loaded symbol */ /* static int (APIENTRY *_myGetError)(void); --- (for example) */ /* static struct DynamicLibSym sym = { "myGetError", (void**)&_myGetError }; */