Skip to content

Commit

Permalink
fix enum starting with a number
Browse files Browse the repository at this point in the history
  • Loading branch information
Naghasan committed Oct 29, 2024
1 parent 60f1df8 commit 4450b3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions include/spirv/unified1/spirv.hpp11
Original file line number Diff line number Diff line change
Expand Up @@ -3220,9 +3220,9 @@ inline const char* StorageClassToString(StorageClass value) {

inline const char* DimToString(Dim value) {
switch (value) {
case Dim::1D: return "1D";
case Dim::2D: return "2D";
case Dim::3D: return "3D";
case Dim::Dim1D: return "1D";
case Dim::Dim2D: return "2D";
case Dim::Dim3D: return "3D";
case Dim::Cube: return "Cube";
case Dim::Rect: return "Rect";
case Dim::Buffer: return "Buffer";
Expand Down
4 changes: 2 additions & 2 deletions tools/buildHeaders/header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ IN THE MATERIALS.
virtual std::string pre() const { return ""; } // C name prefix
virtual std::string headerGuardSuffix() const = 0;

virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& opEnum, const std::string& name) const { return pre() + opPrefix + name; }
virtual std::string fmtEnumUse(const std::string &opPrefix, const std::string &opEnum, const std::string &name) const { return pre() + opPrefix + name; }

void printUtility(std::ostream& out) const override
{
Expand Down Expand Up @@ -710,7 +710,7 @@ IN THE MATERIALS.
}

// Add type prefix for scoped enum
std::string fmtEnumUse(const std::string& opPrefix, const std::string& opEnum, const std::string& name) const override { return opEnum + "::" + name; }
std::string fmtEnumUse(const std::string& opPrefix, const std::string& opEnum, const std::string& name) const override { return opEnum + "::" + prependIfDigit(opEnum, name); }

std::string headerGuardSuffix() const override { return "HPP"; }
};
Expand Down

0 comments on commit 4450b3e

Please sign in to comment.