diff options
Diffstat (limited to '')
-rw-r--r-- | common/dynload.h (renamed from include/dynload.h) | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/dynload.h b/common/dynload.h index acdf5c879..9b67fa9ed 100644 --- a/include/dynload.h +++ b/common/dynload.h @@ -21,23 +21,22 @@ #ifndef GNUPG_DYNLOAD_H #define GNUPG_DYNLOAD_H -#if defined (ENABLE_CARD_SUPPORT) || defined(_WIN32) -#ifndef _WIN32 +#ifndef __MINGW32__ #include <dlfcn.h> #else #include <windows.h> #define RTLD_LAZY 0 -static __inline__ void * +static inline void * dlopen (const char * name, int flag) { void * hd = LoadLibrary (name); return hd; } -static __inline__ void * -dlsym (void * hd, const char * sym) +static inline void * +dlsym (void *hd, const char *sym) { if (hd && sym) { @@ -50,23 +49,24 @@ dlsym (void * hd, const char * sym) } -static __inline__ const char * +static inline const char * dlerror (void) { - return w32_strerror (0); + static char buf[32]; + sprintf (buf, "ec=%lu", GetLastError ()); + return buf; } -static __inline__ int +static inline int dlclose (void * hd) { if (hd) { - FreeLibrary (hd); + CloseHandle (hd); return 0; } return -1; } -#endif /*_WIN32*/ -#endif /*ENABLE_CARD_SUPPORT||_WIN32*/ +#endif /*__MINGW32__*/ #endif /*GNUPG_DYNLOAD_H*/ |