Corrected demo mstpcap when building with Borland compiler. Thank you Martin!

This commit is contained in:
skarg
2009-05-27 20:25:11 +00:00
parent a060c88896
commit 2bf1e66ace
+13
View File
@@ -48,6 +48,15 @@
#include "mstp.h"
#include "mstptext.h"
#if defined(_WIN32)
#include <process.h> /* _beginthread */
#endif
#if defined(__BORLANDC__)
#include <sys/timeb.h>
#define _timeb timeb
#define _ftime(param) ftime(param)
#endif
#ifndef max
#define max(a,b) (((a) (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
@@ -73,6 +82,8 @@ static int gettimeofday(
{
struct _timeb timebuffer;
(void) tzp;
_ftime(&timebuffer);
tp->tv_sec = timebuffer.time;
tp->tv_usec = timebuffer.millitm * 1000;
@@ -113,6 +124,8 @@ void Sleep(
void *milliseconds_task(
void *pArg)
{
(void) pArg;
for (;;) {
Sleep(1);
dlmstp_millisecond_timer();