cannot build on Solaris 10, timersub() undef #9

Closed
drook opened this Issue Jul 26, 2013 · 2 comments

Projects

None yet

2 participants

@drook
drook commented Jul 26, 2013

timersub() macro doesn't exist on Solaris 10.
in order to build pinba on Solaris 10 the following code needs to be added (I add it to pinba.c):

#ifndef timersub
# define timersub(a, b, result)                     \
    do {                                \
        (result)->tv_sec = (a)->tv_sec - (b)->tv_sec;       \
        (result)->tv_usec = (a)->tv_usec - (b)->tv_usec;        \
        if ((result)->tv_usec < 0) {                            \
            --(result)->tv_sec;             \
            (result)->tv_usec += 1000000;           \
        }                                                       \
    } while (0)
#endif

After this everything works like a charm.
Thanks for great piece of software.

@drook
drook commented Jul 26, 2013

Yeah, I stole this patch from here: http://mail.gnu.org.ua/mailman/listarchive/bug-mailfromd/2011-03/msg00004.html (I think it's GPL'd).

@tony2001
Owner

Commited the patch, thanks!

@tony2001 tony2001 closed this Jul 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment