diff --git a/tools/buildHeaders/header.cpp b/tools/buildHeaders/header.cpp index 4ee358b5d..2e20132e9 100644 --- a/tools/buildHeaders/header.cpp +++ b/tools/buildHeaders/header.cpp @@ -578,6 +578,7 @@ namespace { void printMaskOperators(std::ostream& out, const std::string& specifiers) const { const Json::Value& enums = spvRoot["spv"]["enum"]; + out << "#ifndef __HLSL_VERSION\n"; out << "// Overload bitwise operators for mask bit combining\n\n"; for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) { @@ -601,6 +602,7 @@ namespace { typeName << "(~unsigned(a)); }\n"; } } + out << "#endif\n"; } private: void printPrologue(std::ostream& out) const override {