blob: 891117407da6b41d3e7870a63fa2596325dea88c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
Use gettimeofday(), ftime(), or time(), as available.
diff -ur dvisvgm-0.8.7.orig/configure.ac dvisvgm-0.8.7/configure.ac
--- dvisvgm-0.8.7.orig/configure.ac 2009-11-09 18:17:17.000000000 +0100
+++ dvisvgm-0.8.7/configure.ac 2009-12-14 14:23:12.000000000 +0100
@@ -22,6 +22,9 @@
AC_PROG_RANLIB
AC_LANG(C)
+AC_CHECK_FUNCS([ftime gettimeofday])
+AC_CHECK_HEADERS([sys/time.h sys/timeb.h])
+
# Check whether MikTeX import libraries should be linked
case $host in
*-mingw32* | *-windows*)
diff -ur dvisvgm-0.8.7.orig/src/dvisvgm.cpp dvisvgm-0.8.7/src/dvisvgm.cpp
--- dvisvgm-0.8.7.orig/src/dvisvgm.cpp 2009-11-13 14:49:31.000000000 +0100
+++ dvisvgm-0.8.7/src/dvisvgm.cpp 2009-12-14 14:37:35.000000000 +0100
@@ -23,7 +23,6 @@
#include <iostream>
#include <sstream>
#include <string>
-#include <sys/timeb.h>
#include <time.h>
#include "gzstream.h"
#include "CommandLine.h"
@@ -46,6 +45,12 @@
#define EMAIL "Martin Gieseking <martin.gieseking@uos.de>"
#endif
+#if defined (HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#elif defined (HAVE_SYS_TIMEB_H)
+#include <sys/timeb.h>
+#endif
+
using namespace std;
@@ -106,9 +111,18 @@
/** Returns timestamp (wall time) in seconds. */
static double get_time () {
+#if defined (HAVE_SYS_TIME_H)
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec + tv.tv_usec/1000000.0;
+#elif defined (HAVE_SYS_TIMEB_H)
struct timeb tb;
ftime(&tb);
return tb.time + tb.millitm/1000.0;
+#else
+ time_t myclock = time((time_t*)NULL);
+ return myclock;
+#endif
}
|