-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Modify __int64 definition in PAL to match the OS definition #77056
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
b823cfd
92d2787
4bada87
ddafbc2
6d13629
cc99180
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 |
|---|---|---|
|
|
@@ -195,12 +195,7 @@ extern "C" { | |
| // they must be either signed or unsigned) and we want to be able to use | ||
| // __int64 as though it were intrinsic | ||
|
|
||
| #ifdef HOST_64BIT | ||
|
Contributor
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. There is an error after deleting this on LoongArch64.
Contributor
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. @jkotas
Contributor
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.
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. this has been special cased to MacOS only in this PR: #77268, so guessing that should solve your issue?
Contributor
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.
Yes, it's ok for LA64 now. |
||
| #define __int64 long | ||
| #else // HOST_64BIT | ||
| #define __int64 long long | ||
| #endif // HOST_64BIT | ||
|
|
||
| #define __int32 int | ||
| #define __int16 short int | ||
| #define __int8 char // assumes char is signed | ||
|
|
@@ -543,8 +538,16 @@ typedef _W64 unsigned __int32 DWORD_PTR, *PDWORD_PTR; | |
| #define UlongToPtr(ul) ULongToPtr(ul) | ||
| #define UintToPtr(ui) UIntToPtr(ui) | ||
|
|
||
| typedef ULONG_PTR SIZE_T, *PSIZE_T; | ||
| typedef LONG_PTR SSIZE_T, *PSSIZE_T; | ||
| #ifdef HOST_64BIT | ||
| typedef unsigned long SIZE_T; | ||
| typedef long SSIZE_T; | ||
| #else | ||
| typedef unsigned int SIZE_T; | ||
| typedef int SSIZE_T; | ||
| #endif | ||
AaronRobinsonMSFT marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| static_assert(sizeof(SIZE_T) == sizeof(void*), "SIZE_T should be pointer sized"); | ||
| static_assert(sizeof(SSIZE_T) == sizeof(void*), "SSIZE_T should be pointer sized"); | ||
|
|
||
| #ifndef SIZE_T_MAX | ||
| #define SIZE_T_MAX ULONG_PTR_MAX | ||
|
|
@@ -559,18 +562,14 @@ typedef LONG_PTR SSIZE_T, *PSSIZE_T; | |
| #endif | ||
|
|
||
| #ifndef PAL_STDCPP_COMPAT | ||
| #if defined(__APPLE_CC__) || defined(__linux__) | ||
| #ifdef HOST_64BIT | ||
| typedef unsigned long size_t; | ||
| typedef long ssize_t; | ||
| typedef long ptrdiff_t; | ||
| #else // !HOST_64BIT | ||
| typedef unsigned int size_t; | ||
| typedef int ptrdiff_t; | ||
| #endif // !HOST_64BIT | ||
| #else | ||
| typedef ULONG_PTR size_t; | ||
| typedef LONG_PTR ptrdiff_t; | ||
| #endif | ||
| #endif // !PAL_STDCPP_COMPAT | ||
| #define _SIZE_T_DEFINED | ||
|
|
||
|
|
@@ -596,8 +595,8 @@ typedef int intptr_t; | |
| typedef unsigned int uintptr_t; | ||
| #endif // !HOST_64BIT | ||
| #else | ||
| typedef INT_PTR intptr_t; | ||
| typedef UINT_PTR uintptr_t; | ||
| typedef long int intptr_t; | ||
| typedef unsigned long int uintptr_t; | ||
| #endif | ||
|
|
||
| #endif // PAL_STDCPP_COMPAT | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.