lkml.org 
[lkml]   [2023]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 next] compiler.h: Move __is_constexpr() to compiler.h.
Date
It can also be defined more portably as:

#define __is_constexpr(x) \
_Generic(0 ? (void *)((long)(x) * 0) : (int *)0, int *: 1, void *: 0)

Which doesn't rely on 'sizeof (void)' being valid.

But that is for another day.

There is also:
#define is_pointer_type(type) __is_constexpr((type)1)

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2023-10-06 17:52    [W:0.072 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site