On 1 March 2013 23:55, Dmitrijs Ledkovs <x...@debian.org> wrote: > On 1 March 2013 14:17, Daniel Hartwig <mand...@gmail.com> wrote: >> On 1 March 2013 21:14, Dmitrijs Ledkovs <x...@debian.org> wrote: >>> In Ubuntu, instead of applying the full patch against 1.49, we went >>> for a minimalistic hack/patch to workaround TIME_UTC in eglibc-2.16. >>> Simply undef TIME_UTC if defined. >> >> Is that expected to work for a program that uses both libboost-thread >> and C11 date and time? > > yes, as both have always evaluated to the same constant value on linux.
On glibc, rather. An unsafe assumption, given that C11 does not define the value any more than a non-zero, positive integer. Boost does not even specify that much. These are different APIs, it is not precise to overload a single macro. The boost macro exists in a distinct namespace and the Ubuntu patch does not appear to have the feature you claim. From the attached test case: $ g++ -o test -lboost_thread test.cc test.cc: In function ‘int main(int, const char**)’: test.cc:8:11: error: ‘TIME_UTC’ was not declared in this scope int x = TIME_UTC; ^ -- Further, #undef is placed outside of the BOOST_XTIME_WEK070601_HPP header guard; a second include of this header would undefine and not subsequently redefine the macro. Regards
test.cc
Description: Binary data