summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/macro.h1
-rw-r--r--src/shared/util.h7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h
index e2c519cf89..41fe61fb68 100644
--- a/src/shared/macro.h
+++ b/src/shared/macro.h
@@ -35,6 +35,7 @@
#define _likely_(x) (__builtin_expect(!!(x),1))
#define _unlikely_(x) (__builtin_expect(!!(x),0))
#define _public_ __attribute__ ((visibility("default")))
+#define _alignas_(x) __attribute__((aligned(__alignof(x))))
#define _cleanup_(x) __attribute__((cleanup(x)))
/* Temporarily disable some warnings */
diff --git a/src/shared/util.h b/src/shared/util.h
index cbfe787be2..21e977dc51 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -458,3 +458,10 @@ char *tempfn_xxxxxx(const char *p);
int is_dir(const char *path, bool follow);
int execute_command(const char *command, char *const argv[]);
+
+#define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
+
+#define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
+ for ((e) = (struct inotify_event*) (buffer); \
+ (uint8_t*) (e) < (uint8_t*) (buffer) + (sz); \
+ (e) = (struct inotify_event*) ((uint8_t*) (e) + sizeof(struct inotify_event) + (e)->len))