mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-9618 solaris sparc build fails on 10.1.
Compiler there is strict about the C/C++ call model mixing in function variable assumptions. Fixed by adding some 'extern "C"' and changing '?' operator with 'if'.
This commit is contained in:
@ -23,6 +23,8 @@
|
||||
static plugin_ref encryption_manager= 0;
|
||||
struct encryption_service_st encryption_handler;
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint no_key(uint)
|
||||
{
|
||||
return ENCRYPTION_KEY_VERSION_INVALID;
|
||||
@ -41,6 +43,8 @@ static unsigned int get_length(unsigned int slen, unsigned int key_id,
|
||||
return my_aes_get_size(MY_AES_CBC, slen);
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
|
||||
int initialize_encryption_plugin(st_plugin_int *plugin)
|
||||
{
|
||||
if (encryption_manager)
|
||||
@ -57,9 +61,15 @@ int initialize_encryption_plugin(st_plugin_int *plugin)
|
||||
st_mariadb_encryption *handle=
|
||||
(struct st_mariadb_encryption*) plugin->plugin->info;
|
||||
|
||||
encryption_handler.encryption_ctx_size_func=
|
||||
handle->crypt_ctx_size ? handle->crypt_ctx_size :
|
||||
(uint (*)(unsigned int, unsigned int))my_aes_ctx_size;
|
||||
/*
|
||||
Copmiler on Spark doesn't like the '?' operator here as it
|
||||
belives the (uint (*)...) implies the C++ call model.
|
||||
*/
|
||||
if (handle->crypt_ctx_size)
|
||||
encryption_handler.encryption_ctx_size_func= handle->crypt_ctx_size;
|
||||
else
|
||||
encryption_handler.encryption_ctx_size_func=
|
||||
(uint (*)(unsigned int, unsigned int))my_aes_ctx_size;
|
||||
|
||||
encryption_handler.encryption_ctx_init_func=
|
||||
handle->crypt_ctx_init ? handle->crypt_ctx_init : ctx_init;
|
||||
|
Reference in New Issue
Block a user