eo_base_class: move shift init to the first call

Summary:
this cannot be evalulated in compile time, so this must be evalulated in
runtime, at the first call.

This should fix OSX build.

Co-authored-by: Cedric Bail <cedric.bail@free.fr>

Reviewers: zmike, cedric, raster

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10582
This commit is contained in:
Marcel Hollerbach 2019-10-31 12:48:27 -04:00 committed by Mike Blumenkrantz
parent ff14c84fcb
commit 1a621c9109
1 changed files with 6 additions and 1 deletions

View File

@ -1230,7 +1230,12 @@ _efl_pending_future_new(void)
static inline unsigned char
_pointer_hash(const uintptr_t val)
{
static const unsigned char shift = (unsigned char) log2(1 + sizeof (Efl_Event_Description));
static unsigned char shift = 0;
/* Sadly LLVM doesn't have log2 in its compile time optimization. So
we can not use static const here for portability sake. */
if (EINA_UNLIKELY((!shift)))
shift = (unsigned char) log2(1 + sizeof (Efl_Event_Description));
#ifdef EFL64
return (unsigned char)(((val) >> shift) & 0x3F);
#else