summaryrefslogtreecommitdiffstats
path: root/src/basic/missing_timerfd.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-15 15:22:31 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-20 12:26:16 +0100
commit4d6437d33c45c3d31497f2e3bd8d415f775546b8 (patch)
treeec9911eaad2bc35b412df3bd9fc163742f7607b5 /src/basic/missing_timerfd.h
parentbasic/missing_ioprio: include the proper header file (diff)
downloadsystemd-4d6437d33c45c3d31497f2e3bd8d415f775546b8.tar.xz
systemd-4d6437d33c45c3d31497f2e3bd8d415f775546b8.zip
basic/missing_*.h: add asserts that the values are as expected
It's great that we provide fallback values, but if we got one of those wrong, it could be a long time before anyone noticed. So let's add asserts that the our internal defines actually match the official ones, when the latter are available. I did not add '#include "macro.h"' to missing_{audit,capability}, because those are processed by an awk script that would need additional include directories and could be confused by the additional lines. We don't include those headers standalone anyway, so this is not necessary anyway.
Diffstat (limited to 'src/basic/missing_timerfd.h')
-rw-r--r--src/basic/missing_timerfd.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/basic/missing_timerfd.h b/src/basic/missing_timerfd.h
index dba3043d22..a01a4eca3a 100644
--- a/src/basic/missing_timerfd.h
+++ b/src/basic/missing_timerfd.h
@@ -3,6 +3,10 @@
#include <sys/timerfd.h>
+#include "macro.h"
+
#ifndef TFD_TIMER_CANCEL_ON_SET
-#define TFD_TIMER_CANCEL_ON_SET (1 << 1)
+# define TFD_TIMER_CANCEL_ON_SET (1 << 1)
+#else
+assert_cc(TFD_TIMER_CANCEL_ON_SET == (1 << 1));
#endif