[DEV] try to correct clang and gcc unacordence on the sequening of expending the variadic elements ...
This commit is contained in:
parent
da1afb3771
commit
5342ac68b1
@ -36,6 +36,7 @@ template<> int64_t convertJsonTo<int64_t>(const ejson::Value& _value) {
|
|||||||
return int64_t(_value.toNumber().get());
|
return int64_t(_value.toNumber().get());
|
||||||
}
|
}
|
||||||
template<> int32_t convertJsonTo<int32_t>(const ejson::Value& _value) {
|
template<> int32_t convertJsonTo<int32_t>(const ejson::Value& _value) {
|
||||||
|
_value.display();
|
||||||
return int32_t(_value.toNumber().get());
|
return int32_t(_value.toNumber().get());
|
||||||
}
|
}
|
||||||
template<> int16_t convertJsonTo<int16_t>(const ejson::Value& _value) {
|
template<> int16_t convertJsonTo<int16_t>(const ejson::Value& _value) {
|
||||||
|
@ -122,8 +122,18 @@ class TypeList: public CmdBase {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
// TODO : Check params ...
|
// TODO : Check params ...
|
||||||
int32_t idParam = 0;
|
// Clang and Gcc does not exapnd variadic template at the same way ...
|
||||||
ejson::Value retVal = convertToJson(m_function(convertJsonTo<JUS_TYPES>(_params[idParam++])...));
|
#if defined(__clang__)
|
||||||
|
// clang generate a basic warning:
|
||||||
|
// warning: multiple unsequenced modifications to 'idParam' [-Wunsequenced]
|
||||||
|
int32_t idParam = 0;
|
||||||
|
ejson::Value retVal = convertToJson(m_function(convertJsonTo<JUS_TYPES>(_params[idParam++])...));
|
||||||
|
#elif defined(__GNUC__) || defined(__GNUG__) || defined(_MSC_VER)
|
||||||
|
int32_t idParam = m_listParamType.size()-1;
|
||||||
|
ejson::Value retVal = convertToJson(m_function(convertJsonTo<JUS_TYPES>(_params[idParam--])...));
|
||||||
|
#else
|
||||||
|
#error Must be implemented ...
|
||||||
|
#endif
|
||||||
out.add("return", retVal);
|
out.add("return", retVal);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
@ -161,8 +171,18 @@ class TypeListVoid: public CmdBase {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
// TODO : Check params ...
|
// TODO : Check params ...
|
||||||
int32_t idParam = m_listParamType.size()-1;
|
// Clang and Gcc does not exapnd variadic template at the same way ...
|
||||||
m_function(convertJsonTo<JUS_TYPES>(_params[idParam--])...);
|
#if defined(__clang__)
|
||||||
|
// clang generate a basic warning:
|
||||||
|
// warning: multiple unsequenced modifications to 'idParam' [-Wunsequenced]
|
||||||
|
int32_t idParam = 0;
|
||||||
|
m_function(convertJsonTo<JUS_TYPES>(_params[idParam++])...);
|
||||||
|
#elif defined(__GNUC__) || defined(__GNUG__) || defined(_MSC_VER)
|
||||||
|
int32_t idParam = m_listParamType.size()-1;
|
||||||
|
m_function(convertJsonTo<JUS_TYPES>(_params[idParam--])...);
|
||||||
|
#else
|
||||||
|
#error Must be implemented ...
|
||||||
|
#endif
|
||||||
out.add("return", ejson::Null());
|
out.add("return", ejson::Null());
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user