Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/hx/libs/std/Sys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ bool _hx_std_set_cwd( String d )
<li>[Linux]</li>
<li>[BSD]</li>
<li>[Mac]</li>
<li>[Android]</li>
<li>[iOS]</li>
<li>[tvOS]</li>
<li>[watchOS]</li>
</ul>
</doc>
**/
Expand All @@ -256,14 +260,20 @@ String _hx_std_sys_string()
return HX_CSTRING("Windows");
#elif defined(NEKO_GNUKBSD)
return HX_CSTRING("GNU/kFreeBSD");
#elif defined(ANDROID)
return HX_CSTRING("Android");
#elif defined(NEKO_LINUX)
return HX_CSTRING("Linux");
#elif defined(NEKO_BSD)
return HX_CSTRING("BSD");
#elif defined(IPHONE)
return HX_CSTRING("iOS");
#elif defined(APPLETV)
return HX_CSTRING("tvOS");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to also leave a note, hashlink provides a precedent for these identifiers:

https://github.com/HaxeFoundation/hashlink/blob/8425bde866170df7d8f99c3165840c32d683a8e9/src/std/sys.c#L107-L110

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really use hashlink I just assumed it was all fed through here, given this is cpp I never thought farther than that lol. The names here match HashLink's (iOS, tvOS, Android). HashLink has no watchOS case; I used watchOS to match Apple's naming next to tvOS, but I'm happy to drop it if you'd rather stay with what HashLink has.

I think it's more accurate to not use the hashlink prefix on cpp though

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is all good, just wanted to leave a note so we make sure it matches what other targets are already returning on these platforms. Hashlink doesn't support watchOS but hxcpp does, so I think it makes sense to have it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, so what would you like the pr to be changed to?

@Jarrio Jarrio Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to clarify, I figured putting it in order of specificity would be best because I don't think there's many situations where one would want to get linux back on an android device. I don't think there could be any conflicts here, this API is likely not used much because of the current output

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no issue for me with the apple ones, I just wanted to note the reference to compare with another haxe target.

But for the emscripten change, if we don't have a specific reason to move it then we can probably keep it as is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved emscripten back

#elif defined(HX_APPLEWATCH)
return HX_CSTRING("watchOS");
#elif defined(NEKO_MAC)
return HX_CSTRING("Mac");
#elif defined(ANDROID)
return HX_CSTRING("Android");
#elif defined(BLACKBERRY)
return HX_CSTRING("BlackBerry");
#elif defined(__EMSCRIPTEN__)
Expand Down