-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add missing __LONG_MAX definition in alltypes.h #20752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1 @@ | ||
| #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ | ||
| || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | ||
| #define PAGE_SIZE 65536 | ||
| #define LONG_BIT 32 | ||
| #endif | ||
|
|
||
| #if __LP64__ | ||
| #define LONG_MAX 0x7fffffffffffffffL | ||
| #else | ||
| #define LONG_MAX 0x7fffffffL | ||
| #endif | ||
| #define LLONG_MAX 0x7fffffffffffffffLL | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to define this one in the other header? I tried to find where it was defined elsewhere and saw this: Does that work? It uses
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. otherwise lgtm
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems to work fine yes. At least this is the same as upstream musl.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this is just how the C pre-processor works, macros get a expanded at the point of use:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, really... very interesting. I did not know that about C macros! |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comparing in the pre-processor should work fine even with
#define LONG_MAX __LONG_MAX__? https://godbolt.org/z/zonffPn6oThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, in that case there must be some other reason.. I just assumed that was it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#20756