From c25bd29805f4d854c3a0b4176813f3c1bff569d3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 24 Apr 2008 13:37:33 -0700 Subject: types: add C99-style constructors to Add C99-style constructor macros for fixed types to . Since Linux uses names like "u64" instead of "uint64_t", the constructor macros are called U64_C() instead of UINT64_C() and so forth. These macros allow specific sizes to be specified as U64_C(0x123456789abcdef), without gcc issuing warnings as it will if one writes (u64)0x123456789abcdef. When used from assembly, these macros pass their argument unchanged. Signed-off-by: H. Peter Anvin --- include/asm-generic/int-ll64.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/asm-generic/int-ll64.h') diff --git a/include/asm-generic/int-ll64.h b/include/asm-generic/int-ll64.h index 1e5ffec0575..260948905e4 100644 --- a/include/asm-generic/int-ll64.h +++ b/include/asm-generic/int-ll64.h @@ -49,6 +49,26 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; +#define S8_C(x) x +#define U8_C(x) x ## U +#define S16_C(x) x +#define U16_C(x) x ## U +#define S32_C(x) x +#define U32_C(x) x ## U +#define S64_C(x) x ## LL +#define U64_C(x) x ## ULL + +#else /* __ASSEMBLY__ */ + +#define S8_C(x) x +#define U8_C(x) x +#define S16_C(x) x +#define U16_C(x) x +#define S32_C(x) x +#define U32_C(x) x +#define S64_C(x) x +#define U64_C(x) x + #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ -- cgit v1.2.3