rtptools
rtptools copied to clipboard
timer{add,sub} for systems that don't have it
Properly test for timeradd() and timersub() in have-timer.c Provide the compatibility implementation in compat-timer.c Augment ./configure et al accordingly. Clean up some unused code while here.
Strangely, rtpsend uses the timer*()
macros but rtpplay does not: it computes by hand.
They should be united; in fact, they should both be one program.
Thanks for moving timersub/add to compat-timer. I tried build them on Win. The sysdep.h is declaring
extern void timersub(struct` timeval *, struct timeval *, struct timeval *);
extern void timeradd(struct timeval *, struct timeval *, struct timeval *);
but they are macros in compat-timer.c, and Visual Studio will stop with
1>rtpsend.obj : error LNK2019: unresolved external symbol _timersub referenced in function _send_handler
To solve this matter, I am not sure which one is better. Converting timersub() timeradd() from macro to defining as actual functions. Or let compat-timer.h to be included on rtpsend.
Ah, I forgot to remove those after I realized they are macros. It's probably easiest to just removed the offending declarations (done).
Does it build for you on win then?
Sorry for the late reply. I have tried it.
It will build if I change the filename from compat-timer.c
to compat-timer.h
and then adding #include "compat-timer.h"
at the rtpsend.c.
The timer{sub,add} are defined as macro inside the compat-timer.c and rtpsend.c
needs the timer{sub,add} at compile time.
Changing the macro to actual function will work but I am not sure what is the right way to make it build.
What would be the good method in this case?