Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to consolidate SSE and ARM NEON SIMD code for GCC/clang and Visual Studio #252

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
12 changes: 12 additions & 0 deletions include/graphene-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,15 @@ typedef int bool;

#define GRAPHENE_PI 3.1415926535897932384626434f
#define GRAPHENE_PI_2 1.5707963267948966192313217f

#if defined (__GNUC__) || defined (__clang__)
#define GRAPHENE_ONELINER(expr) (__extension__ ({expr;}))
#define GRAPHENE_ONELINER_WITH_RTYPE(rtype,expr) (__extension__ ({(rtype) expr;}))
#define GRAPHENE_ONELINER_4ARG_ARRAY_WITH_RTYPE(rtype,v0,v1,v2,v3) (__extension__ ({(rtype){v0, v1, v2, v3};}))
#elif defined (_MSC_VER)
#define GRAPHENE_ONELINER(expr) expr
#define GRAPHENE_ONELINER_WITH_RTYPE(rtype,expr) GRAPHENE_ONELINER (expr)
#define GRAPHENE_ONELINER_4ARG_ARRAY_WITH_RTYPE(rtype,v0,v1,v2,v3) (rtype){v0, v1, v2, v3}
#else
# error Please define macros suitable for your compiler
#endif
Loading