mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-01-24 01:00:18 +01:00
Check for different endian.h includes and variants of le32toh.
This commit is contained in:
parent
fae0f0d493
commit
2736118f82
5
lrzip.c
5
lrzip.c
|
|
@ -37,6 +37,11 @@
|
|||
#include <sys/mman.h>
|
||||
#include <sys/time.h>
|
||||
#include <termios.h>
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# include <endian.h>
|
||||
#elif HAVE_SYS_ENDIAN_H
|
||||
# include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
#include "rzip.h"
|
||||
|
|
|
|||
|
|
@ -113,21 +113,26 @@ typedef struct md5_ctx md5_ctx;
|
|||
| (((x) & 0x000000000000ff00ull) << 40) \
|
||||
| (((x) & 0x00000000000000ffull) << 56))
|
||||
|
||||
#ifdef leto32h
|
||||
# define le32toh(x) leto32h(x)
|
||||
# define le64toh(x) leto64h(x)
|
||||
#endif
|
||||
|
||||
#ifndef le32toh
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
# define htole32(x) (x)
|
||||
# define le32toh(x) (x)
|
||||
|
||||
# define htole64(x) (x)
|
||||
# define le64toh(x) (x)
|
||||
# elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define htole32(x) bswap_32 (x)
|
||||
# define le32toh(x) bswap_32 (x)
|
||||
|
||||
# define htole64(x) bswap_64 (x)
|
||||
# define le64toh(x) bswap_64 (x)
|
||||
#else
|
||||
#error UNKNOWN BYTE ORDER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define FLAG_SHOW_PROGRESS (1 << 0)
|
||||
#define FLAG_KEEP_FILES (1 << 1)
|
||||
|
|
|
|||
5
main.c
5
main.c
|
|
@ -37,6 +37,11 @@
|
|||
#endif
|
||||
#include <math.h>
|
||||
#include <termios.h>
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# include <endian.h>
|
||||
#elif HAVE_SYS_ENDIAN_H
|
||||
# include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
#include "rzip.h"
|
||||
#include "lrzip.h"
|
||||
|
|
|
|||
6
runzip.c
6
runzip.c
|
|
@ -31,6 +31,11 @@
|
|||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# include <endian.h>
|
||||
#elif HAVE_SYS_ENDIAN_H
|
||||
# include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
#include "runzip.h"
|
||||
|
|
@ -40,6 +45,7 @@
|
|||
#include "liblrzip.h"
|
||||
/* needed for CRC routines */
|
||||
#include "lzma/C/7zCrc.h"
|
||||
|
||||
static inline uchar read_u8(rzip_control *control, void *ss, int stream)
|
||||
{
|
||||
uchar b;
|
||||
|
|
|
|||
5
rzip.c
5
rzip.c
|
|
@ -42,6 +42,11 @@
|
|||
#ifdef HAVE_ERRNO_H
|
||||
# include <errno.h>
|
||||
#endif
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# include <endian.h>
|
||||
#elif HAVE_SYS_ENDIAN_H
|
||||
# include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
#include "stream.h"
|
||||
|
|
|
|||
Loading…
Reference in a new issue