Skip to content

Preprocessor

JezuzLizard edited this page Oct 8, 2023 · 4 revisions

Preprocessor Support

gsc-tool includes a preprocessor for all supported games.

It supports the following statements:

#define
#undef
#if
#else
#elif
#ifdef
#ifndef
#endif
#inline

#define

#Define supports plain names(#define DEBUG), objects(#define DEBUG true), and function macros.
## can be used to concatenate strings.

#undef

Undefines a macro(#UNDEF DEBUG).

#if, #else, #elif, #ifdef, #ifndef, #endif

Used to evaluate plain and/or object macros.

#if and #elif support the following operators:

?:, &&, ||, |, ^, &, <<, >>, ==, !=, <=, >=, <, >, *, /, +, %, -, !, ~

and the following types:

bool, int, float, string

#inline

Allows the preprocessor to import macros from a .gsh file(#inline maps\mp\gamelogic;).

Further Reading

https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-directives?view=msvc-170

Clone this wiki locally