From: SourceForge.net <no...@so...> - 2010-09-27 01:29:07
|
Bugs item #2685755, was opened at 2009-03-13 13:14 Message generated for change (Comment added) made by olly You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2685755&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ruby Group: None >Status: Closed Resolution: Invalid Priority: 5 Private: No Submitted By: Blakharaz (blakharaz) Assigned to: William Fulton (wsfulton) Summary: Mac OS X: check already defined as macro Initial Comment: In Mac OS X the header file AssertMacros.h already defines check as a assertion macro. This leads to compiler errors for some generated code creating or using check identifiers: E.g.: template <class Type> struct traits_check<Type, value_category> { static bool check(VALUE obj) { int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; return SWIG_IsOK(res) ? true : false; } }; template <class Type> struct traits_check<Type, pointer_category> { static bool check(VALUE obj) { int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; return SWIG_IsOK(res) ? true : false; } }; template <class Type> inline bool check(VALUE obj) { return traits_check<Type, typename traits<Type>::category>::check(obj); } ---------------------------------------------------------------------- >Comment By: Olly Betts (olly) Date: 2010-09-27 14:29 Message: Already marked invalid, actually closing. ---------------------------------------------------------------------- Comment By: Blakharaz (blakharaz) Date: 2009-03-18 12:39 Message: Sorry, I didn't point that out: I did _not_ add the AssertMacros.h header intentionally (this is just for the example code). In our code I just added the <Carbon.h> umbrella header or it is another header which includes the AssertMacros.h. I agree that apple is polluting the global namespace with that check macro. Maybe a hint in some FAQ documents is enough for that issue because the compiler error is really strange. ---------------------------------------------------------------------- Comment By: William Fulton (wsfulton) Date: 2009-03-17 20:07 Message: SWIG is generating perfectly valid code, the traits_check::check method is in a unique namespace (Swig) and the check symbol is a standard conforming symbol and will coexist with other standard conforming code. The AssertMacros.h header is polluting the global namespace and SWIG does not use it. It is you who has chosen to use this header and so you must fix up the problems associated with it. It is easy, just put a #undef check after the #include "AssertMacros.h". or ask Apple to fix up the pollution in this header. ---------------------------------------------------------------------- Comment By: Blakharaz (blakharaz) Date: 2009-03-15 13:26 Message: check-test.i seems to be the shortest input file showing the problem. The commands for testing I used are: swig -ruby -c++ check-test.i gcc -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/Headers check-test_wrap.cxx For me it shows 5 compiler errors. If the bug is fixed there should be just linker errors. ---------------------------------------------------------------------- Comment By: Blakharaz (blakharaz) Date: 2009-03-15 13:23 Message: File Added: check-test.i ---------------------------------------------------------------------- Comment By: William Fulton (wsfulton) Date: 2009-03-15 04:54 Message: You're going to have to supply a standalone interface file in order for us to replicate the problem and fix this as you are referring to files that don't exist in SWIG and we don't have time to guess your setup. ---------------------------------------------------------------------- Comment By: Blakharaz (blakharaz) Date: 2009-03-14 13:57 Message: No, it doesn't help. That header file containing the check macro is somehow included through our own header files, which is done after the part generated by rubyhead.swg. See http://svn.berlios.de/svnroot/repos/dsa-hl/rl/trunk/engine/script/swig/RlExports.i or http://svn.berlios.de/svnroot/repos/dsa-hl/rl/trunk/engine/script/swig for our SWIG input files. However, a #undef check in our FixRubyHeaders.h file fixes the problem (but just for us, of course). ---------------------------------------------------------------------- Comment By: William Fulton (wsfulton) Date: 2009-03-13 13:26 Message: Does a #undef check in rubyhead.swg fix it for you? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2685755&group_id=1645 |