diff options
author | Aaron Crane <arc@cpan.org> | 2017-10-14 10:07:18 +0200 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2017-10-21 16:53:08 +0100 |
commit | 41f35ffdd92bd0a58eb2563c365bd7654f371778 (patch) | |
tree | 7a607b33aaf0c90820d53fed8ba12a3b583eefa8 /pp_pack.c | |
parent | d1a21e441b960b44c368ad603bfd9208ef8f60fb (diff) | |
download | perl-41f35ffdd92bd0a58eb2563c365bd7654f371778.tar.gz |
pp_pack.c: simplify cpp conditionals
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 22 |
1 files changed, 9 insertions, 13 deletions
@@ -112,21 +112,17 @@ typedef union { /* CROSSCOMPILE and MULTIARCH are going to affect pp_pack() and pp_unpack(). --jhi Feb 1999 */ -#if U16SIZE > SIZE16 || U32SIZE > SIZE32 -# if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678 /* little-endian */ -# define OFF16(p) ((char*)(p)) -# define OFF32(p) ((char*)(p)) -# else -# if BYTEORDER == 0x4321 || BYTEORDER == 0x87654321 /* big-endian */ -# define OFF16(p) ((char*)(p) + (sizeof(U16) - SIZE16)) -# define OFF32(p) ((char*)(p) + (sizeof(U32) - SIZE32)) -# else - ++++ bad cray byte order -# endif -# endif -#else +#if U16SIZE <= SIZE16 && U32SIZE <= SIZE32 # define OFF16(p) ((char *) (p)) # define OFF32(p) ((char *) (p)) +#elif BYTEORDER == 0x1234 || BYTEORDER == 0x12345678 /* little-endian */ +# define OFF16(p) ((char*)(p)) +# define OFF32(p) ((char*)(p)) +#elif BYTEORDER == 0x4321 || BYTEORDER == 0x87654321 /* big-endian */ +# define OFF16(p) ((char*)(p) + (sizeof(U16) - SIZE16)) +# define OFF32(p) ((char*)(p) + (sizeof(U32) - SIZE32)) +#else +# error "bad cray byte order" #endif #define PUSH16(utf8, cur, p, needs_swap) \ |