Fix pedantic warnings in mingw builds.
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
16a9542a17
commit
156561b0ad
@ -117,10 +117,6 @@
|
|||||||
#include "internal/cryptlib.h"
|
#include "internal/cryptlib.h"
|
||||||
#include <openssl/safestack.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) || \
|
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
|
||||||
defined(__INTEL__) || \
|
defined(__INTEL__) || \
|
||||||
defined(__x86_64) || defined(__x86_64__) || \
|
defined(__x86_64) || defined(__x86_64__) || \
|
||||||
@ -268,15 +264,15 @@ int OPENSSL_isservice(void)
|
|||||||
WCHAR *name;
|
WCHAR *name;
|
||||||
static union {
|
static union {
|
||||||
void *p;
|
void *p;
|
||||||
int (*f) (void);
|
FARPROC f;
|
||||||
} _OPENSSL_isservice = {
|
} _OPENSSL_isservice = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_OPENSSL_isservice.p == NULL) {
|
if (_OPENSSL_isservice.p == NULL) {
|
||||||
HANDLE h = GetModuleHandle(NULL);
|
HANDLE mod = GetModuleHandle(NULL);
|
||||||
if (h != NULL)
|
if (mod != NULL)
|
||||||
_OPENSSL_isservice.p = GetProcAddress(h, "_OPENSSL_isservice");
|
_OPENSSL_isservice.f = GetProcAddress(mod, "_OPENSSL_isservice");
|
||||||
if (_OPENSSL_isservice.p == NULL)
|
if (_OPENSSL_isservice.p == NULL)
|
||||||
_OPENSSL_isservice.p = (void *)-1;
|
_OPENSSL_isservice.p = (void *)-1;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,10 @@ static int win32_unload(DSO *dso)
|
|||||||
static void *win32_bind_var(DSO *dso, const char *symname)
|
static void *win32_bind_var(DSO *dso, const char *symname)
|
||||||
{
|
{
|
||||||
HINSTANCE *ptr;
|
HINSTANCE *ptr;
|
||||||
void *sym;
|
union {
|
||||||
|
void *p;
|
||||||
|
FARPROC f;
|
||||||
|
} sym;
|
||||||
|
|
||||||
if ((dso == NULL) || (symname == NULL)) {
|
if ((dso == NULL) || (symname == NULL)) {
|
||||||
DSOerr(DSO_F_WIN32_BIND_VAR, ERR_R_PASSED_NULL_PARAMETER);
|
DSOerr(DSO_F_WIN32_BIND_VAR, ERR_R_PASSED_NULL_PARAMETER);
|
||||||
@ -239,19 +242,22 @@ static void *win32_bind_var(DSO *dso, const char *symname)
|
|||||||
DSOerr(DSO_F_WIN32_BIND_VAR, DSO_R_NULL_HANDLE);
|
DSOerr(DSO_F_WIN32_BIND_VAR, DSO_R_NULL_HANDLE);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
sym = GetProcAddress(*ptr, symname);
|
sym.f = GetProcAddress(*ptr, symname);
|
||||||
if (sym == NULL) {
|
if (sym.p == NULL) {
|
||||||
DSOerr(DSO_F_WIN32_BIND_VAR, DSO_R_SYM_FAILURE);
|
DSOerr(DSO_F_WIN32_BIND_VAR, DSO_R_SYM_FAILURE);
|
||||||
ERR_add_error_data(3, "symname(", symname, ")");
|
ERR_add_error_data(3, "symname(", symname, ")");
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
return (sym);
|
return (sym.p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname)
|
static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname)
|
||||||
{
|
{
|
||||||
HINSTANCE *ptr;
|
HINSTANCE *ptr;
|
||||||
void *sym;
|
union {
|
||||||
|
void *p;
|
||||||
|
FARPROC f;
|
||||||
|
} sym;
|
||||||
|
|
||||||
if ((dso == NULL) || (symname == NULL)) {
|
if ((dso == NULL) || (symname == NULL)) {
|
||||||
DSOerr(DSO_F_WIN32_BIND_FUNC, ERR_R_PASSED_NULL_PARAMETER);
|
DSOerr(DSO_F_WIN32_BIND_FUNC, ERR_R_PASSED_NULL_PARAMETER);
|
||||||
@ -266,13 +272,13 @@ static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname)
|
|||||||
DSOerr(DSO_F_WIN32_BIND_FUNC, DSO_R_NULL_HANDLE);
|
DSOerr(DSO_F_WIN32_BIND_FUNC, DSO_R_NULL_HANDLE);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
sym = GetProcAddress(*ptr, symname);
|
sym.f = GetProcAddress(*ptr, symname);
|
||||||
if (sym == NULL) {
|
if (sym.p == NULL) {
|
||||||
DSOerr(DSO_F_WIN32_BIND_FUNC, DSO_R_SYM_FAILURE);
|
DSOerr(DSO_F_WIN32_BIND_FUNC, DSO_R_SYM_FAILURE);
|
||||||
ERR_add_error_data(3, "symname(", symname, ")");
|
ERR_add_error_data(3, "symname(", symname, ")");
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
return ((DSO_FUNC_TYPE)sym);
|
return ((DSO_FUNC_TYPE)sym.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct file_st {
|
struct file_st {
|
||||||
@ -704,7 +710,10 @@ static void *win32_globallookup(const char *name)
|
|||||||
CREATETOOLHELP32SNAPSHOT create_snap;
|
CREATETOOLHELP32SNAPSHOT create_snap;
|
||||||
CLOSETOOLHELP32SNAPSHOT close_snap;
|
CLOSETOOLHELP32SNAPSHOT close_snap;
|
||||||
MODULE32 module_first, module_next;
|
MODULE32 module_first, module_next;
|
||||||
FARPROC ret = NULL;
|
union {
|
||||||
|
void *p;
|
||||||
|
FARPROC f;
|
||||||
|
} ret = { NULL };
|
||||||
|
|
||||||
dll = LoadLibrary(TEXT(DLLNAME));
|
dll = LoadLibrary(TEXT(DLLNAME));
|
||||||
if (dll == NULL) {
|
if (dll == NULL) {
|
||||||
@ -745,10 +754,10 @@ static void *win32_globallookup(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((ret = GetProcAddress(me32.hModule, name))) {
|
if ((ret.f = GetProcAddress(me32.hModule, name))) {
|
||||||
(*close_snap) (hModuleSnap);
|
(*close_snap) (hModuleSnap);
|
||||||
FreeLibrary(dll);
|
FreeLibrary(dll);
|
||||||
return ret;
|
return ret.p;
|
||||||
}
|
}
|
||||||
} while ((*module_next) (hModuleSnap, &me32));
|
} while ((*module_next) (hModuleSnap, &me32));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user