From f0b603913edbf7489ba4e77fbd4f2865ae227b00 Mon Sep 17 00:00:00 2001 From: Fedor Lapshin Date: Mon, 4 Mar 2024 23:57:40 +0300 Subject: [PATCH] options/internal: reorder and rename params of __MLIBC_FIELD_PADDED --- options/ansi/include/bits/ansi/timespec.h | 2 +- options/internal/include/bits/field-padding.h | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/options/ansi/include/bits/ansi/timespec.h b/options/ansi/include/bits/ansi/timespec.h index 926d8e7f3c..13a6e546e6 100644 --- a/options/ansi/include/bits/ansi/timespec.h +++ b/options/ansi/include/bits/ansi/timespec.h @@ -12,7 +12,7 @@ struct timespec { time_t tv_sec; // tv_nspec is required to be long by the C standard. // However linux kernel expects long long. So we add padding. - __MLIBC_FIELD_PADDED(long, tv_nsec, long long); + __MLIBC_FIELD_PADDED(long, long long, tv_nsec); }; #endif // MLIBC_TIMESPEC_H diff --git a/options/internal/include/bits/field-padding.h b/options/internal/include/bits/field-padding.h index afc52bc2bf..edab7ad88e 100644 --- a/options/internal/include/bits/field-padding.h +++ b/options/internal/include/bits/field-padding.h @@ -1,10 +1,9 @@ #ifndef MLIBC_FIELD_PADDING_H #define MLIBC_FIELD_PADDING_H - -#define __MLIBC_FIELD_PADDED(T, F, PT) \ - PT : (sizeof(PT)-sizeof(T))*8*(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__); \ +#define __MLIBC_FIELD_PADDED(T, AT, F) \ + AT : (sizeof(AT)-sizeof(T))*8*(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__); \ T F; \ - PT : (sizeof(PT)-sizeof(T))*8*(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + AT : (sizeof(AT)-sizeof(T))*8*(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) #endif