@@ -102,7 +102,6 @@ union uu {
* These are used for shifting, and also below for halfword extraction
* and assembly.
*/
-#define CHAR_BIT 8 /* number of bits in a char */
#define QUAD_BITS (sizeof(s64) * CHAR_BIT)
#define LONG_BITS (sizeof(long) * CHAR_BIT)
#define HALF_BITS (sizeof(long) * CHAR_BIT / 2)
@@ -2,6 +2,7 @@
#define __TYPES_H__
/* Use the C freestanding headers. */
+#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
@@ -16,13 +17,6 @@
#define NULL ((void*)0)
#endif
-#define INT_MAX ((int)(~0U>>1))
-#define INT_MIN (-INT_MAX - 1)
-#define UINT_MAX (~0U)
-#define LONG_MAX ((long)(~0UL>>1))
-#define LONG_MIN (-LONG_MAX - 1)
-#define ULONG_MAX (~0UL)
-
/* bsd */
typedef unsigned char u_char;
typedef unsigned short u_short;
The C spec identifies limits.h as freestanding, and available for use in non-hosted environments, such as Xen. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- CC: George Dunlap <George.Dunlap@eu.citrix.com> CC: Ian Jackson <ian.jackson@eu.citrix.com> CC: Jan Beulich <JBeulich@suse.com> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> CC: Stefano Stabellini <sstabellini@kernel.org> CC: Tim Deegan <tim@xen.org> CC: Wei Liu <wei.liu2@citrix.com> --- xen/common/lib.c | 1 - xen/include/xen/types.h | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-)