Bug 216772

Summary: games/warsow: fails to build with libc++ 4.0
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: eric
Priority: --- Keywords: needs-patch
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 216008    

Description Jan Beich freebsd_committer freebsd_triage 2017-02-04 05:31:07 UTC
In file included from angelwrap/qas_angelwrap.cpp:25:
In file included from angelwrap/addon/addon_dictionary.h:20:
In file included from /usr/include/c++/v1/map:442:
/usr/include/c++/v1/__tree:1111:55: error: too few arguments provided to function-like macro invocation
                numeric_limits<difference_type >::max());}
                                                      ^
angelwrap/../gameshared/q_math.h:127:9: note: macro 'max' defined here
#define max( a, b ) ( ( a ) > ( b ) ? ( a ) : ( b ) )
        ^
In file included from angelwrap/qas_angelwrap.cpp:32:
In file included from /usr/include/c++/v1/list:180:
/usr/include/c++/v1/__undef_min_max:17:2: warning: : macro min is incompatible with C++.  #undefing min [-W#warnings]
#warning: macro min is incompatible with C++.  #undefing min
 ^
/usr/include/c++/v1/__undef_min_max:29:2: warning: : macro max is incompatible with C++.  #undefing max [-W#warnings]
#warning: macro max is incompatible with C++.  #undefing max
 ^
2 warnings and 1 error generated.

http://package18.nyi.freebsd.org/data/headi386PR216008-default/2017-02-02_16h22m03s/logs/errors/warsow-1.51_2.log
http://package18.nyi.freebsd.org/data/headamd64PR216008-default/2017-01-29_16h09m05s/logs/errors/warsow-1.51_2.log
regressed by: https://github.com/llvm-mirror/libcxx/commit/ef3060ef96f9 (r287729)
Comment 1 Jan Beich freebsd_committer freebsd_triage 2017-02-04 05:32:37 UTC
While adding "#undef max" into angelwrap/addon/addon_dictionary.h helps, I think, libc++ should include <__undef_min_max> within <map> or <__tree> instead.
Comment 2 Eric Fiselier 2017-02-04 20:40:39 UTC
I would pester the angelwrap maintainer, since #defining those symbols is evil.

None the less I'll merge the suggested libc++ changes into the 4.0 branch today.
Comment 3 Eric Fiselier 2017-02-04 22:48:31 UTC
The fix was merged into the 4.0 branch in r294103.
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2017-02-05 21:50:44 UTC
I imported Eric's fix in r313300 (in the project/clang400-import branch).
Comment 5 Jan Beich freebsd_committer freebsd_triage 2017-02-06 02:01:04 UTC
I confirm, the port builds fine now: http://sprunge.us/Edgh