Skip to content

Commit

Permalink
compiler.h: Remove caa_unqual_scalar_typeof
Browse files Browse the repository at this point in the history
commit dd8987a ("Revert "compiler.h: Introduce caa_unqual_scalar_typeof"")
removed caa_unqual_scalar_typeof because it uses _Generic, which
requires C11, but liburcu supports C99.

caa_unqual_scalar_typeof was re-introduced by commit d185448
("Add CMM memory model"), even though it is unused within liburcu.

Remove it again.

Signed-off-by: Mathieu Desnoyers <[email protected]>
Change-Id: I7713504433d142aee1bb1a39492843cd73b37fc2
  • Loading branch information
compudj committed Jan 9, 2025
1 parent 13bb3d9 commit bfee76a
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions include/urcu/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,32 +151,6 @@
+ __GNUC_PATCHLEVEL__)
#endif

#ifdef __cplusplus
#define caa_unqual_scalar_typeof(x) \
std::remove_cv<std::remove_reference<decltype(x)>::type>::type
#else
#define caa_scalar_type_to_expr(type) \
unsigned type: (unsigned type)0, \
signed type: (signed type)0

/*
* Use C11 _Generic to express unqualified type from expression. This removes
* volatile qualifier from expression type.
*/
#define caa_unqual_scalar_typeof(x) \
__typeof__( \
_Generic((x), \
char: (char)0, \
caa_scalar_type_to_expr(char), \
caa_scalar_type_to_expr(short), \
caa_scalar_type_to_expr(int), \
caa_scalar_type_to_expr(long), \
caa_scalar_type_to_expr(long long), \
default: (x) \
) \
)
#endif

/*
* Allow user to manually define CMM_SANITIZE_THREAD if their toolchain is not
* supported by this check.
Expand Down

0 comments on commit bfee76a

Please sign in to comment.