An upcoming release (not yet posted) will include support for the following nonstandard extensions, which are only supported if -e is used:
#pragma default_function(function-identifier) // Mark 'function-identifier', which must be a declared but not yet defined function, as permissible for the compiler to autogenerate a stub implementation (throws arguments away and returns default values). A stub implementation is only generated if the script doesn't define the function, but the function is referenced.
#define symbol [value] // Simple define preprocessor replacement support. Works for defining identifiers to any typical identifier and/or token sequence as per C, but no function-like macros yet. Ifdef support is not in yet either, but may appear eventually.
#undef symbol // Remove symbol as a define macro
The following builtin preprocessor defines will be available in a future release, in extensions mode:
__DATE__ - script build date (quoted string)
__TIME__ - script build time (quoted string)
__NSC_COMPILER_DATE__ - compiler build date (quoted string)
__NSC_COMPILER_TIME__ - compiler build time (quoted string)
__FILE__ - current source file name, as a resref (quoted string)
__LINE__ - current source line number, as an integer
__COUNTER__ - increasing sequence number, as an integer
__FUNCTION__ - current function name (quoted string; only permissible within a function body)
Remember that for NWN2 usage, you generally can't use nonstandard extensions for scripts that the server must compile (e.g. GUI scripts and other parameterized scripts).
Modifié par SkywingvL, 23 juin 2011 - 08:37 .