[libfko] handle endian detection on PPC (and other) systems
Blair Zajac contributed a patch to handle endian detection on PPC systems and issue a compile time error if it cannot be determined. This commit affects the BYTEORDER macro.
This commit is contained in:
parent
5c7f5f1b0b
commit
ffeb285f7b
6
CREDITS
6
CREDITS
@ -140,3 +140,9 @@ hlein
|
|||||||
- Suggested the ability to read a passphrase from STDIN and via a new --fd
|
- Suggested the ability to read a passphrase from STDIN and via a new --fd
|
||||||
command line argument (github #74) to allow things like:
|
command line argument (github #74) to allow things like:
|
||||||
$ gpg -d passphrasefile.pgp | fwknop -R -n myserver
|
$ gpg -d passphrasefile.pgp | fwknop -R -n myserver
|
||||||
|
|
||||||
|
Blair Zajac
|
||||||
|
- Contributed patches to handle endian issues on PPC systems.
|
||||||
|
- Reported an issue where strndup() is not available on some PPC systems
|
||||||
|
and the fix is to use the local lib/fko_util.c implementation similarly
|
||||||
|
to Windows builds.
|
||||||
|
|||||||
@ -100,9 +100,23 @@
|
|||||||
#define BYTEORDER 4321
|
#define BYTEORDER 4321
|
||||||
#elif defined(_LITTLE_ENDIAN)
|
#elif defined(_LITTLE_ENDIAN)
|
||||||
#define BYTEORDER 1234
|
#define BYTEORDER 1234
|
||||||
#else
|
|
||||||
#error unable to determine BYTEORDER
|
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__)
|
||||||
|
#if defined(__i386__) || defined(__ppc__)
|
||||||
|
#define BYTEORDER 4321
|
||||||
|
#elif defined(__x86_64__) || defined(__ppc64)
|
||||||
|
#define BYTEORDER 87654321
|
||||||
|
#endif
|
||||||
|
#elif defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
|
||||||
|
#if defined(__i386__) || defined(__ppc__)
|
||||||
|
#define BYTEORDER 1234
|
||||||
|
#elif defined(__x86_64__) || defined(__ppc64)
|
||||||
|
#define BYTEORDER 12345678
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef BYTEORDER
|
||||||
|
#error unable to determine BYTEORDER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user