Common Predefined Versions (The GNU D Compiler)

#### 2.7.2 Common Predefined Versions ¶

The common predefined macros are GNU D extensions. They are available with the same meanings regardless of the machine or operating system on which you are using GNU D. Their names all start with `GNU`.

`GNU`

  This version is defined by the GNU D compiler. If all you need to know is whether or not your D program is being compiled by GDC, or a non-GDC compiler, you can simply test `version(GNU)`.

`GNU_CET`

  This version is defined when `-fcf-protection` is used. The protection level is also set in `__traits(getTargetInfo, "CET")` (see Traits).

`GNU_DWARF2_Exceptions`
`GNU_SEH_Exceptions`
`GNU_SjLj_Exceptions`

  These versions reflect the mechanism that will be used for exception handling by the target. `GNU_DWARF2_Exceptions` is defined when the target uses DWARF 2 exceptions. `GNU_SEH_Exceptions` is defined when the target uses SEH exceptions. `GNU_SjLj_Exceptions` is defined when the target uses the `setjmp`/`longjmp`-based exception handling scheme.

`GNU_EMUTLS`

  This version is defined if the target does not support thread-local storage, and an emulation layer is used instead.

`GNU_InlineAsm`

  This version is defined when `asm` statements use GNU D style syntax. (see Inline Assembly)

`GNU_StackGrowsDown`

  This version is defined if pushing a word onto the stack moves the stack pointer to a smaller address, and is undefined otherwise.