]> localhost Git - pldh.git/commitdiff
Fix to use PLDLOG
authormisomosi <[email protected]>
Tue, 7 May 2024 02:38:55 +0000 (22:38 -0400)
committermisomosi <[email protected]>
Tue, 7 May 2024 02:38:55 +0000 (22:38 -0400)
pld.h

diff --git a/pld.h b/pld.h
index 7c50c95b625f7e91a5fd77ae6696f0d1a2df6024..496b92ad19ff06ffddddbda0cfc385b57c1c5fe8 100644 (file)
--- a/pld.h
+++ b/pld.h
@@ -15,6 +15,9 @@ static int PLD_Private_strlen(const char *s)
        return len - 1;\r
 }\r
 \r
+#ifndef PLDLOG\r
+#define PLDLOG(message, name, err) PLD_Private_Log(message, name, err)\r
+#endif\r
 \r
 #ifdef _WIN32\r
 \r
@@ -46,7 +49,7 @@ static HMODULE PLD_Private_LoadLibrary_wrapper(LPCSTR lpLibFileName)
        if (hModule == NULL)\r
                hModule = LoadLibraryA(lpLibFileName);\r
        if (hModule == NULL)\r
-               PLD_Private_Log("Failed to load library!", lpLibFileName, GetLastError());\r
+               PLDLOG("Failed to load library!", lpLibFileName, GetLastError());\r
        return hModule;\r
 }\r
 \r
@@ -54,7 +57,7 @@ static FARPROC PLD_Private_GetProcAddress_wrapper(HMODULE hModule, LPCSTR lpProc
 {\r
        FARPROC lpProc = GetProcAddress(hModule, lpProcName);\r
        if (lpProc == NULL)\r
-               PLD_Private_Log("Failed to load procedure!", lpProcName, GetLastError());\r
+               PLDLOG("Failed to load procedure!", lpProcName, GetLastError());\r
        return lpProc;\r
 }\r
 \r
@@ -75,6 +78,7 @@ static FARPROC PLD_Private_GetProcAddress_wrapper(HMODULE hModule, LPCSTR lpProc
 #include <stdint.h>\r
 #include <string.h>\r
 #include <dlfcn.h>\r
+\r
 typedef intptr_t PLD_ErrCode;\r
 static void PLD_Private_Log(const char *, const char *, PLD_ErrCode);\r
 \r
@@ -97,7 +101,7 @@ static void *PLD_Private_dlopen_wrapper(const char *name)
        if (handle == NULL)\r
                handle = dlopen(name, RTLD_LAZY);\r
        if (handle == NULL)\r
-               PLD_Private_Log("Failed to load library!", name, (intptr_t)dlerror());\r
+               PLDLOG("Failed to load library!", name, (intptr_t)dlerror());\r
        return handle;\r
 }\r
 \r
@@ -105,7 +109,7 @@ static void *PLD_Private_dlsym_wrapper(void *handle, const char *name)
 {\r
        void *sym = dlsym(handle, name);\r
        if (sym == NULL)\r
-               PLD_Private_Log("Failed to load procedure!", name, (intptr_t)dlerror());\r
+               PLDLOG("Failed to load procedure!", name, (intptr_t)dlerror());\r
        return sym;\r
 }\r
 \r
@@ -140,8 +144,4 @@ static void PLD_Private_Log(const char *message, const char *name, PLD_ErrCode e
 #endif\r
 }\r
 \r
-#ifndef PLDLOG\r
-#define PLDLOG(message, name, err) PLD_Private_Log(message, name, err)\r
-#endif\r
-\r
 #endif // COOL_PLD_H\r