diff mbox

[4/6] xen/build: Use the system limits.h header

Message ID 1466594653-28241-5-git-send-email-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Cooper June 22, 2016, 11:24 a.m. UTC
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(-)
diff mbox

Patch

diff --git a/xen/common/lib.c b/xen/common/lib.c
index ae0bbb3..b7df417 100644
--- a/xen/common/lib.c
+++ b/xen/common/lib.c
@@ -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)
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index 1ff534d..a222c6e 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -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;