Fixed -Wundef warnings

Ported from https://github.com/jverkoey/nimbus/commit/4fe665fac97e2ec43aa3efff3b0d0b81dd221caf