boost::timer deprecation and compile failure

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
raptor
Space Squid
Posts: 87
Joined: Sat Jun 02, 2012 11:29 pm

boost::timer deprecation and compile failure

#1 Post by raptor »

Hi,

I've been attempting to build the 0.4.9 RC3 with openSUSE Tumbleweed and the deprecation warnings for boost::timer are finally showing up as compile errors. I did a code search and found the locations of the usage:

Code: Select all

./python/AI/AIFramework.cpp:142:    boost::timer order_timer;
./UI/TechTreeWnd.cpp:1845:    boost::timer insertion_timer;
./UI/TechTreeWnd.cpp:1903:    boost::timer creation_timer;
./universe/Universe.cpp:1213:    boost::timer type_timer;
./universe/Universe.cpp:1214:    boost::timer eval_timer;
./network/Message.cpp:824:                boost::timer deserialize_timer;
./network/Message.cpp:869:            boost::timer deserialize_timer;
Can these be replaced?

This distro is using Boost 1.71. Additionally, there are many places that include `boost/timer.hpp` which should be `boost/timer/timer.hpp` instead. I've started a patch (attached), but I am unsure of how to actually do the timer replacement in the code.
freeorion-boost_timer_header.patch.zip
(1.26 KiB) Downloaded 97 times

raptor
Space Squid
Posts: 87
Joined: Sat Jun 02, 2012 11:29 pm

Re: boost::timer deprecation and compile failure

#2 Post by raptor »

I just found out I can compile with 'BOOST_ALLOW_DEPRECATED_HEADERS'. I'll attempt that for now.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: boost::timer deprecation and compile failure

#3 Post by Geoff the Medio »

I looked at this earlier this morning. The replacement for boost::timer isn't drop-in and makes it surprisingly hard to just get an elapsed time in seconds. It should be fixable with cpu_timer but not trivially.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: boost::timer deprecation and compile failure

#4 Post by Geoff the Medio »


raptor
Space Squid
Posts: 87
Joined: Sat Jun 02, 2012 11:29 pm

Re: boost::timer deprecation and compile failure

#5 Post by raptor »

Thanks!

Will this be included in the python3 release?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: boost::timer deprecation and compile failure

#6 Post by Geoff the Medio »

It's already in master, so yes, unless something weird happens.

Post Reply