#include "internal/cryptlib.h"
#include <openssl/safestack.h>
-#if defined(OPENSSL_SYS_WIN32)
-static double SSLeay_MSVC5_hack = 0.0; /* and for VC1.5 */
-#endif
-
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
defined(__INTEL__) || \
defined(__x86_64) || defined(__x86_64__) || \
WCHAR *name;
static union {
void *p;
- int (*f) (void);
+ FARPROC f;
} _OPENSSL_isservice = {
NULL
};
if (_OPENSSL_isservice.p == NULL) {
- HANDLE h = GetModuleHandle(NULL);
- if (h != NULL)
- _OPENSSL_isservice.p = GetProcAddress(h, "_OPENSSL_isservice");
+ HANDLE mod = GetModuleHandle(NULL);
+ if (mod != NULL)
+ _OPENSSL_isservice.f = GetProcAddress(mod, "_OPENSSL_isservice");
if (_OPENSSL_isservice.p == NULL)
_OPENSSL_isservice.p = (void *)-1;
}
static void *win32_bind_var(DSO *dso, const char *symname)
{
HINSTANCE *ptr;
- void *sym;
+ union {
+ void *p;
+ FARPROC f;
+ } sym;
if ((dso == NULL) || (symname == NULL)) {
DSOerr(DSO_F_WIN32_BIND_VAR, ERR_R_PASSED_NULL_PARAMETER);
DSOerr(DSO_F_WIN32_BIND_VAR, DSO_R_NULL_HANDLE);
return (NULL);
}
- sym = GetProcAddress(*ptr, symname);
- if (sym == NULL) {
+ sym.f = GetProcAddress(*ptr, symname);
+ if (sym.p == NULL) {
DSOerr(DSO_F_WIN32_BIND_VAR, DSO_R_SYM_FAILURE);
ERR_add_error_data(3, "symname(", symname, ")");
return (NULL);
}
- return (sym);
+ return (sym.p);
}
static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname)
{
HINSTANCE *ptr;
- void *sym;
+ union {
+ void *p;
+ FARPROC f;
+ } sym;
if ((dso == NULL) || (symname == NULL)) {
DSOerr(DSO_F_WIN32_BIND_FUNC, ERR_R_PASSED_NULL_PARAMETER);
DSOerr(DSO_F_WIN32_BIND_FUNC, DSO_R_NULL_HANDLE);
return (NULL);
}
- sym = GetProcAddress(*ptr, symname);
- if (sym == NULL) {
+ sym.f = GetProcAddress(*ptr, symname);
+ if (sym.p == NULL) {
DSOerr(DSO_F_WIN32_BIND_FUNC, DSO_R_SYM_FAILURE);
ERR_add_error_data(3, "symname(", symname, ")");
return (NULL);
}
- return ((DSO_FUNC_TYPE)sym);
+ return ((DSO_FUNC_TYPE)sym.f);
}
struct file_st {
CREATETOOLHELP32SNAPSHOT create_snap;
CLOSETOOLHELP32SNAPSHOT close_snap;
MODULE32 module_first, module_next;
- FARPROC ret = NULL;
+ union {
+ void *p;
+ FARPROC f;
+ } ret = { NULL };
dll = LoadLibrary(TEXT(DLLNAME));
if (dll == NULL) {
}
do {
- if ((ret = GetProcAddress(me32.hModule, name))) {
+ if ((ret.f = GetProcAddress(me32.hModule, name))) {
(*close_snap) (hModuleSnap);
FreeLibrary(dll);
- return ret;
+ return ret.p;
}
} while ((*module_next) (hModuleSnap, &me32));