Skip to content

Commit

Permalink
Merge pull request #39 from vortechs2000/issue-301
Browse files Browse the repository at this point in the history
Fix builds on HP-UX 11iv3 when using either gcc or aCC
  • Loading branch information
hintjens committed Feb 16, 2012
2 parents 9bea035 + 2b148ac commit 8123b18
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions configure.in
Expand Up @@ -187,6 +187,8 @@ case "${host_os}" in
AS_IF([test "x$with_dce" != xno],
[AC_CHECK_LIB(dcekt, uuid_create)],
[AC_CHECK_LIB(crypto, RAND_bytes)])
LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Ae])
AC_CHECK_FUNCS(gethrtime)
;;
*mingw32*)
AC_DEFINE(ZMQ_HAVE_WINDOWS, 1, [Have Windows OS])
Expand Down
8 changes: 6 additions & 2 deletions src/clock.cpp
Expand Up @@ -34,7 +34,7 @@
#include <sys/time.h>
#endif

#if defined HAVE_CLOCK_GETTIME
#if defined HAVE_CLOCK_GETTIME || defined HAVE_GETHRTIME
#include <time.h>
#endif

Expand Down Expand Up @@ -65,14 +65,18 @@ uint64_t zmq::clock_t::now_us ()
double ticks_div = (double) (ticksPerSecond.QuadPart / 1000000);
return (uint64_t) (tick.QuadPart / ticks_div);

#elif defined HAVE_CLOCK_GETTIME
#elif defined HAVE_CLOCK_GETTIME && defined CLOCK_MONOTONIC

// Use POSIX clock_gettime function to get precise monotonic time.
struct timespec tv;
int rc = clock_gettime (CLOCK_MONOTONIC, &tv);
errno_assert (rc == 0);
return (tv.tv_sec * (uint64_t) 1000000 + tv.tv_nsec / 1000);

#elif defined HAVE_GETHRTIME

return (gethrtime () / 1000);

#else

// Use POSIX gettimeofday function to get precise time.
Expand Down
4 changes: 2 additions & 2 deletions src/command.hpp
Expand Up @@ -72,7 +72,7 @@ namespace zmq
// session that the connection have failed.
struct {
struct i_engine *engine;
unsigned char peer_identity_size;
size_t peer_identity_size;
unsigned char *peer_identity;
} attach;

Expand All @@ -81,7 +81,7 @@ namespace zmq
struct {
class reader_t *in_pipe;
class writer_t *out_pipe;
unsigned char peer_identity_size;
size_t peer_identity_size;
unsigned char *peer_identity;
} bind;

Expand Down

0 comments on commit 8123b18

Please sign in to comment.