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.

Details

Summary

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

Test Plan

compilation

Diff Detail

Repository
rEFL core/efl
Branch
vtorri_bswap
Lint
No Linters Available
Unit
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 https://phab.enlightenment.org/D8548, would that be applicable to you ?