[SERVER-6340] TIME_UTC is a macro in C11, compilation of lines, containing boost::TIME_UTC will fail with glibc 2.16 Created: 06/Jul/12  Updated: 11/Jul/16  Resolved: 10/Jul/12

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 2.1.2
Fix Version/s: 2.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Alex Syrnikov Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

latest glibc (2.16) gcc 4.7.1


Issue Links:
Related
related to CXX-86 C++ driver can't compile with glibc 2.16 Closed
related to SERVER-6449 TIME_UTC_ does not compile in C++ driver Closed
Operating System: ALL
Participants:

 Description   

TIME_UTC is a macro in C11, compilation of lines, containing boost::TIME_UTC will fail with glibc 2.16
boost now (version 1.50, may be 1.49) use TIME_UTC_ with underscore at the end.
Compilation using c++ driver will fail with glibc 2.16 becouse c++ preprocessor will replace TIME_UTC with number (1 in my case) and boost::1 will couse error in lines like boost::xtime_get(&xt, boost::TIME_UTC);

Just try to compile one line file
#include <client/dbclient.h>
and compilation fails if glibc version 2.16.
in case boost 1.50 "boost::TIME_UTC" will be not found (it's renamed to "boost::TIME_UTC_")

boost ticket for "TIME_UTC is a macro in C11" error:
https://svn.boost.org/trac/boost/ticket/6940

So there is two errors
1. TIME_UTC is macro in glibc 2.16
2. boost::TIME_UTC renamed to boost::TIME_UTC_ in boost 1.50



 Comments   
Comment by auto [ 10/Jul/12 ]

Author:

{u'date': u'2012-07-09T15:11:54-07:00', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-6340 Use TIME_UTC_ rather than TIME_UTC

This avoids a compilation failure with glibc-2.16 or any other C11 libc.
Boost made the same change for boost-1.50:
https://svn.boost.org/trac/boost/ticket/6940
Branch: master
https://github.com/mongodb/mongo/commit/b113287f27810722b09fee13d66d4ca307872d96

Generated at Thu Feb 08 03:11:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.