X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Furcu%2Fuatomic%2Fs390.h;h=42f23e757807453586831af7e8210c04e1453d44;hb=f41d90ce6741adbb1cf8bd650106d27e5e3935b3;hp=d7d545ad8f869ede493edef727233d7e9edc42ad;hpb=dcae1b08904b12f5f91000fdba25e1aa9f3d2636;p=urcu.git diff --git a/include/urcu/uatomic/s390.h b/include/urcu/uatomic/s390.h index d7d545a..42f23e7 100644 --- a/include/urcu/uatomic/s390.h +++ b/include/urcu/uatomic/s390.h @@ -66,10 +66,14 @@ extern "C" { * containing an array of char of the specified size. This allows passing the * @addr arguments of the following inline functions as "m" and "+m" operands * to the assembly. The @size parameter should be a constant to support - * compilers such as clang which do not support VLA. + * compilers such as clang which do not support VLA. Create typedefs because + * C++ does not allow types be defined in casts. */ -#define __hp(size, x) ((struct { char v[size]; } *)(x)) +typedef struct { char v[4]; } __hp_4; +typedef struct { char v[8]; } __hp_8; + +#define __hp(size, x) ((__hp_##size *)(x)) /* xchg */