I'm having some problems grokking version.

How would I translate this simple C macro?
#if !defined(IDENT) || !defined(IDENT2)

I've tried the following:
version(!IDENT)
> identifier or integer expected, not !

!version(IDENT)
> Declaration expected, not '!'

version(IDENT || IDENT2)
> found '||' when expecting ')'

version(IDENT) || version(IDENT2)
> Declaration expected, not '||'


This is just plain ugly:
version(IDENT) {
} else {
  version = NOT_IDENT_OR_IDENT2;
}

version(IDENT2) {
} else {
  version = NOT_IDENT_OR_IDENT2;
}

version(NOT_IDENT_OR_IDENT2) {
  // Finally
}

Reply via email to