os.is64bit() support on POSIX platform#2609
Closed
noresources wants to merge 1 commit intopremake:masterfrom
Closed
os.is64bit() support on POSIX platform#2609noresources wants to merge 1 commit intopremake:masterfrom
noresources wants to merge 1 commit intopremake:masterfrom
Conversation
Use iname() to get host architecture name and compare it against a known 64-bit architecture name list.
nickclark2016
requested changes
Jan 24, 2026
Member
There was a problem hiding this comment.
Remove this change from the commit.
| */ | ||
|
|
||
| #include "premake.h" | ||
| #if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD) || defined(PLATFORM_LINUX) || defined(PLATFORM_SOLARIS) || defined(PLATFORM_HURD) || defined(PLATFORM_HAIKU) || defined(PLATFORM_COSMO) |
Member
There was a problem hiding this comment.
Nit: Update the date on the copyright
| #endif | ||
| #if HAVE_UNAME | ||
| struct utsname data; | ||
| if (uname(&data) >= 0) |
Contributor
Author
There was a problem hiding this comment.
It was my first move. Before reading this comment in src/host/os_getversion.c
// uname returns -1 on error, and returns 0 on success for most platforms
// except Solaris, which returns non-negative.
80217d4 to
d4622b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use iname() to get host architecture name and compare it against a known 64-bit architecture name list.
What does this PR do?
os.is64bit() implementation for POSIX platforms.
How does this PR change Premake's behavior?
os.is64bit() returns
trueon most common 64-bit platforms running POSIX systems.Anything else we should know?
Architecture white list is not exhaustive but covers most common platforms.
Did you check all the boxes?
closes #XXXXin comment to auto-close issue when PR is merged)You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!