Opened 10 years ago

Closed 10 years ago

#8435 closed Bugs (fixed)

Can't compile Chrono on HP-UX due to no CLOCK_REALTIME macro.

Reported by: konrad.zemek@… Owned by: viboes
Milestone: Boost 1.54.0 Component: chrono
Version: Boost 1.53.0 Severity: Showstopper
Keywords: chrono, hp-ux, hpux, clock_realtime, time.h Cc:

Description

We're trying to compile Chrono library on HP-UX 11i23, to be used with conjunction with threads. The compilation fails with

#error <time.h> does not supply CLOCK_REALTIME

This is due to the following code in system_clocks.hpp:

# if defined( BOOST_CHRONO_POSIX_API )
#   if ! defined(CLOCK_REALTIME)
#     error <time.h> does not supply CLOCK_REALTIME
#   endif
# endif

HP-UX provides CLOCK_REALTIME, although as an enum, not a macro, so the ifdef fails. This is true for version 11i23 and I suspect that also for other HP-UX versions (I cannot confirm this though, and it's hard to get any information on HP-UX through googling).

I'm not sure what solution would be right here, but simple ifdef does not cut it. I sidestepped this issue by modyfying it to

#   if ! defined(CLOCK_REALTIME) || defined(__hpux)

but it's more of a hack than a solution, especially since I'm not certain that every version of HP-UX supply CLOCK_REALTIME.

Change History (5)

comment:1 by anonymous, 10 years ago

Of course didn't mean for the code to fail on all HP-UXes. :) This is the actual hack code:

#   if ! defined(CLOCK_REALTIME) && ! defined(__hpux)

comment:2 by konrad.zemek@…, 10 years ago

Summary: Can't compile Chrono on HP-UX due no CLOCK_REALTIME macro.Can't compile Chrono on HP-UX due to no CLOCK_REALTIME macro.

comment:3 by viboes, 10 years ago

Milestone: To Be DeterminedBoost 1.54.0

Committed revision [83896][83899].

Last edited 10 years ago by viboes (previous) (diff)

comment:4 by viboes, 10 years ago

Status: newassigned

comment:5 by viboes, 10 years ago

Resolution: fixed
Status: assignedclosed

(In [83905]) Chrono: merge to fix #8435.

Note: See TracTickets for help on using tickets.