diff --git a/criu/arch/aarch64/include/asm/types.h b/criu/arch/aarch64/include/asm/types.h index 970fde741..91e65116c 100644 --- a/criu/arch/aarch64/include/asm/types.h +++ b/criu/arch/aarch64/include/asm/types.h @@ -54,9 +54,6 @@ typedef struct { typedef struct user_pt_regs user_regs_struct_t; -#define ASSIGN_TYPED(a, b) do { a = (typeof(a))b; } while (0) -#define ASSIGN_MEMBER(a,b,m) do { ASSIGN_TYPED((a)->m, (b)->m); } while (0) - #define REG_RES(regs) ((u64)(regs).regs[0]) #define REG_IP(regs) ((u64)(regs).pc) #define REG_SYSCALL_NR(regs) ((u64)(regs).regs[8]) diff --git a/criu/arch/arm/include/asm/types.h b/criu/arch/arm/include/asm/types.h index b186aafde..abec584c4 100644 --- a/criu/arch/arm/include/asm/types.h +++ b/criu/arch/arm/include/asm/types.h @@ -89,9 +89,6 @@ struct user_vfp_exc { unsigned long fpinst2; }; -#define ASSIGN_TYPED(a, b) do { a = (typeof(a))b; } while (0) -#define ASSIGN_MEMBER(a,b,m) do { ASSIGN_TYPED((a)->m, (b)->m); } while (0) - #define REG_RES(regs) ((regs).ARM_r0) #define REG_IP(regs) ((regs).ARM_pc) #define REG_SYSCALL_NR(regs) ((regs).ARM_r7) diff --git a/criu/arch/ppc64/include/asm/types.h b/criu/arch/ppc64/include/asm/types.h index be29dbb37..913bd53d3 100644 --- a/criu/arch/ppc64/include/asm/types.h +++ b/criu/arch/ppc64/include/asm/types.h @@ -72,9 +72,6 @@ typedef UserPpc64RegsEntry UserRegsEntry; #define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__PPC64 -#define ASSIGN_TYPED(a, b) do { a = (typeof(a))b; } while (0) -#define ASSIGN_MEMBER(a,b,m) do { ASSIGN_TYPED((a)->m, (b)->m); } while (0) - #define REG_RES(regs) ((u64)(regs).gpr[3]) #define REG_IP(regs) ((u64)(regs).nip) #define REG_SYSCALL_NR(regs) ((u64)(regs).gpr[0]) diff --git a/criu/arch/x86/include/asm/types.h b/criu/arch/x86/include/asm/types.h index c8e76964e..a72f2916d 100644 --- a/criu/arch/x86/include/asm/types.h +++ b/criu/arch/x86/include/asm/types.h @@ -105,9 +105,6 @@ typedef struct { u32 padding[24]; } user_fpregs_struct_t; -#define ASSIGN_TYPED(a, b) do { a = (typeof(a))b; } while (0) -#define ASSIGN_MEMBER(a,b,m) do { ASSIGN_TYPED((a)->m, (b)->m); } while (0) - #ifdef CONFIG_X86_64 # define TASK_SIZE ((1UL << 47) - PAGE_SIZE) #else diff --git a/criu/include/compiler.h b/criu/include/compiler.h index 6bce93562..235413070 100644 --- a/criu/include/compiler.h +++ b/criu/include/compiler.h @@ -10,6 +10,9 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) +#define ASSIGN_TYPED(a, b) do { (a) = (typeof(a))(b); } while (0) +#define ASSIGN_MEMBER(a, b, m) do { ASSIGN_TYPED((a)->m, (b)->m); } while (0) + #define __stringify_1(x...) #x #define __stringify(x...) __stringify_1(x)