File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ struct timespec {
12
12
time_t tv_sec ;
13
13
// tv_nspec is required to be long by the C standard.
14
14
// 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 );
16
16
};
17
17
18
18
#endif // MLIBC_TIMESPEC_H
Original file line number Diff line number Diff line change 1
1
#ifndef MLIBC_FIELD_PADDING_H
2
2
#define MLIBC_FIELD_PADDING_H
3
3
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__); \
8
6
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__)
14
8
15
9
#endif
You can’t perform that action at this time.
0 commit comments