Files
fulpstation/code/__HELPERS/nameof.dm
John Willard d5a8187c58 January tgu (#1094)
* tgu

* btfo

* Barsigns

* tgui fixes

* Map stuff

* pubby morgue

* .

* ...

* fixes varedited slime extract

* Merge remote-tracking branch 'upstream/master' into january-tgu
2024-02-01 09:15:55 -08:00

12 lines
422 B
Plaintext

/**
* NAMEOF: Compile time checked variable name to string conversion
* evaluates to a string equal to "X", but compile errors if X isn't a var on datum.
* datum may be null, but it does need to be a typed var.
**/
#define NAMEOF(datum, X) (#X || ##datum.##X)
/**
* NAMEOF that actually works in static definitions because src::type requires src to be defined
*/
#define NAMEOF_STATIC(datum, X) (nameof(type::##X))