From 9771d184f2a5166e44239c2a61245bd2f1217476 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Wed, 6 Jun 2012 06:45:23 +0100 Subject: [PATCH] Squashed -DNO_SSL build warning --- mongoose.c | 16 +++++++++------- test/test.pl | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mongoose.c b/mongoose.c index 5c038793..fd897e51 100644 --- a/mongoose.c +++ b/mongoose.c @@ -357,6 +357,7 @@ static struct ssl_func ssl_sw[] = { }; // Similar array as ssl_sw. These functions could be located in different lib. +#if !defined(NO_SSL) static struct ssl_func crypto_sw[] = { {"CRYPTO_num_locks", NULL}, {"CRYPTO_set_locking_callback", NULL}, @@ -365,6 +366,7 @@ static struct ssl_func crypto_sw[] = { {"ERR_error_string", NULL}, {NULL, NULL} }; +#endif // NO_SSL #endif // NO_SSL_DL static const char *month_names[] = { @@ -572,13 +574,6 @@ static void cry(struct mg_connection *conn, const char *fmt, ...) { conn->request_info.log_message = NULL; } -// Return OpenSSL error message -static const char *ssl_error(void) { - unsigned long err; - err = ERR_get_error(); - return err == 0 ? "" : ERR_error_string(err, NULL); -} - // Return fake connection structure. Used for logging, if connection // is not applicable at the moment of logging. static struct mg_connection *fc(struct mg_context *ctx) { @@ -3657,6 +3652,13 @@ static int set_uid_option(struct mg_context *ctx) { #if !defined(NO_SSL) static pthread_mutex_t *ssl_mutexes; +// Return OpenSSL error message +static const char *ssl_error(void) { + unsigned long err; + err = ERR_get_error(); + return err == 0 ? "" : ERR_error_string(err, NULL); +} + static void ssl_locking_callback(int mode, int mutex_num, const char *file, int line) { line = 0; // Unused diff --git a/test/test.pl b/test/test.pl index 8a0b61db..3e56eac0 100644 --- a/test/test.pl +++ b/test/test.pl @@ -439,7 +439,7 @@ sub do_PUT_test { sub do_unit_test { my $cmd = "cc -W -Wall -o $unit_test_exe $root/unit_test.c -I. ". - "-pthread -DNO_SSL "; + "-pthread -DNO_SSL "; if (on_windows()) { $cmd = "cl $root/embed.c mongoose.c /I. /nologo /DNO_SSL ". "/DLISTENING_PORT=\\\"$port\\\" /link /out:$embed_exe.exe ws2_32.lib ";