[llvm-commits] CVS: llvm-test/MultiSource/Applications/JM/ldecod/image.c
Jeff Cohen
jeffc at jolt-lang.org
Wed Mar 28 23:21:24 PDT 2007
Changes in directory llvm-test/MultiSource/Applications/JM/ldecod:
image.c updated: 1.4 -> 1.5
---
Log message:
Fix for BSD systems (JIT still fails though).
---
Diffs of the changes: (+21 -2)
image.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
Index: llvm-test/MultiSource/Applications/JM/ldecod/image.c
diff -u llvm-test/MultiSource/Applications/JM/ldecod/image.c:1.4 llvm-test/MultiSource/Applications/JM/ldecod/image.c:1.5
--- llvm-test/MultiSource/Applications/JM/ldecod/image.c:1.4 Thu Feb 8 16:38:32 2007
+++ llvm-test/MultiSource/Applications/JM/ldecod/image.c Thu Mar 29 01:21:07 2007
@@ -63,6 +63,10 @@
#include "vlc.h"
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#include <sys/time.h>
+#endif
+
#include "erc_api.h"
extern objectBuffer_t *erc_object_list;
extern ercVariables_t *erc_errorVar;
@@ -82,6 +86,21 @@
OldSliceParams old_slice;
+void ftime_hack(struct timeb *tp)
+{
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+ struct timeval tv;
+ struct timezone tz;
+ gettimeofday(&tv, &tz);
+ tp->time = tv.tv_sec;
+ tp->millitm = tv.tv_usec / 1000;
+ tp->timezone = tz.tz_minuteswest;
+ tp->dstflag = tz.tz_dsttime;
+#else
+ ftime(tp);
+#endif
+}
+
void MbAffPostProc()
{
imgpel temp[16][32];
@@ -1289,7 +1308,7 @@
#ifdef WIN32
_ftime (&(img->tstruct_start)); // start time ms
#else
- ftime (&(img->tstruct_start)); // start time ms
+ ftime_hack (&(img->tstruct_start)); // start time ms
#endif
time( &(img->ltime_start)); // start time s
}
@@ -1513,7 +1532,7 @@
#ifdef WIN32
_ftime (&(img->tstruct_end)); // start time ms
#else
- ftime (&(img->tstruct_end)); // start time ms
+ ftime_hack (&(img->tstruct_end)); // start time ms
#endif
time( &(img->ltime_end)); // start time s
More information about the llvm-commits
mailing list