-
Notifications
You must be signed in to change notification settings - Fork 381
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
Tolerate when endian.h is symlink to sys/endian.h #4226
Conversation
Since 5a60b36 varnish drop support of sys/endian.h and they had a bit different API one or two leading `_`. Some system may have symlink from endian.h to sys/endian.h, for example OpenBSD. On such system build fails due to wrong SHA256 hash.
@@ -33,8 +33,16 @@ | |||
|
|||
#ifndef __DARWIN_BYTE_ORDER | |||
# include <endian.h> | |||
# define VBYTE_ORDER __BYTE_ORDER | |||
# define VBIG_ENDIAN __BIG_ENDIAN | |||
# ifdef _BYTE_ORDER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a particular reason we should check for _BYTE_ORDER
rather than __BYTE_ORDER
to be define?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because on some systems migth be no __BYTE_ORDER
and only _BYTE_ORDER
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's probably not important, but what I meant is: wouldn't we achieve the same with
# ifdef __BYTE_ORDER
# define VBYTE_ORDER __BYTE_ORDER
# else
# define VBYTE_ORDER _BYTE_ORDER
# endif
I am asking because we preferred __BYTE_ORDER
before, so if you suggest to prefer _BYTE_ORDER
now, I wanted to know if you had a particular reason?
I do not understand why the build uses the wrong byte order rather than failing at compile time because of undefined symbols? |
@nigoroll this isn't When I run grep against
I can't find So, on OpenBSD the condition
holds on
As result it computes SHA with assumption that
Before I figured it out I've spent a few hours in attempt to understand why it producing wrong result. |
OK, so this went unnoticed because we even accept Had we used
we would have hit the undefined macro (thank you, not symbol). |
are you sure?
|
See:
|
I need to have another look on a new day, something is confusing me. |
to avoid errors and confusion as documented in varnishcache#4226
Sorry for my confusion and see #4229 for an additional change which, hopefully, should avoid this in the future. |
Since 5a60b36 varnish drop support of sys/endian.h and they had a bit different API one or two leading
_
.Some system may have symlink from endian.h to sys/endian.h, for example OpenBSD. On such system build fails due to wrong SHA256 hash.