forked from enlightenment/efl
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:
parent
ff14c84fcb
commit
1a621c9109
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue