Eo array callback: Fix compilation on windows.

I knew Windows doesn't allow statically initialising pointers in the
global namespace, I had no idea it also applies to functions. That's
quite annoying.

Thanks to Cedric for reporting.
This commit is contained in:
Tom Hacohen 2016-09-05 17:51:07 +01:00
parent 9c779dca90
commit 829f298589
1 changed files with 4 additions and 2 deletions

View File

@ -1094,10 +1094,12 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const Efl_Callback_
static Efl_Callback_Array_Item * \
Name(void) \
{ \
static Efl_Callback_Array_Item internal[] = { __VA_ARGS__, \
{ 0, 0 } }; \
Efl_Callback_Array_Item tmp[] = { __VA_ARGS__ }; \
static Efl_Callback_Array_Item internal[EINA_C_ARRAY_LENGTH(tmp) + 1] = \
{ { 0, 0 } }; \
if (internal[0].desc == NULL) \
{ \
memcpy(internal, tmp, sizeof(tmp)); \
qsort(internal, EINA_C_ARRAY_LENGTH(internal) - 1, sizeof (internal[0]), \
(void*) efl_callbacks_cmp); \
} \