Fix not defined warnings (-Wundef) (cherry picked from commit 617698e54459ec9f31c894ba83c6f4dfc5570291)