This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
TIME_UTC definition conflicts with boost-library's header
- From: Atsushi WATANABE <atusi_w at roboken dot esys dot tsukuba dot ac dot jp>
- To: libc-help at sourceware dot org
- Date: Fri, 25 May 2012 21:32:39 +0900
- Subject: TIME_UTC definition conflicts with boost-library's header
Hi,
I'm using glibc development source from git repository.
I have a problem around ISO C11 definitions in time.h (added in commit
7a270350a9bc3110cd5ba12bbd8c5c8c365e0032) when I use boost-thread library.
In glibc/time/time.h, TIME_UTC is defined as:
# ifdef __USE_ISOC11
/* Time base values for timespec_get. */
# define TIME_UTC 1
# endif
And in boost/thread/xtime.hpp, TIME_UTC is defined as:
namespace boost {
enum xtime_clock_types
{
TIME_UTC=1
...
So these definitions conflict in compiling user source.
One of the way to avoid this is define TIME_UTC by "enum{TIME_UTC=1}" in
time.h. In this case, each definitions belongs to another namespace in
the view of c++ compiler.
I'm not sure it is glibc issue or boost issue.
Does anyone have smart method to use latest glibc and boost with
avoiding this problem?
Thanks,
Atsushi Watanabe
# Example code which failed to be compiled by g++:
#include <boost/thread/thread.hpp>
main()
{
}