Page MenuHomePhabricator

eina: check bswap* in byteswap.h only if it exists, otherwise check if gcc builtin bswap* exists
Needs RevisionPublic

Authored by vtorri on Apr 2 2019, 8:46 PM.



on Windows, byteswap.h does not exist, but gcc builtin bswap* does

Test Plan


Diff Detail

rEFL core/efl
No Linters Available
No Unit Test Coverage
Build Status
Buildable 10729
Build 8345: arc lint + arc unit
vtorri created this revision.Apr 2 2019, 8:46 PM
vtorri requested review of this revision.Apr 2 2019, 8:46 PM
bu5hm4n requested changes to this revision.Apr 3 2019, 1:47 AM
bu5hm4n added a subscriber: bu5hm4n.

you can just add or cc.has_function('bswap_XX) behind the if of has_header_symbol. This keep the whole thing a bit more readable.

This revision now requires changes to proceed.Apr 3 2019, 1:47 AM
vtorri added a comment.Apr 3 2019, 5:20 AM

can you be a bit more explicit, please ? i fear i don't understand what you want me to do

Forget my comment, something else:

The code seems to be able to check for the buildin anyways in the code. So we could simply do EINA_HAS_BUILTIN(__builtin_bswap32) in eina_cpu_inline.x and do no check at all in meson ? What do you think about that ? That would solve our problem in that regard. and simplify the buildsystem.

@vtorri please see, would that be applicable to you ?

after checking, eina_config.h has no EINA_HAS_BUILTIN macro (at least on Windows) with latest git of today(august 31st 2019) with gcc as compiler. Is it normal ?

zmike added a comment.Sep 3 2019, 12:13 PM

I don't have it here (gcc 9.1.1)

actually, i've just checked : eina_config.h is generated independantly of

so it's normal that EINA_HAS_BUILTIN is not defined