Skip to content

Commit 5b8018d

Browse files
authored
Define __LONG_MAX in alltypes.h (#20930)
This is followup to #20752 which was supposed to define __LONG_MAX rather than LONG_MAX. You can see the effect of this change on some struct layouts in musl that contain checks like `#if __LONG_MAX > 0x7fffffff`. Since `__LONG_MAX` (and internal-only macro) is now correctly defined we get some slightly different values/layouts in libc.
1 parent ff0b766 commit 5b8018d

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

src/generated_struct_info32.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@
293293
"F_DUPFD": 0,
294294
"F_GETFD": 1,
295295
"F_GETFL": 3,
296-
"F_GETLK": 5,
296+
"F_GETLK": 12,
297297
"F_GETOWN": 9,
298298
"F_GETOWN_EX": 16,
299299
"F_SETFD": 2,
300300
"F_SETFL": 4,
301-
"F_SETLK": 6,
302-
"F_SETLKW": 7,
301+
"F_SETLK": 13,
302+
"F_SETLKW": 14,
303303
"F_SETOWN": 8,
304304
"F_UNLCK": 2,
305305
"File::DataFileKind": 1,

src/generated_struct_info64.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@
14211421
"iov_len": 8
14221422
},
14231423
"msghdr": {
1424-
"__size__": 48,
1424+
"__size__": 56,
14251425
"msg_iov": 16,
14261426
"msg_iovlen": 24,
14271427
"msg_name": 0,

system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,7 @@ struct __sanitizer_file_handle {
445445
};
446446
#endif
447447

448-
// These fields are not actually pointers, and so wasm64 must use unsigned and not uptr for them
449-
#if SANITIZER_APPLE || SANITIZER_EMSCRIPTEN
448+
#if SANITIZER_APPLE
450449
struct __sanitizer_msghdr {
451450
void *msg_name;
452451
unsigned msg_namelen;

system/lib/libc/musl/arch/emscripten/bits/alltypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#define __BYTE_ORDER __LITTLE_ENDIAN
66

7-
#define LONG_MAX __LONG_MAX__
7+
#define __LONG_MAX __LONG_MAX__
88

99
#define _Addr __PTRDIFF_TYPE__
1010
#define _Int64 __INT64_TYPE__

0 commit comments

Comments
 (0)