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: | 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 , 10 years ago
comment:2 by , 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 , 10 years ago
Milestone: | To Be Determined → Boost 1.54.0 |
---|
comment:4 by , 10 years ago
Status: | new → assigned |
---|
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Of course didn't mean for the code to fail on all HP-UXes. :) This is the actual hack code: