type safety for bool shared
Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I4883eab734f47522fec718f0709475f7e6dd0a53
This commit is contained in:
@@ -213,7 +213,7 @@ static void (*bpf_ringbuf_submit_unsafe)(const void* data, __u64 flags) = (void*
|
|||||||
.max_kver = (maxkver), \
|
.max_kver = (maxkver), \
|
||||||
.selinux_context = (selinux), \
|
.selinux_context = (selinux), \
|
||||||
.pin_subdir = (pindir), \
|
.pin_subdir = (pindir), \
|
||||||
.shared = (share), \
|
.shared = (share).shared, \
|
||||||
.ignore_on_eng = (ignore_eng), \
|
.ignore_on_eng = (ignore_eng), \
|
||||||
.ignore_on_user = (ignore_user), \
|
.ignore_on_user = (ignore_user), \
|
||||||
.ignore_on_userdebug = (ignore_userdebug), \
|
.ignore_on_userdebug = (ignore_userdebug), \
|
||||||
|
|||||||
@@ -115,9 +115,10 @@ _Static_assert(__alignof__(unsigned long long) == 8, "__alignof__ unsigned long
|
|||||||
//_Static_assert(_Alignof(unsigned long long) == 8, "_Alignof unsigned long long != 8");
|
//_Static_assert(_Alignof(unsigned long long) == 8, "_Alignof unsigned long long != 8");
|
||||||
|
|
||||||
|
|
||||||
// constants for passing in to 'bool shared' (for maps)
|
// for maps:
|
||||||
static const bool PRIVATE = false;
|
struct shared_bool { bool shared; };
|
||||||
static const bool SHARED = true;
|
#define PRIVATE ((struct shared_bool){ .shared = false })
|
||||||
|
#define SHARED ((struct shared_bool){ .shared = true })
|
||||||
|
|
||||||
// constants for passing in to 'bool optional' (for programs)
|
// constants for passing in to 'bool optional' (for programs)
|
||||||
static const bool MANDATORY = false;
|
static const bool MANDATORY = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user