29 #define relptr(type) union { type *relptr_type; Size relptr_off; }
38 #define relptr_declare(type, relptrtype) \
39 typedef relptr(type) relptrtype
41 #ifdef HAVE__BUILTIN_TYPES_COMPATIBLE_P
42 #define relptr_access(base, rp) \
43 (AssertVariableIsOfTypeMacro(base, char *), \
44 (__typeof__((rp).relptr_type)) ((rp).relptr_off == 0 ? NULL : \
45 (base + (rp).relptr_off)))
51 #define relptr_access(base, rp) \
52 (AssertVariableIsOfTypeMacro(base, char *), \
53 (void *) ((rp).relptr_off == 0 ? NULL : (base + (rp).relptr_off)))
56 #define relptr_is_null(rp) \
57 ((rp).relptr_off == 0)
72 #ifdef HAVE__BUILTIN_TYPES_COMPATIBLE_P
73 #define relptr_store(base, rp, val) \
74 (AssertVariableIsOfTypeMacro(base, char *), \
75 AssertVariableIsOfTypeMacro(val, __typeof__((rp).relptr_type)), \
76 (rp).relptr_off = relptr_store_eval(base, (char *) (val)))
82 #define relptr_store(base, rp, val) \
83 (AssertVariableIsOfTypeMacro(base, char *), \
84 (rp).relptr_off = relptr_store_eval(base, (char *) (val)))
87 #define relptr_copy(rp1, rp2) \
88 ((rp1).relptr_off = (rp2).relptr_off)
Assert(fmt[strlen(fmt) - 1] !='\n')
static Size relptr_store_eval(char *base, char *val)