godotengine / godotengine/godot-docs

Issues With C# Preprocessor Defines

Open
#9,230 3 comments 1 reaction 0 assignees View on GitHub
area:manual bug topic:dotnet
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**
~~4.2~~ 4.4

**Issue description:**
The wiki page on conditional compilation for C# has a number of issues:

- ~~It says `GODOT_SERVER` is defined for dedicated server exports, but it's never defined.~~
- ~~It says `GODOT_64` or `GODOT_32` is defined in the editor and exports, but they're never defined.~~
- It says `GODOT_PC` is defined only when exporting, but it's also defined in the editor.
- It says the platform defines are "created from the `get_name()` method of the OS singleton" which is not true, as `get_name()` values have different casing, separate Linux and BSD, and uses "Web" rather than HTML5.

Additionally, there are some design problems:

- [No guarantee](https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_features.html#:~:text=These%20names%20may%20change%20in%20the%20future.) that the names won't change in the future.
- Duplicate definitions such as `GODOT_MACOS`/`GODOT_OSX`, `GODOT_WEB/GODOT_HTML5`.
- ~~`GODOT_32` and `GODOT_64` are ambiguous between the OS architecture and the floating point accuracy.~~

There's no clear consensus on determining which export the game is running on, so I suggest a dedicated wiki page is created for this purpose.

**URL to the documentation page:**
https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_features.html

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.