diff --git a/generator/templates/dawn_wire/client/ApiObjects.h b/generator/templates/dawn_wire/client/ApiObjects.h index 0d8421b976..bbf98174bd 100644 --- a/generator/templates/dawn_wire/client/ApiObjects.h +++ b/generator/templates/dawn_wire/client/ApiObjects.h @@ -21,7 +21,9 @@ namespace dawn_wire { namespace client { template - static constexpr ObjectType ObjectTypeToTypeEnum = static_cast(-1); + struct ObjectTypeToTypeEnum { + static constexpr ObjectType value = static_cast(-1); + }; {% for type in by_category["object"] %} {% set Type = type.name.CamelCase() %} @@ -41,7 +43,9 @@ namespace dawn_wire { namespace client { } template <> - static constexpr ObjectType ObjectTypeToTypeEnum<{{type.name.CamelCase()}}> = ObjectType::{{type.name.CamelCase()}}; + struct ObjectTypeToTypeEnum<{{Type}}> { + static constexpr ObjectType value = ObjectType::{{Type}}; + }; {% endfor %} }} // namespace dawn_wire::client diff --git a/src/dawn_wire/client/Device.h b/src/dawn_wire/client/Device.h index eef03a573f..a0036a4ead 100644 --- a/src/dawn_wire/client/Device.h +++ b/src/dawn_wire/client/Device.h @@ -65,7 +65,7 @@ namespace dawn_wire { namespace client { template void TrackObject(T* object) { - mObjects[ObjectTypeToTypeEnum].Append(object); + mObjects[ObjectTypeToTypeEnum::value].Append(object); } void CancelCallbacksForDisconnect() override;