Skip to content

Commit a1b6691

Browse files
committed
MDEV-23925: Fixed warnings generated during compilation of mysys_ssl/openssl.c on MacOS
Compiler warnings like one listed below are generated during server build on MacOS: In file included from server-10.2-MDEV-23564/mysys_ssl/openssl.c:33: In file included from /usr/local/include/openssl/evp.h:16: In file included from /usr/local/include/openssl/bio.h:20: /usr/local/include/openssl/crypto.h:206:10: warning: 'CRYPTO_cleanup_all_ex_data' macro redefined [-Wmacro-redefined] ^ /mariadb/server-10.2-MDEV-23564/include/ssl_compat.h:46:9: note: previous definition is here ^ In case MariaDB serer is build with -DCMAKE_BUILD_TYPE=Debug it results in build error. The reason of compiler warnings is that header file <ssl_compat.h> included before the openssl system header files. File ssl_compat.h contains some macros with the same names as SSL API functions declared in the openssl system header files. It resulted in duplicate symbols that produces compiler warnings. To fix the issue the header file ssl_compat.h should be included after a line where openssl system header is included.
1 parent 0049d5b commit a1b6691

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mysys_ssl/openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1616

1717
#include <my_global.h>
18-
#include <ssl_compat.h>
1918

2019
/*
2120
The check is only done for OpenSSL 1.1.x.
@@ -25,13 +24,14 @@
2524
*/
2625

2726
#ifndef HAVE_OPENSSL11
27+
#include <ssl_compat.h>
2828
int check_openssl_compatibility()
2929
{
3030
return 0;
3131
}
3232
#else
3333
#include <openssl/evp.h>
34-
34+
#include <ssl_compat.h>
3535
static uint testing, alloc_size, alloc_count;
3636

3737
static void *coc_malloc(size_t size, const char *f __attribute__((unused)),

0 commit comments

Comments
 (0)