Skip to content

Commit f0098ed

Browse files
committed
options/internal: remove __GNUC__ requirement for __MLIBC_FIELD_PADDED
1 parent 6774dcf commit f0098ed

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

options/ansi/include/bits/ansi/timespec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct timespec {
1212
time_t tv_sec;
1313
// tv_nspec is required to be long by the C standard.
1414
// However linux kernel expects long long. So we add padding.
15-
__MLIBC_FIELD_PADDED(long, tv_nsec, long long);
15+
__MLIBC_FIELD_PADDED(long, long long, tv_nsec);
1616
};
1717

1818
#endif // MLIBC_TIMESPEC_H
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
#ifndef MLIBC_FIELD_PADDING_H
22
#define MLIBC_FIELD_PADDING_H
33

4-
#ifdef __GNUC__
5-
6-
#define __MLIBC_FIELD_PADDED(T, F, PT) \
7-
PT : (sizeof(PT)-sizeof(T))*8*(BYTE_ORDER == BIG_ENDIAN); \
4+
#define __MLIBC_FIELD_PADDED(T, AT, F) \
5+
AT : (sizeof(AT)-sizeof(T))*8*(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__); \
86
T F; \
9-
PT : (sizeof(PT)-sizeof(T))*8*(BYTE_ORDER == LITTLE_ENDIAN)
10-
11-
#else
12-
#error "Unsupported compiler"
13-
#endif
7+
AT : (sizeof(AT)-sizeof(T))*8*(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
148

159
#endif

0 commit comments

Comments
 (0)