Quadriflow build fail

I get a build fail with quadriflow. The const member variable NetworkSimplex::MAX conflicts with the MAX macro.

Renaming NetworkSimplex::MAX to NetworkSimplex::_MAX seems to be a workable fix.

[ 21%] Building C object source/blender/editors/space_action/CMakeFiles/bf_editor_space_action.dir/action_select.c.o
In file included from <SRCDIR>/extern/quadriflow/src/optimizer.cpp:13:
In file included from <SRCDIR>/extern/quadriflow/src/flow.hpp:16:
<SRCDIR>/extern/quadriflow/3rd/lemon-1.3.1/lemon/network_simplex.h:652:44: error: too few arguments provided to function-like macro invocation
      MAX(std::numeric_limits<Value>::max()),
                                           ^
/usr/include/sys/param.h:306:9: note: macro 'MAX' defined here
#define MAX(a,b) (((a)>(b))?(a):(b))
        ^
In file included from <SRCDIR>/extern/quadriflow/src/optimizer.cpp:13:
In file included from <SRCDIR>/extern/quadriflow/src/flow.hpp:16:
<SRCDIR>/extern/quadriflow/3rd/lemon-1.3.1/lemon/network_simplex.h:652:45: error: expected '(' or '{'
      MAX(std::numeric_limits<Value>::max()),
                                            ^

@ZedDB, can you fix this?

What compiler is this? We managed to build successfully on all our platforms with the build bot.

It doesn’t really matter which compiler it was, we should patch the code to fix this and the solution seems clear.

Right, but I want to know so that we can reproduce this ourselves as well. Otherwise I have not way to check that any fixes we commit actually does something.

Tossing #define MAX(a,b) (((a)>(b))?(a):(b)) into config.h may do it for testing (be sure to undo before you commit)

I am using FreeBSD 12.1-PreRelease which has clang 8 as the base compiler.

Thanks! I’ll try to look into it as soon as possible. I have a few other things I need to do first though.

If you haven’t heard anything in a week from now, ping me here again.

I committed a fix now, these types of build issues should be addressed immediately.
https://developer.blender.org/rB5516e52