Opened 10 years ago

Closed 10 years ago

#8204 closed Bugs (fixed)

xpressive enum clashing with glx

Reported by: benjamin.prestele@… Owned by: Eric Niebler
Milestone: To Be Determined Component: xpressive
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

On Ubuntu 12.04, some header included by GL/glx.h seems to define a macro 'None', which replaces the enum by the same name in boost/xpressive/match_results.hpp at line 122. Therefore the following simple testcase fails to compile:

#include <GL/glx.h>
#include "boost/xpressive/xpressive.hpp"

int main( int argc, char** argv )
{
  return 0;
}

Giving the following error with g++:

In file included from ../workspace/Boost_1_53_0/boost/xpressive/detail/core/access.hpp:21:0,
                 from ../workspace/Boost_1_53_0/boost/xpressive/detail/core/state.hpp:18,
                 from ../workspace/Boost_1_53_0/boost/xpressive/detail/core/matcher/alternate_end_matcher.hpp:20,
                 from ../workspace/Boost_1_53_0/boost/xpressive/detail/core/matchers.hpp:17,
                 from ../workspace/Boost_1_53_0/boost/xpressive/regex_primitives.hpp:22,
                 from ../workspace/Boost_1_53_0/boost/xpressive/xpressive_static.hpp:24,
                 from ../workspace/Boost_1_53_0/boost/xpressive/xpressive.hpp:18,
                 from test2.cpp:2:
../workspace/Boost_1_53_0/boost/xpressive/match_results.hpp:122:21: error: expected identifier before numeric constant
../workspace/Boost_1_53_0/boost/xpressive/match_results.hpp:122:21: error: expected ‘}’ before numeric constant
../workspace/Boost_1_53_0/boost/xpressive/match_results.hpp:122:21: error: expected unqualified-id before numeric constant
../workspace/Boost_1_53_0/boost/xpressive/match_results.hpp:132:57: error: ‘traits’ has not been declared
../workspace/Boost_1_53_0/boost/xpressive/match_results.hpp:132:63: error: expected ‘,’ or ‘...’ before ‘<’ token
../workspace/Boost_1_53_0/boost/xpressive/match_results.hpp:163:63: error: ‘transform_op’ has not been declared
../workspace/Boost_1_53_0/boost/xpressive/match_results.hpp:194:5: error: ‘traits’ does not name a type
../workspace/Boost_1_53_0/boost/xpressive/match_results.hpp:195:5: error: ‘transform_op’ does not name a type
- snip -

Change History (2)

comment:1 by Eric Niebler, 10 years ago

(In [83303]) avoid name clash with macro None in glx.h, refs #8204

comment:2 by Eric Niebler, 10 years ago

Resolution: fixed
Status: newclosed

(In [83389]) merge [83303] from trunk, fixes #8204

Note: See TracTickets for help on using tickets.