Skip to content

Commit

Permalink
Explicitly define min/max as inline functions instead of macros
Browse files Browse the repository at this point in the history
fixes #2
  • Loading branch information
LagoLunatic committed Apr 9, 2021
1 parent 8fd8558 commit 2e3cb60
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pyfasttextureutils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>

#undef min
#undef max
inline int min(int a, int b) {
return a < b ? a : b;
}
inline int max(int a, int b) {
return a > b ? a : b;
}

int pyfasttextureutils_color_tuple_one_value_to_int(PyObject* tuple, int index, int* val_int) {
PyObject* val_obj = PyTuple_GetItem(tuple, index);
if (val_obj == NULL) {
Expand Down

0 comments on commit 2e3cb60

Please sign in to comment.