Opened 12 years ago

Closed 12 years ago

#4341 closed Bugs (fixed)

get_thread_info error

Reported by: tonestone57@… Owned by: Anthony Williams
Milestone: Boost 1.44.0 Component: threads
Version: Boost 1.38.0 Severity: Problem
Keywords: get_thread_info Cc:

Description

Compiling on Haiku with gcc 4.3.3 gives two errors with code below:

From file: http://www.boost.org/doc/libs/1_38_0/boost/thread/detail/thread.hpp

detail::thread_data_ptr get_thread_info() const;

1) include/boost/thread/detail/thread.hpp:120: error: expected ';' before 'const'

2) include/boost/thread/detail/thread.hpp:120:49: error: macro "get_thread_info" requires 2 arguments, but only 1 given

Haiku defines get_thread_info like this: http://haiku.it.su.se:8180/source/xref/headers/os/kernel/OS.h#348

Change History (4)

comment:1 by tonestone57@…, 12 years ago

That should say, compiling a program, requiring libboost_thread, on Haiku results in that error. Compiling boost thread library (libboost_thread) works.

comment:2 by Marshall Clow, 12 years ago

I've looked at the references, and Haiku defines a macro named "get_thread_info". Boost.Thread has a private member function named "get_thread_info" (and yes, it appears in 1.43.0 too)

Needless to say, these two don't play well together.

comment:3 by tonestone57@…, 12 years ago

Ok, thanks Marshall. I understand now what is going on.

I commented out the macro in OS.h and was able to compile the program. It started up but crashed because of Qt error. At least not a boost error anymore. ;-)

Hopefully boost guys will rename their get_thread_info to avoid any conflict with Haiku's macro. Maybe add boost or BST in front or behind to make it dfferent? Bye,

comment:4 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

I added some macro protection in [63295].

Marshall, do you think we should modify the inspect tool to have a single list of evil macros to check for? We already have special cases for Microsoft's evilness and Apple's evilness.

Note: See TracTickets for help on using tickets.