Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df3f88bc authored by Lajos Molnar's avatar Lajos Molnar
Browse files

codec2: fix enum name collisions

Use full type in C2_ENUM to avoid compiler name collisions.

Bug: 165694889
Change-Id: I5ab973572ab79e2191d9e169bc1de1a845203bc6
parent 246b31dc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ private:
/// \note this will contain any initialization, which we will remove when converting to lower-case
#define _C2_GET_ENUM_NAME(x, y) #x
/// mapper to get value of enum
#define _C2_GET_ENUM_VALUE(x, type) (_C2EnumConst<type>)x
#define _C2_GET_ENUM_VALUE(x, type_) (_C2EnumConst<typename std::underlying_type<type_>::type>)type_::x

/// \endcond

@@ -106,7 +106,7 @@ public:
template<> \
C2FieldDescriptor::NamedValuesType C2FieldDescriptor::namedValuesFor(const name &r __unused) { \
    return _C2EnumUtils::sanitizeEnumValues( \
            std::vector<C2Value::Primitive> { _C2_MAP(_C2_GET_ENUM_VALUE, type, __VA_ARGS__) }, \
            std::vector<C2Value::Primitive> { _C2_MAP(_C2_GET_ENUM_VALUE, name, __VA_ARGS__) }, \
            { _C2_MAP(_C2_GET_ENUM_NAME, type, __VA_ARGS__) }, \
            prefix); \
}