[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] include/types: move stdlib.h-kind types to common header
size_t, ssize_t, and ptrdiff_t are all expected to be uniformly defined on any ports Xen might gain. In particular I hope new ports can rely on __SIZE_TYPE__ and __PTRDIFF_TYPE__ being made available by the compiler. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- This is just to start with some hopefully uncontroversial low hanging fruit. --- a/xen/arch/arm/include/asm/types.h +++ b/xen/arch/arm/include/asm/types.h @@ -54,19 +54,6 @@ typedef u64 register_t; #define PRIregister "016lx" #endif -#if defined(__SIZE_TYPE__) -typedef __SIZE_TYPE__ size_t; -#else -typedef unsigned long size_t; -#endif -typedef signed long ssize_t; - -#if defined(__PTRDIFF_TYPE__) -typedef __PTRDIFF_TYPE__ ptrdiff_t; -#else -typedef signed long ptrdiff_t; -#endif - #endif /* __ASSEMBLY__ */ #endif /* __ARM_TYPES_H__ */ --- a/xen/arch/x86/include/asm/types.h +++ b/xen/arch/x86/include/asm/types.h @@ -32,19 +32,6 @@ typedef unsigned long paddr_t; #define INVALID_PADDR (~0UL) #define PRIpaddr "016lx" -#if defined(__SIZE_TYPE__) -typedef __SIZE_TYPE__ size_t; -#else -typedef unsigned long size_t; -#endif -typedef signed long ssize_t; - -#if defined(__PTRDIFF_TYPE__) -typedef __PTRDIFF_TYPE__ ptrdiff_t; -#else -typedef signed long ptrdiff_t; -#endif - #endif /* __ASSEMBLY__ */ #endif /* __X86_TYPES_H__ */ --- a/xen/include/xen/types.h +++ b/xen/include/xen/types.h @@ -5,6 +5,19 @@ #include <asm/types.h> +#if defined(__SIZE_TYPE__) +typedef __SIZE_TYPE__ size_t; +#else +typedef unsigned long size_t; +#endif +typedef signed long ssize_t; + +#if defined(__PTRDIFF_TYPE__) +typedef __PTRDIFF_TYPE__ ptrdiff_t; +#else +typedef signed long ptrdiff_t; +#endif + #define BITS_TO_LONGS(bits) \ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) #define DECLARE_BITMAP(name,bits) \
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |