updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / dbxml / os_clock.patch
blob3ee08a3777931aa19534df8def4631d274e61d3e
1 --- dbxml-2.3.10/dbxml/src/common/Timer.orig.cpp 2006-10-30 18:45:50.000000000 +0100
2 +++ dbxml-2.3.10/dbxml/src/common/Timer.cpp 2007-11-16 09:15:50.704474206 +0100
3 @@ -11,9 +11,20 @@
4 #include <iostream>
5 #include <sstream>
7 -// use __os_clock from Berkeley DB internals
9 -extern "C" int __os_clock(DB_ENV *, u_int32_t *, u_int32_t *);
10 +// ad-hoc fix from http://forums.oracle.com/forums/thread.jspa?threadID=543913&tstart=0
11 +typedef struct {
12 + time_t tv_sec;
13 + long tv_nsec;
14 +} db_timespec;
15 +extern "C" int __os_gettime(DB_ENV*, db_timespec*);
17 +void __os_clock(DB_ENV *dbenv, u_int32_t *secsp, u_int32_t *usecsp)
19 + db_timespec ts;
20 + __os_gettime(NULL, &ts);
21 + *secsp = (u_int32_t)ts.tv_sec;
22 + *usecsp = ts.tv_nsec/1000;
25 using namespace DbXml;
27 --- dbxml-2.3.10/dbxml/src/dbxml/HighResTimer.orig.cpp 2006-10-30 18:45:52.000000000 +0100
28 +++ dbxml-2.3.10/dbxml/src/dbxml/HighResTimer.cpp 2007-11-16 09:15:53.231136095 +0100
29 @@ -14,7 +14,23 @@
30 #include <iostream>
31 #include <sstream>
33 -extern "C" int __os_clock(DB_ENV *, u_int32_t *, u_int32_t *);
34 +// extern "C" int __os_clock(DB_ENV *, u_int32_t *, u_int32_t *);
35 +// ad-hoc fix from http://forums.oracle.com/forums/thread.jspa?threadID=543913&tstart=0
36 +typedef struct {
37 + time_t tv_sec;
38 + long tv_nsec;
39 +} db_timespec;
40 +extern "C" int __os_gettime(DB_ENV*, db_timespec*);
42 +void __os_clock(DB_ENV *dbenv, u_int32_t *secsp, u_int32_t *usecsp)
44 + db_timespec ts;
45 + __os_gettime(NULL, &ts);
46 + *secsp = (u_int32_t)ts.tv_sec;
47 + *usecsp = ts.tv_nsec/1000;
52 using namespace DbXml;
54 --- dbxml-2.3.10/dbxml/src/dbxml/QueryContext.orig.cpp 2007-01-12 19:05:49.000000000 +0100
55 +++ dbxml-2.3.10/dbxml/src/dbxml/QueryContext.cpp 2007-11-16 09:14:17.449498997 +0100
56 @@ -48,8 +48,8 @@
57 using namespace DbXml;
58 using namespace std;
60 -// From DB, used by QueryInterrupt code
61 -extern "C" int __os_clock(DB_ENV *, u_int32_t *, u_int32_t *);
62 +// implemented in HighResTimer.cpp
63 +extern int __os_clock(DB_ENV *, u_int32_t *, u_int32_t *);
65 namespace DbXml {
66 /**