Commit b00fd6ae authored by Robert Bradshaw's avatar Robert Bradshaw Committed by GitHub

Merge pull request #2767 from orivej/patch-1

Fix support for C++ enum classes
parents bc9d51bc 7c377902
......@@ -719,7 +719,14 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t wid
Py_ssize_t length, ulength;
int prepend_sign, last_one_off;
{{TYPE}} remaining;
const {{TYPE}} neg_one = ({{TYPE}}) (({{TYPE}}) 0 - ({{TYPE}}) 1), const_zero = ({{TYPE}}) 0;
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
const {{TYPE}} neg_one = ({{TYPE}}) -1, const_zero = ({{TYPE}}) 0;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
const int is_unsigned = neg_one > const_zero;
if (format_char == 'X') {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment