Mat Marcus | 13 Oct 20:08

Re: Ticket #2115 Avoid bad Apple macros

On Mon, Oct 13, 2008 at 1:40 AM, John Maddock <john <at> johnmaddock.co.uk> wrote:
> Mat Marcus wrote:
>>>
>>> On Sun, Oct 12, 2008 at 1:54 PM, Beman Dawes <bdawes <at> acm.org> wrote:
>>>>
>>>> On Sun, Oct 12, 2008 at 2:30 PM, Mat Marcus <mat-lists <at> emarcus.org>
>>>> wrote: ...
>>>>
>>>>> So, please put pressure on Apple, and file the necessary bug
>>>>> reports. But each requirement that a library imposes loses a group
>>>>> of users. But please also consider "fixing" boost too.
>>>>
>>>>
>>>> I still haven't seen a concrete proposal as to exactly what a fix
>>>> would be.
>>>
>>> Sadly, I don't know of a better fix than the one you mentioned at the
>>> beginning of this thread--namely, that boost avoid using the names
>>> that vendors steal with macros in commonly included headers. I didn't
>>> like having to rename functions named check() in our code, but my
>>> users like it even less when things didn't work for them. (This was
>>> some time ago...I didn't look at the original bug report, and I don't
>>> know how many Apple headers still pull the offending header in
>>> indirectly).
>
> Are the Apple defined macros function-like macros?  If so we could use the
> usual macro-expansion suppression in these cases as we do with min/max.
>
> John.

Yes, at least check is function-like:

  #define check(assertion)                                                   \
      do                                                                      \
      {                                                                       \
          if ( __builtin_expect(!(assertion), 0) )                            \
          {                                                                   \
              DEBUG_ASSERT_MESSAGE(                                           \
                  DEBUG_ASSERT_COMPONENT_NAME_STRING,                         \
                  #assertion,                                                 \
                  0,                                                          \
                  0,                                                          \
                  __FILE__,                                                   \
                  __LINE__,                                                   \
                  0);                                                         \
          }                                                                   \
      } while ( 0 )
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Gmane