| 1 |
#ifndef _ZZIP_AUTOCONF_H_ |
| 2 |
#define _ZZIP_AUTOCONF_H_ 1 |
| 3 |
|
| 4 |
/* |
| 5 |
* This file is trying to override configure time checks of zzip with |
| 6 |
* definitions at compile time. This is not used by zzip sources themselves |
| 7 |
* but it may be really helpful with thirdparty software that happens to |
| 8 |
* include zzip headers from a central place but running on a different host. |
| 9 |
*/ |
| 10 |
|
| 11 |
#include "conf.h" /* <zzip/conf.h> : <zzip/_config.h> */ |
| 12 |
|
| 13 |
#if defined HAVE_ENDIAN_H || defined ZZIP_HAVE_ENDIAN_H |
| 14 |
#include <endian.h> /* glibc */ |
| 15 |
#elif defined HAVE_SYS_PARAM_H || defined ZZIP_HAVE_SYS_PARAM_H |
| 16 |
#include <sys/param.h> /* solaris */ |
| 17 |
#endif |
| 18 |
|
| 19 |
#if defined __BYTE_ORDER |
| 20 |
#define ZZIP_BYTE_ORDER __BYTE_ORDER |
| 21 |
#elif defined BYTE_ORDER |
| 22 |
#define ZZIP_BYTE_ORDER BYTE_ORDER |
| 23 |
#elif defined _LITTLE_ENDIAN |
| 24 |
#define ZZIP_BYTE_ORDER 1234 |
| 25 |
#elif defined _BIG_ENDIAN |
| 26 |
#define ZZIP_BYTE_ORDER 4321 |
| 27 |
#elif defined __i386__ |
| 28 |
#define ZZIP_BYTE_ORDER 1234 |
| 29 |
#elif defined WORDS_BIGENDIAN || defined ZZIP_WORDS_BIGENDIAN |
| 30 |
#define ZZIP_BYTE_ORDER 4321 |
| 31 |
#else |
| 32 |
#define ZZIP_BYTE_ORDER 1234 |
| 33 |
#endif |
| 34 |
|
| 35 |
/* override ZZIP_WORDS_BIGENDIAN : macros ZZIP_GET16 / ZZIP_GET32 */ |
| 36 |
#ifdef ZZIP_BYTE_ORDER+0 == 1234 |
| 37 |
#undef ZZIP_WORDS_BIGENDIAN |
| 38 |
#endif |
| 39 |
#ifdef ZZIP_BYTE_ORDER+0 == 4321 |
| 40 |
#ifndef ZZIP_WORDS_BIGENDIAN |
| 41 |
#define ZZIP_WORDS_BIGENDIAN 1 |
| 42 |
#endif |
| 43 |
#endif |
| 44 |
|
| 45 |
#endif |