Skip to content

Commit 5a124e8

Browse files
committed
macro: Move definition of dummy_t to macro-fundamental.h
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.
1 parent 69ebfef commit 5a124e8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/basic/macro.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,6 @@ static inline size_t size_add(size_t x, size_t y) {
275275
return saturate_add(x, y, SIZE_MAX);
276276
}
277277

278-
typedef struct {
279-
int _empty[0];
280-
} dummy_t;
281-
282-
assert_cc(sizeof(dummy_t) == 0);
283-
284278
/* A little helper for subtracting 1 off a pointer in a safe UB-free way. This is intended to be used for
285279
* loops that count down from a high pointer until some base. A naive loop would implement this like this:
286280
*

src/fundamental/macro-fundamental.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,12 @@ static inline uint64_t ALIGN_OFFSET_U64(uint64_t l, uint64_t ali) {
521521
#define FLAGS_SET(v, flags) \
522522
((~(v) & (flags)) == 0)
523523

524+
typedef struct {
525+
int _empty[0];
526+
} dummy_t;
527+
528+
assert_cc(sizeof(dummy_t) == 0);
529+
524530
/* Restriction/bug (see below) was fixed in GCC 15 and clang 19. */
525531
#if __GNUC__ >= 15 || (defined(__clang__) && __clang_major__ >= 19)
526532
#define DECLARE_FLEX_ARRAY(type, name) type name[]

0 commit comments

Comments
 (0)