Skip to content

Commit afa00ec

Browse files
committed
configure.ac: drop custom big-endian macros, rely on <endian.h>
1 parent 913a4d0 commit afa00ec

File tree

6 files changed

+8
-42
lines changed

6 files changed

+8
-42
lines changed

configure.ac

-20
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,7 @@ AC_DEFINE_UNQUOTED([PAGER], ["$PAGER"], [Define to the pager program.])
6666
dnl Initialize maintainer mode
6767
AM_MAINTAINER_MODE
6868

69-
dnl Check for host endianness
70-
AC_CACHE_CHECK([whether host byte ordering is defined in sys/param.h],
71-
ski_cv_c_bigendian_compile,
72-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
73-
#include <sys/types.h>
74-
#include <sys/param.h>
75-
]],[[
76-
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
77-
#error bogus endian macros
78-
#endif
79-
]])],
80-
[ski_cv_c_bigendian_compile=yes], [ski_cv_c_bigendian_compile=no])])
81-
82-
AS_IF([test "x$ski_cv_c_bigendian_compile" = xyes], [
83-
AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1,
84-
[define if sys/param.h defines the endiness])
85-
])
86-
AC_C_BIGENDIAN
87-
8869
dnl Check for variables & functions
89-
9070
AC_FUNC_ALLOCA
9171

9272
dnl Find libelf.h

src/bits.h

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#ifndef _SKI_BITS_H
2323
#define _SKI_BITS_H
2424

25+
#include <endian.h>
26+
2527
#include "std.h"
2628

2729
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN

src/decoder/_decoder.h

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ extern TemplateInfo templates[NUM_TEMPL_SBS];
9797
#include <machine/inline.h>
9898
#endif /* INLINE */
9999

100+
# include <endian.h>
100101
# include "std.h"
101102

102103
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN

src/simmem.h

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#ifndef _SKI_MEMORY_H_
2323
#define _SKI_MEMORY_H_
2424

25+
#include <endian.h>
26+
#include <stddef.h>
27+
2528
#include "types.h"
2629
#include "sim.h"
2730

src/std.h

-22
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,4 @@
3030

3131
typedef enum {NO, YES} BOOL;
3232

33-
/* What is the host endiannes? */
34-
#if defined ENDIANESS_IN_SYS_PARAM_H
35-
# include <sys/types.h>
36-
# include <sys/param.h>
37-
#else /* !defined ENDIANESS_IN_SYS_PARAM_H */
38-
# if !defined HAVE_CONFIG_H
39-
# warning "Assuming BIG_ENDIAN"
40-
/* In case we do not have config.h assume BIG_ENDIAN */
41-
# define BIG_ENDIAN 4321
42-
# define LITTLE_ENDIAN 1234
43-
# define BYTE_ORDER BIG_ENDIAN
44-
# else
45-
# define BIG_ENDIAN 4321
46-
# define LITTLE_ENDIAN 1234
47-
# ifdef WORDS_BIGENDIAN
48-
# define BYTE_ORDER BIG_ENDIAN
49-
# else
50-
# define BYTE_ORDER LITTLE_ENDIAN
51-
# endif
52-
# endif /* !defined HAVE_CONFIG_H */
53-
#endif /* !defined ENDIANESS_IN_SYS_PARAM_H */
54-
5533
#endif /* _SKI_STD_H */

src/tlb.h

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#ifndef _SKI_TLB_H_
2323
#define _SKI_TLB_H_
2424

25+
#include <stddef.h>
26+
2527
#include "simmem.h"
2628

2729
#define NDTRS 16

0 commit comments

Comments
 (0)