eina: set EINA_VALUE_EMPTY during library init.
authorCedric BAIL <cedric.bail@free.fr>
Wed, 17 Jul 2019 18:12:18 +0000 (11:12 -0700)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Tue, 23 Jul 2019 05:04:43 +0000 (14:04 +0900)
This is a work around compiler/linker limit on some system as reported
by Romain Naour.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9348

src/lib/eina/eina_value.c

index a2f6f53..3df0baa 100644 (file)
@@ -54,7 +54,7 @@ static Eina_Hash *_eina_value_inner_mps = NULL;
 static Eina_Lock _eina_value_inner_mps_lock;
 static char *_eina_value_mp_choice = NULL;
 static int _eina_value_log_dom = -1;
-static const Eina_Value _eina_value_empty = EINA_VALUE_EMPTY;
+static Eina_Value _eina_value_empty;
 
 #ifdef ERR
 #undef ERR
@@ -5400,6 +5400,7 @@ eina_value_inner_free(size_t size, void *mem)
 Eina_Bool
 eina_value_init(void)
 {
+   const Eina_Value empty = EINA_VALUE_EMPTY;
    const char *choice, *tmp;
 
    _eina_value_log_dom = eina_log_domain_register("eina_value",
@@ -5486,6 +5487,8 @@ eina_value_init(void)
 
    EINA_ERROR_VALUE_FAILED = eina_error_msg_static_register("Eina_Value failed to copy/convert.");
 
+   memcpy(&_eina_value_empty, &empty, sizeof (empty));
+
    return EINA_TRUE;
 
  on_init_fail_hash: