Skip to content

Commit

Permalink
fix one boost 1.50 compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
abma committed Jul 10, 2012
1 parent 85d367d commit 1d57e16
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rts/lib/headlessStubs/sdlstub_cppbit.cpp
Expand Up @@ -12,18 +12,24 @@
extern "C" {
#endif

#if (BOOST_VERSION >= 105000) //boost 1.50 renamed TIME_UTC to TIME_UTC_
#define SPRING_UTCTIME boost::TIME_UTC_
#else
#define SPRING_UTCTIME boost::TIME_UTC
#endif

int stub_sdl_getSystemMilliSeconds() {

boost::xtime t;
boost::xtime_get(&t, boost::TIME_UTC);
boost::xtime_get(&t, SPRING_UTCTIME);
const int milliSeconds = t.sec * 1000 + (t.nsec / 1000000);
return milliSeconds;
}

void stub_sdl_sleepMilliSeconds(int milliSeconds) {

boost::xtime t;
boost::xtime_get(&t, boost::TIME_UTC);
boost::xtime_get(&t, SPRING_UTCTIME);
t.nsec += 1000000 * milliSeconds;
boost::thread::sleep(t);
}
Expand Down

7 comments on commit 1d57e16

@svenstaro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about as far as I got too. I just can't figure out the steflop redefinition stuff that follows. Can you try to fix that quickly? spring is currently blocking the arch linux boost 1.50 rebuild.

@abma
Copy link
Contributor Author

@abma abma commented on 1d57e16 Jul 12, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other errors are mostly because of the usage of streflop i guess. and i'm not sure if that can be fixed easily. its a bit weird that boosts thread uses floating point for hash...

@svenstaro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly I need a really quick and dirty fix for this for packaging at least because spring might be dropped from Arch if is blocking for too long.

@svenstaro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a hacky patch that will work for me: http://pastie.org/4244897

@abma
Copy link
Contributor Author

@abma abma commented on 1d57e16 Jul 12, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this patch afaik will make it desync against "normal" versions and maybe other processors, not sure...

@tvo
Copy link
Member

@tvo tvo commented on 1d57e16 Jul 13, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That patch might work in practice though, ldexp and frexp aren't used often (if at all).

@svenstaro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, your patch will work alright, though.

Please sign in to comment.