Skip to content
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

refactor: long types and wchar_t cross-platform compatibility #158

Closed
wants to merge 2 commits into from

Conversation

ijsf
Copy link
Contributor

@ijsf ijsf commented May 27, 2024

Requirement for #156.

This seems to be one of the more invasive changes necessary.

  1. unsigned long, long, uintptr_t and intptr_t do not have sizes that are explicitly defined in the C spec, while some of the arithmetic done on it assumes 64-bit sizes. The pointer types have been replaced with typedefs, and all of these types ultimately resolve to long long or stdint types now.
  2. The use of wchar_t is now explicitly a 32-bit integer inside the compiler.

@ijsf ijsf changed the title refactor: long types and wchar_t cross-platform compatibility. refactor: long types and wchar_t cross-platform compatibility May 27, 2024
ijsf added 2 commits May 27, 2024 23:16
This is necessary because unsigned long and long do not have sizes that are defined in the C spec, while some of the arithmetic done on it assumes 64-bit sizes.
…sewhere as this typedef may vary on some platforms.
@ijsf
Copy link
Contributor Author

ijsf commented May 27, 2024

I've cleaned up this PR. All tests are passing now.

uintptr_t and intptr_t are not touched, even though they are host dependent. Though in some places their use could theoretically be problematic (e.g. ELF header, ld objects), but it is of no concern right now.

@tyfkda
Copy link
Owner

tyfkda commented May 28, 2024

After careful consideration, I would like to reject this pull request because it is difficult for me to support the MinGW64 platform.
I apologize for not being able to meet your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants