Boost C++ Libraries: Ticket #5010: Fusion will now compile under Objective-C++ https://svn.boost.org/trac10/ticket/5010 <p> I was attempting to use the boost::accumulators which relies on boost::fusion on the iPhone/Mac OS in a file that needs to know about Apple Objective-C data types using Objective-C++. </p> <p> Line 21 of boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp declares the following: </p> <p> struct nil; </p> <p> This is illegal under Objective-C, and thus Objective C++ since nil is a reserved word. As a result, merely including any file that depends on cons_iterator.hpp results in error messages such as the following. </p> <p> The easy fix for this is to change the name of the nil struct to anything other than a reserved word under Obj-C++. </p> <p> /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:21: error: expected identifier before '<span class="underline">null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:21: error: expected unqualified-id before '</span>null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:28: error: expected type-specifier before '<span class="underline">null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:28: error: expected '&gt;' before '</span>null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:52: error: expected unqualified-id before '<span class="underline">null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:54: error: type/value mismatch at argument 1 in template parameter list for 'template&lt;class T&gt; struct boost::add_const' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:54: error: expected a type, got '0' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:54: error: template argument 1 is invalid /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:57: error: expected unqualified-id before '</span>null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:57: error: expected `)' before '<span class="underline">null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:61: error: type/value mismatch at argument 1 in template parameter list for 'template&lt;class Cons&gt; struct boost::fusion::cons_iterator' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:61: error: expected a type, got '0' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:68: error: type/value mismatch at argument 1 in template parameter list for 'template&lt;class Cons&gt; struct boost::fusion::cons_iterator' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:68: error: expected a type, got '0' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:78: error: expected unqualified-id before '</span>null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:78: error: expected `)' before '<span class="underline">null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:85: error: expected unqualified-id before '</span>null' /Users/bdoig/Dropbox/Projects/boost_1_45_0/boost/fusion/container/list/cons_iterator.hpp:85: error: expected `)' before '<span class="underline">null' </span></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5010 Trac 1.4.3 Joel de Guzman Fri, 21 Jan 2011 07:14:27 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5010#comment:1 https://svn.boost.org/trac10/ticket/5010#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Oops. Sorry, wrong ticket. Please disregard this. </p> Ticket Joel de Guzman Fri, 21 Jan 2011 07:18:20 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/5010#comment:2 https://svn.boost.org/trac10/ticket/5010#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">wontfix</span> </li> </ul> Ticket Brian Doig <Brian.Doig@…> Fri, 21 Jan 2011 17:40:30 GMT <link>https://svn.boost.org/trac10/ticket/5010#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:3</guid> <description> <p> Glad it was the wrong ticket. It prevented using boost::accumulators and anything else that relied on Fusion impossible to use with Objective-C++ on the Mac/iOS </p> </description> <category>Ticket</category> </item> <item> <author>ufosky@…</author> <pubDate>Mon, 10 Oct 2011 19:18:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:4</guid> <description> <p> This bug is still exist in current release(1.47.0),I use boost::msm with Objective-C++,but it cause many errors </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jürgen Hunold</dc:creator> <pubDate>Sun, 04 Dec 2011 12:09:55 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5010 https://svn.boost.org/trac10/ticket/5010 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fusion_nil_.diff</span> </li> </ul> <p> Patch replacing nil with nil_ </p> Ticket Jürgen Hunold Sun, 04 Dec 2011 12:12:59 GMT <link>https://svn.boost.org/trac10/ticket/5010#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:5</guid> <description> <p> This also clashes with LEDA-4.2 which uses a "nil" (for NULL) in the global namespace. I've attached a patch which replaces "nil" with "nil_" for fusion and all usage cases I've found. Run Boost unit tests with gcc-4.2 and clang-3.1 (trunk). Documentation is not patched. </p> <p> Okay to commit? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 21 Jan 2012 10:38:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:6</guid> <description> <p> I've also run into the same problem with 1.48.0 on Mac OS X using the 10.6 SDK. The header <code>MacTypes.h</code> #defines nil to NULL which causes the same "error: expected unqualified-id before 'null' " compilation error. </p> </description> <category>Ticket</category> </item> <item> <author>rowanj@…</author> <pubDate>Mon, 23 Jan 2012 23:34:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:7</guid> <description> <p> With current Xcode (4.2) </p> <p> Building as Objective-C++ will include &lt;objc/objc.h&gt;, which contains: </p> <pre class="wiki">#ifndef Nil #define Nil __DARWIN_NULL /* id of Nil class */ #endif #ifndef nil #define nil __DARWIN_NULL /* id of Nil instance */ #endif </pre><p> So this error will re-occur for <code>nil</code> or <code>Nil</code> (the current incarnation of this error for us in 1.48.0) </p> </description> <category>Ticket</category> </item> <item> <author>arne.schmitz@…</author> <pubDate>Thu, 16 Feb 2012 13:47:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:8</guid> <description> <p> Having the same problem with iOS SDK 5.0 on OS X 10.7.3 running Xcode 4.2. This minimal test program fails: </p> <pre class="wiki">#import &lt;CoreFoundation/CoreFoundation.h&gt; #include &lt;boost/phoenix/core/reference.hpp&gt; int main() { return 1; } </pre><p> Swapping the two header lines will result in successful compilation. Will now try the patch by jhunold, and see if it fixes my problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Mon, 20 Feb 2012 01:16:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:9</guid> <description> <p> Allow me to reiterate that the proper patch for this is not a global rename of nil into something else. nil is part of the interface of fusion (and phoenix). It will break backward compatibility of we simply rename nil to, say, nil_. The acceptable patch is to do a rename *ONLY* for the affected libraries (e.g. LEDA) and platforms with a proper warning that nil is being renamed and will therefore break compatibility where/if it's used on such platforms or with such libraries. </p> </description> <category>Ticket</category> </item> <item> <author>matthew.davies@…</author> <pubDate>Tue, 08 May 2012 16:02:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:10</guid> <description> <p> I had the same problem - I just wrapped the #include statements with #undef nil and #define nil NULL. That seems to fix it since I don't use nil when calling the API. </p> </description> <category>Ticket</category> </item> <item> <author>justacec@…</author> <pubDate>Wed, 15 Aug 2012 19:20:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:11</guid> <description> <p> I have recently encountered this problem with Snow Leopard, Xcode 4.4.1, and Boots 1.50.0. I am not sure what the final answer will be to this but right now I have done the following: </p> <pre class="wiki">#define nil Boost_nil #define Nil Boost_Nil &lt;All of my boost header files&gt; #undef Nil #undef nil </pre><p> It might possibly be better to do the following instead based on the earlier response: </p> <pre class="wiki">#define nil Boost_nil #define Nil Boost_Nil &lt;All of my boost header files&gt; #define Nil __DARWIN_NULL #define nil __DARWIN_NULL </pre><p> The main problem here is that I am getting warnings, which I do not like to see, in my Xcode compiles. </p> <p> Ohh, the drama... </p> <p> Is there any progress on getting this fixed up? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>CactusJack</dc:creator> <pubDate>Fri, 05 Oct 2012 01:02:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:12</guid> <description> <pre class="wiki">#ifdef nil #pragma push_macro("nil") #undef nil #include &lt;boost/nil-struct-idiot.hpp&gt; #pragma pop_macro("nil") #else #include &lt;boost/nil-struct-idiot.hpp&gt; #endif </pre><p> might be more elegant and safer </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 05 Oct 2012 18:18:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:13</guid> <description> <p> the status should be changed 2 must be changed right now </p> <p> struct struct{} class class {} idiot idiot{} </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 05 Oct 2012 18:21:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:14</guid> <description> <p> Joel for God sake swap your arse and change it, you did wrong, just admit it, it will save a lot of time and frustration to anyone </p> </description> <category>Ticket</category> </item> <item> <author>brian.doig@…</author> <pubDate>Fri, 05 Oct 2012 19:02:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:15</guid> <description> <p> "with a proper warning that nil is being renamed and will therefore break compatibility where/if it's used on such platforms or with such libraries." </p> <hr /> <p> The keyword nil is just a NULL pointer that is tagged with a different name so that the compiler knows to treat it as an objective-c object. Changing the definition of nil is equivalent to changing the definition of NULL under C++ to be something other than what the standard expects. That seems rather dangerous to me. </p> <p> Under Obj-C++ you can legally message a nil pointer. It ignores the message and any return value is zero. There are many places in the language that depend on this functionality. Changing the definition of nil could potentially break code everywhere in an application </p> <p> If you need to maintain nil for backwards compatibility purposes, then use a pre-processor test to check if the code is being compiled for objective-c and if so use a different symbol name. Or perhaps you could change it so that it's always nil_ but when not under objective-c you also define an alias of nil = nil_ so that the old code works. </p> <p> Is this problem tough to fix? Yes, but the iPhone/iPad/Mac are going to become more popular and the missing libraries from boost due to this are going to become larger and larger problems as time goes by. </p> <p> Nil is defined as follows. Perhaps there is some way to make the nil used by obj-c be semantically equivalent to how fusion defines nil? </p> <pre class="wiki">&lt;objc/objc.h&gt; #ifndef nil #define nil __DARWIN_NULL /* id of Nil instance */ #endif &lt;sys/_types.h&gt; #ifdef __cplusplus #ifdef __GNUG__ #define __DARWIN_NULL __null #else /* ! __GNUG__ */ #ifdef __LP64__ #define __DARWIN_NULL (0L) #else /* !__LP64__ */ #define __DARWIN_NULL 0 #endif /* __LP64__ */ #endif /* __GNUG__ */ #else /* ! __cplusplus */ #define __DARWIN_NULL ((void *)0) #endif /* __cplusplus */ </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 29 Nov 2012 17:26:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:16</guid> <description> <p> Please fix this! It makes using boost/fusion (or any boost lib that uses it, e.g. random) almost not worth it. The maintainers will have to face the fact that using the name "nil" was an extremely unfortunate decision in the first place. Unfortunately we are having to pay the price for it. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Fri, 30 Nov 2012 02:31:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:17</guid> <description> <p> A patch has been added to boost trunk. Please test. </p> </description> <category>Ticket</category> </item> <item> <author>Mital Vora <mital.d.vora@…></author> <pubDate>Tue, 01 Jan 2013 14:12:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:18</guid> <description> <p> Hi djowel, </p> <p> I tried checking out boost svn version 82308 (latest atm) and tried to compile my code which was having same issue: </p> <p> Here are the details </p> <p> I am trying to use Boost Process module (http: <em> www.highscore.de /boost/process0.5/index.html) in my code. I have downloaded the above library link provided in the above page (http: </em> www.highscore.de /boost/process0.5/process.zip). </p> <p> I have added the above files in include directories and trying to compile the same with my code: </p> <p> All changes I have so far is just include following in any file: </p> <p> ` #include &lt;boost/process.hpp&gt; ` </p> <p> If I try to compile this with boost 1.52 released version, I get following error: http: <em> pastebin.com /DLsF8LhT </em></p> <hr /> <p> My compiler is: i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. </p> <hr /> <p> Now when I try to compile the latest boost and try to use the same I am getting following error: </p> <p> http: <em> pastebin.com/GurfZsby </em></p> <p> It seems that there are still places which requires ifdefing out the nil to nil_, e.g. file: boost/fusion/sequence/intrinsic/detail/segmented_end.hpp:21 </p> <p> I am ready to help you fix this. I will also try to check the code but I am not much familiar with the code so may require your assistance. Let me know what time you would be available for chat / irc. </p> <p> Thanks, Mital </p> <p> P.S. Adding spaces in the links because the trac seems to think they are spam links. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Tue, 01 Jan 2013 22:50:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:19</guid> <description> <blockquote class="citation"> <p> I am ready to help you fix this. I will also try to check the code but I am not much familiar with the code so may require your assistance. Let me know what time you would be available for chat / irc. </p> </blockquote> <p> Thanks, Mital. I'm not sure when I'll be available for chat. I suggest just posting a patch here. Just follow the style of the recent patches. I can do the rest. </p> </description> <category>Ticket</category> </item> <item> <author>Richard Eakin <reakinator@…></author> <pubDate>Mon, 20 May 2013 00:02:14 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5010 https://svn.boost.org/trac10/ticket/5010 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fusion_nil_typename.patch</span> </li> </ul> <p> rename Nil to Nil_ for segmented_begin.hpp / segmented_end.hpp </p> Ticket Richard Eakin <reakinator@…> Mon, 20 May 2013 00:04:07 GMT <link>https://svn.boost.org/trac10/ticket/5010#comment:20 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:20</guid> <description> <p> The patch I just uploaded fixes the problem @Mital mentioned and also one I just ran into when trying to build boost log. Apparently 'Nil' also needs to be renamed to 'Nil_' to make Obj-C land happy. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Michael Caisse</dc:creator> <pubDate>Thu, 23 May 2013 01:28:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:21 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:21</guid> <description> <p> Committed change for template parameter name as Nil_ . Changeset <a class="changeset" href="https://svn.boost.org/trac10/changeset/84441" title="update fusion Nil template parameters to Nil_ to make ObjC happy. trac ...">[84441]</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Mital</dc:creator> <pubDate>Thu, 23 May 2013 02:10:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:22 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:22</guid> <description> <p> I have checked out the latest code .. but I am not able to compile the trunk at revision 84441 </p> <p> ... falied darwin.compile.c++ bin.v2/lib/log/build/darwin-4.2.1/release/build-no/link-static/log-api-unix/threading-multi/filter_parser.o </p> <p> It may not be related to the fixes u commited but I am not sure how can I verify the changes commited. </p> </description> <category>Ticket</category> </item> <item> <author>Richard Eakin <reakinator@…></author> <pubDate>Fri, 24 May 2013 01:11:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:23 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:23</guid> <description> <p> How are you attempting to build? I agree it is currently difficult and I hope the author of Log addresses these concerns, but nontheless this is how I build on my machine (with clang / libc++): </p> <p> add to tools/build/v2/user-config.jam: </p> <pre class="wiki">using clang : osx : xcrun clang -arch i386 -arch x86_64 -stdlib=libc++ -std=c++11 ; </pre><p> then: </p> <pre class="wiki">./boostrap.sh --with-libraries=log ./b2 -a -d+2 -q toolset=clang-osx link=static address-model=64 stage </pre> </description> <category>Ticket</category> </item> <item> <author>Richard Eakin <reakinator@…></author> <pubDate>Fri, 24 May 2013 01:12:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:24 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:24</guid> <description> <p> Or, you can skip building Log. :) The above will build Fusion, by the way, since it is a requirement. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Michael Caisse</dc:creator> <pubDate>Sat, 25 May 2013 05:51:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:25 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:25</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5010#comment:22" title="Comment 22">Mital</a>: </p> <blockquote class="citation"> <p> I have checked out the latest code .. but I am not able to compile the trunk at revision 84441 </p> <p> ... falied darwin.compile.c++ bin.v2/lib/log/build/darwin-4.2.1/release/build-no/link-static/log-api-unix/threading-multi/filter_parser.o </p> <p> It may not be related to the fixes u commited but I am not sure how can I verify the changes commited. </p> </blockquote> <p> Hi Mital - </p> <p> This ticket refers to fusion... you are having build issues with something in log it would seem. If you would like to verify the fusion changes you can build the Fusion test or something that uses Fusion (which is a header-only library). The problem reported (and in theory fixed) relates to ObjC's bad behaviour of making things like nil and Nil special (via keyword or macro... I do not know). </p> <p> Changing template parameters name Nil to Nil_ would not have broken log (o; </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Mital</dc:creator> <pubDate>Sat, 25 May 2013 06:06:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:26 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:26</guid> <description> <p> I am building the entire boost with ./b2 install </p> <p> I will try to build only fusion and test it. </p> <p> Thanks Mital </p> </description> <category>Ticket</category> </item> <item> <author>Brian.Doig@…</author> <pubDate>Tue, 28 May 2013 18:56:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:27 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:27</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5010#comment:25" title="Comment 25">mjcaisse</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5010#comment:22" title="Comment 22">Mital</a>: </p> <blockquote class="citation"> <p> I have checked out the latest code .. but I am not able to compile the trunk at revision 84441 </p> <p> ... falied darwin.compile.c++ bin.v2/lib/log/build/darwin-4.2.1/release/build-no/link-static/log-api-unix/threading-multi/filter_parser.o </p> <p> It may not be related to the fixes u commited but I am not sure how can I verify the changes commited. </p> </blockquote> <p> Hi Mital - </p> <p> This ticket refers to fusion... you are having build issues with something in log it would seem. If you would like to verify the fusion changes you can build the Fusion test or something that uses Fusion (which is a header-only library). The problem reported (and in theory fixed) relates to ObjC's bad behaviour of making things like nil and Nil special (via keyword or macro... I do not know). </p> <p> Changing template parameters name Nil to Nil_ would not have broken log (o; </p> </blockquote> <p> ObjC's so called bad behavior is part of the language specification since 1981 when it first originated, it is a strict superset of C. Because it's a strict superset of C it unfortunately does not have namespaces. By extension nil and Nil are is also part of the ObjC++ language specification, and have been for years. Fusion seems to have been introduced in version 1.35.0 on March 29th 2008. The problem is that there is a name space conflict with some language keywords. </p> <p> In 2008, there was really no reason to consider ObjC++ and was thus the library was not written with ObjC++ in mind. This was a perfectly reasonable thing at the time. The rapid rise of OS X and iOS have increased the need to use boost on those platforms. Since Fusion is used in many places in boost, the fact that it won't compile due to a language keyword conflict is an issue that prevents large parts of boost being used easily on those operating systems. </p> <p> The best work around I have found is to use pure C code to interface into the code using maps of integers to objects for handles. It's such a pain, I just don't use those modules of Boost that require fusion, even though many of them are perfect for what I need to do. I just end up reinventing those parts of boost poorly. </p> <p> When I originally ran into the problem, I was using the header only libraries. All I had to do to duplicate the issue was to create an objective-c command line project in Xcode. Then I changed the main file extension to mm which instructs Xcode to use the Objective C++ compiler. I then included headers for fusion at the top of the file without changing the code. The build would fail to build because it couldn't parse the header files. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 07 Jul 2013 16:48:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:28 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:28</guid> <description> <p> It seems that the issue is solved, isn't it? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Sun, 07 Jul 2013 23:27:26 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5010#comment:29 https://svn.boost.org/trac10/ticket/5010#comment:29 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket brian.doig@… Thu, 29 Aug 2013 21:47:21 GMT <link>https://svn.boost.org/trac10/ticket/5010#comment:30 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:30</guid> <description> <p> What version is this fixed in? I just downloaded 1.54 and it's still failing to compile. </p> <p> #include &lt;boost/accumulators/accumulators.hpp&gt; </p> <p> still results in: </p> <p> In file included from <a class="missing wiki">/Users/Doig/Documents/Projects/BoostTest/BoostTest</a>/BTAppDelegate.mm:9: In file included from <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/accumulators/accumulators.hpp:12: In file included from <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/accumulators/framework/accumulator_set.hpp:23: In file included from <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/accumulators/framework/depends_on.hpp:40: In file included from <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/fusion/include/equal_to.hpp:11: In file included from <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/fusion/sequence/comparison/equal_to.hpp:11: In file included from <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/fusion/sequence/intrinsic/begin.hpp:17: In file included from <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp:10: In file included from <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp:11: <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/fusion/container/list/cons_fwd.hpp:13:5: error: declaration of anonymous struct must be a definition </p> <blockquote> <p> struct nil; <sup> </sup></p> </blockquote> <p> <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/fusion/container/list/cons_fwd.hpp:13:5: warning: declaration does not declare anything [-Wmissing-declarations] </p> <blockquote> <p> struct nil; <sup><del></del>~ </sup></p> </blockquote> <p> <a class="missing wiki">/Users/Doig/Documents/Projects</a>/boost_1_54_0/boost/fusion/container/list/cons_fwd.hpp:15:44: error: expected a type </p> <blockquote> <p> template &lt;typename Car, typename Cdr = nil&gt; </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>catskin@…</author> <pubDate>Sun, 15 Sep 2013 03:08:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:31 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:31</guid> <description> <p> Certainly not fixed. I was trying out the log library on 1.54.0, (including &lt;boost/log/expressions.hpp&gt;) and it led to this compiler error: </p> <p> namespace boost { namespace fusion { </p> <blockquote> <p> struct nil; &lt;------------------------- </p> </blockquote> <blockquote> <p> template &lt;typename Car, typename Cdr = nil&gt; struct cons; </p> </blockquote> <p> }} </p> <p> among others. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 15 Sep 2013 06:04:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:32 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:32</guid> <description> <p> patience. it will be merged in the next boost release. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 09 Oct 2013 20:57:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:33 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:33</guid> <description> <p> I downloaded and checked boost 1.55beta... the fix is not in there. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>brianmar</dc:creator> <pubDate>Thu, 09 Jan 2014 04:48:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:34 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:34</guid> <description> <p> Definitely not fixed int eh 1.55 Boost that installs with <a class="missing wiki">MacPorts</a>. Still getting an error when I try to compile boost/spirit/include/qi.hpp. Error at line 45 of make_cons.hpp, due to the "nil". </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Thu, 09 Jan 2014 07:37:41 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/5010#comment:35 https://svn.boost.org/trac10/ticket/5010#comment:35 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Alright. I reopened this. I'll verify this as soon as I can. I'll need someone to do the testing as I have no way to test it myself. brianmar, send me an email (djowel at gmail dot com) and let's fix this once and for all. </p> Ticket Joel de Guzman Fri, 10 Jan 2014 22:17:43 GMT <link>https://svn.boost.org/trac10/ticket/5010#comment:36 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:36</guid> <description> <p> Here: <a class="ext-link" href="https://github.com/boostorg/fusion"><span class="icon">​</span>https://github.com/boostorg/fusion</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 14 Jan 2014 23:19:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:37 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:37</guid> <description> <p> I've tested the changes by pulling down all of <a class="ext-link" href="https://github.com/boostorg/boost"><span class="icon">​</span>https://github.com/boostorg/boost</a> and running the command lines to create the header files. After that the code compiled fusion, msm and accumulators when I included their header files. The sample code I pulled from the examples all seemed to work as well. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Tue, 14 Jan 2014 23:37:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:38 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:38</guid> <description> <p> Great. It's just a matter of merging to 'master' then. It might have been a bad merge. Better yet, if you could send a test cpp file that simulates this by defining some nasty symbols like nil, etc., then it can be part of the regression test. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Wed, 09 Apr 2014 01:48:55 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5010#comment:39 https://svn.boost.org/trac10/ticket/5010#comment:39 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket anonymous Tue, 06 May 2014 03:23:05 GMT <link>https://svn.boost.org/trac10/ticket/5010#comment:40 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:40</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5010#comment:34" title="Comment 34">brianmar</a>: </p> <blockquote class="citation"> <p> Definitely not fixed int eh 1.55 Boost that installs with <a class="missing wiki">MacPorts</a>. Still getting an error when I try to compile boost/spirit/include/qi.hpp. Error at line 45 of make_cons.hpp, due to the "nil". </p> </blockquote> <p> I've noticed this too. It's not a fusion problem but a spirit problem. You need to replace the "nil" with "nil_" in boost/spirit/home/support/detail/make_cons.hpp, boost/spirit/home/support/context.hpp, boost/spirit/home/support/make_component.hpp and boost/spirit/home/support/info.hpp. The first three refer to fusion::nil (which needs to be changed to match fusion) and the latter is spirit's own definition which should be changed for similar reasons. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Tue, 06 May 2014 03:58:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5010#comment:41 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5010#comment:41</guid> <description> <p> Please prepare a pull request here: <a class="ext-link" href="https://github.com/boostorg/spirit"><span class="icon">​</span>https://github.com/boostorg/spirit</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>