add macros for writing inline platform-specific expressions

This commit is contained in:
2025-04-18 21:22:16 +02:00
parent abbb43ab50
commit c01ce06307

View File

@@ -12,10 +12,14 @@
# define PATH_SEP '\\' // contains the path separator as a character. Yes it is extremely annoying that this has to exist. # define PATH_SEP '\\' // contains the path separator as a character. Yes it is extremely annoying that this has to exist.
# define PATH_SEP_STR "\\" // contains the path separator as a string, useful for concatenation. Yes it is extremely annoying that this has to exist. # define PATH_SEP_STR "\\" // contains the path separator as a string, useful for concatenation. Yes it is extremely annoying that this has to exist.
# define unixonly(_exec) // (no-op) executes inline code when __unix__ is defined, otherwise is no-op
# define winonly(_exec) _exec // executes inline code when _WIN32 is defined, otherwise is no-op
#else #else
# define PATH_SEP '/' // contains the path separator as a character. Yes it is extremely annoying that this has to exist. # define PATH_SEP '/' // contains the path separator as a character. Yes it is extremely annoying that this has to exist.
# define PATH_SEP_STR "/" // contains the path separator as a string, useful for concatenation. Yes it is extremely annoying that this has to exist. # define PATH_SEP_STR "/" // contains the path separator as a string, useful for concatenation. Yes it is extremely annoying that this has to exist.
# define unixonly(_exec) _exec // executes inline code when __unix__ is defined, otherwise is no-op
# define winonly(_exec) // (no-op) executes inline code when _WIN32 is defined, otherwise is no-op
#endif #endif
// define the constants if they haven't been // define the constants if they haven't been