]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
macro: Move definition of dummy_t to macro-fundamental.h
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 12 Apr 2025 12:04:19 +0000 (14:04 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 18 Apr 2025 11:59:06 +0000 (13:59 +0200)
There is code in macro-fundamental.h that makes use of dummy_t so
let's make sure to declare dummy_t in macro-fundamental.h as well.

src/basic/macro.h
src/fundamental/macro-fundamental.h

index 35b43f4a1b02e07f65cb5b1423f7ae4600f4553e..2b3c02c32425272ced2d4db413eb81885df10466 100644 (file)
@@ -275,12 +275,6 @@ static inline size_t size_add(size_t x, size_t y) {
         return saturate_add(x, y, SIZE_MAX);
 }
 
-typedef struct {
-        int _empty[0];
-} dummy_t;
-
-assert_cc(sizeof(dummy_t) == 0);
-
 /* A little helper for subtracting 1 off a pointer in a safe UB-free way. This is intended to be used for
  * loops that count down from a high pointer until some base. A naive loop would implement this like this:
  *
index 6c6e02b6bc866d45c5ff53944a8ea6441459b9e0..06fca4a8e50e6f5cffcad87c2a9fec6e6837a128 100644 (file)
@@ -521,6 +521,12 @@ static inline uint64_t ALIGN_OFFSET_U64(uint64_t l, uint64_t ali) {
 #define FLAGS_SET(v, flags) \
         ((~(v) & (flags)) == 0)
 
+typedef struct {
+        int _empty[0];
+} dummy_t;
+
+assert_cc(sizeof(dummy_t) == 0);
+
 /* Restriction/bug (see below) was fixed in GCC 15 and clang 19. */
 #if __GNUC__ >= 15 || (defined(__clang__) && __clang_major__ >= 19)
 #define DECLARE_FLEX_ARRAY(type, name) type name[]