Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6340

TIME_UTC is a macro in C11, compilation of lines, containing boost::TIME_UTC will fail with glibc 2.16

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.0-rc0
    • Affects Version/s: 2.1.2
    • Component/s: Internal Client
    • Environment:
      latest glibc (2.16) gcc 4.7.1
    • ALL

      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

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            san Alex Syrnikov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: