[llvm-commits] CVS: llvm-test/MultiSource/Applications/hexxagon/hexxagonmove.cpp
Jeff Cohen
jeffc at jolt-lang.org
Mon Mar 7 08:41:25 PST 2005
Changes in directory llvm-test/MultiSource/Applications/hexxagon:
hexxagonmove.cpp updated: 1.1 -> 1.2
---
Log message:
Fix compilation errors on FreeBSD.
---
Diffs of the changes: (+12 -1)
hexxagonmove.cpp | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletion(-)
Index: llvm-test/MultiSource/Applications/hexxagon/hexxagonmove.cpp
diff -u llvm-test/MultiSource/Applications/hexxagon/hexxagonmove.cpp:1.1 llvm-test/MultiSource/Applications/hexxagon/hexxagonmove.cpp:1.2
--- llvm-test/MultiSource/Applications/hexxagon/hexxagonmove.cpp:1.1 Fri Sep 10 09:25:53 2004
+++ llvm-test/MultiSource/Applications/hexxagon/hexxagonmove.cpp Mon Mar 7 10:41:13 2005
@@ -23,9 +23,13 @@
#include "hexxagonboard.h"
#include "hexxagonmove.h"
-#include <sys/timeb.h>
#include <iostream>
#include <stdlib.h>
+#ifdef __FreeBSD__
+#include <sys/time.h>
+#else
+#include <sys/timeb.h>
+#endif
#include <string.h>
using namespace std;
@@ -83,10 +87,17 @@
int getTime()
{
+#ifdef __FreeBSD__
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec * 1000 + tv.tv_usec / 1000;
+#else
struct timeb tb;
ftime(&tb);
return (tb.time * 1000) + tb.millitm;
+#endif
}
HexxagonMove *HexxagonMoveList::getMove(int i)
More information about the llvm-commits
mailing list