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

Properly fix altivec namespace collisions #672

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

easyaspi314
Copy link
Contributor

Uses #pragma push_macro/#pragma pop_macro instead of assuming that__APPLE_ALTIVEC__ can be defined safely.

Safer and less hacky fix for #668.

@easyaspi314
Copy link
Contributor Author

CC @pkubaj
can you try this?

Uses `#pragma push_macro`/`#pragma pop_macro` instead of assuming that
`__APPLE_ALTIVEC__` can be defined safely.

Safer and less hacky fix for Cyan4973#668.
@pkubaj
Copy link

pkubaj commented Jan 4, 2022

Yes, that works as well, thanks!

@Cyan4973
Copy link
Owner

Cyan4973 commented Jan 4, 2022

minor concern :
how certain are we that compilers following this code branch (#if XXH_VECTOR == XXH_VSX)
necessarily support the #pragma push statement ?

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Jan 4, 2022
In file included from /wrkdirs/usr/ports/lang/php81/work/php-8.1.1/ext/hash/hash_xxhash.c:18:
In file included from ext/hash/php_hash_xxhash.h:21:
In file included from /wrkdirs/usr/ports/lang/php81/work/php-8.1.1/ext/hash/xxhash/xxhash.h:2412:
/usr/lib/clang/11.0.1/include/altivec.h:55:19: error: unknown type name 'vector'
static __inline__ vector bool char __ATTRS_o_ai
                  ^
/usr/lib/clang/11.0.1/include/altivec.h:56:10: error: unknown type name 'vector'
vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
         ^
/usr/lib/clang/11.0.1/include/altivec.h:56:32: error: unknown type name 'vector'
vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
                               ^
/usr/lib/clang/11.0.1/include/altivec.h:66:19: error: unknown type name 'vector'
static __inline__ vector bool short __ATTRS_o_ai vec_perm(

Patch from Cyan4973/xxHash#672
@easyaspi314
Copy link
Contributor Author

minor concern :
how certain are we that compilers following this code branch (#if XXH_VECTOR == XXH_VSX)
necessarily support the #pragma push statement ?

Because the VSX path is only enabled on GCC compatible compilers.

@Cyan4973 Cyan4973 merged commit 83b2235 into Cyan4973:dev Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants