stop warnings about no previous prototype when compiling shared engines

This commit is contained in:
Dr. Stephen Henson 2011-01-30 01:30:48 +00:00
parent 225c272193
commit eb164d0b12
4 changed files with 17 additions and 0 deletions

View File

@ -678,6 +678,7 @@ typedef struct st_dynamic_fns {
* can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */
typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version);
#define IMPLEMENT_DYNAMIC_CHECK_FN() \ #define IMPLEMENT_DYNAMIC_CHECK_FN() \
OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
return 0; } return 0; }
@ -700,6 +701,8 @@ typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version);
typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
const dynamic_fns *fns); const dynamic_fns *fns);
#define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
OPENSSL_EXPORT \
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
OPENSSL_EXPORT \ OPENSSL_EXPORT \
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \

View File

@ -1886,6 +1886,8 @@ static int cert_select_dialog(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs)
#include <openssl/engine.h> #include <openssl/engine.h>
#ifndef OPENSSL_NO_DYNAMIC_ENGINE #ifndef OPENSSL_NO_DYNAMIC_ENGINE
OPENSSL_EXPORT OPENSSL_EXPORT
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns);
OPENSSL_EXPORT
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; } int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; }
IMPLEMENT_DYNAMIC_CHECK_FN() IMPLEMENT_DYNAMIC_CHECK_FN()
#else #else

View File

@ -471,6 +471,8 @@ static int bind_fn(ENGINE *e, const char *id)
IMPLEMENT_DYNAMIC_BIND_FN(bind_fn) IMPLEMENT_DYNAMIC_BIND_FN(bind_fn)
#else #else
OPENSSL_EXPORT OPENSSL_EXPORT
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns);
OPENSSL_EXPORT
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; } int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; }
#endif #endif
#endif /* !OPENSSL_NO_DYNAMIC_ENGINE */ #endif /* !OPENSSL_NO_DYNAMIC_ENGINE */

View File

@ -107,10 +107,14 @@
) || \ ) || \
(defined(_MSC_VER) && defined(_M_IX86)) (defined(_MSC_VER) && defined(_M_IX86))
# define COMPILE_HW_PADLOCK # define COMPILE_HW_PADLOCK
# ifdef OPENSSL_NO_DYNAMIC_ENGINE
static ENGINE *ENGINE_padlock (void); static ENGINE *ENGINE_padlock (void);
# endif # endif
# endif
#endif #endif
#ifdef OPENSSL_NO_DYNAMIC_ENGINE
void ENGINE_load_padlock (void) void ENGINE_load_padlock (void)
{ {
/* On non-x86 CPUs it just returns. */ /* On non-x86 CPUs it just returns. */
@ -123,6 +127,8 @@ void ENGINE_load_padlock (void)
#endif #endif
} }
#endif
#ifdef COMPILE_HW_PADLOCK #ifdef COMPILE_HW_PADLOCK
/* We do these includes here to avoid header problems on platforms that /* We do these includes here to avoid header problems on platforms that
do not have the VIA padlock anyway... */ do not have the VIA padlock anyway... */
@ -196,6 +202,7 @@ padlock_bind_helper(ENGINE *e)
return 1; return 1;
} }
#ifdef OPENSSL_NO_DYNAMIC_ENGINE
/* Constructor */ /* Constructor */
static ENGINE * static ENGINE *
ENGINE_padlock(void) ENGINE_padlock(void)
@ -213,6 +220,7 @@ ENGINE_padlock(void)
return eng; return eng;
} }
#endif
/* Check availability of the engine */ /* Check availability of the engine */
static int static int
@ -1322,6 +1330,8 @@ static RAND_METHOD padlock_rand = {
#else /* !COMPILE_HW_PADLOCK */ #else /* !COMPILE_HW_PADLOCK */
#ifndef OPENSSL_NO_DYNAMIC_ENGINE #ifndef OPENSSL_NO_DYNAMIC_ENGINE
OPENSSL_EXPORT OPENSSL_EXPORT
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns);
OPENSSL_EXPORT
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; } int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; }
IMPLEMENT_DYNAMIC_CHECK_FN() IMPLEMENT_DYNAMIC_CHECK_FN()
#endif #endif