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

Tolerate when endian.h is symlink to sys/endian.h #4226

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/libvarnish/vsha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@

#ifndef __DARWIN_BYTE_ORDER
# include <endian.h>
# define VBYTE_ORDER __BYTE_ORDER
# define VBIG_ENDIAN __BIG_ENDIAN
# ifdef _BYTE_ORDER
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

# define VBYTE_ORDER _BYTE_ORDER
# else
# define VBYTE_ORDER __BYTE_ORDER
# endif
# ifdef _BIG_ENDIAN
# define VBIG_ENDIAN _BIG_ENDIAN
# else
# define VBIG_ENDIAN __BIG_ENDIAN
# endif
#else
# define VBYTE_ORDER __DARWIN_BYTE_ORDER
# define VBIG_ENDIAN __DARWIN_BIG_ENDIAN
Expand Down