Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / ETL / tags / ETL_0_04_08 / ETL / ETL / clock
1 /*! ========================================================================
2 ** Extended Template and Library
3 ** Clock Abstraction
4 ** $Id: clock,v 1.1.1.1 2005/01/04 01:31:46 darco Exp $
5 **
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
7 **
8 ** This package is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License as
10 ** published by the Free Software Foundation; either version 2 of
11 ** the License, or (at your option) any later version.
12 **
13 ** This package is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 ** General Public License for more details.
17 **
18 ** === N O T E S ===========================================================
19 **
20 ** ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __CLOCK__
25 #define __CLOCK__
26
27 /* === H E A D E R S ======================================================= */
28
29 #include "etl_config.h"
30
31 #ifdef HAVE_GETTIMEOFDAY
32 #include "_clock_gettimeofday.h"
33 #ifndef ETL_CLOCK_DEFAULT_DESC_CLASS
34 #define ETL_CLOCK_DEFAULT_DESC_CLASS    _ETL::clock_desc_gettimeofday
35 #endif
36 #ifndef ETL_CLOCK_REALTIME_DESC_CLASS
37 #define ETL_CLOCK_REALTIME_DESC_CLASS   _ETL::clock_desc_gettimeofday
38 #endif
39 #endif
40
41 #ifdef _WIN32
42 #include "_clock_win32hpcount.h"
43 #ifndef ETL_CLOCK_DEFAULT_DESC_CLASS
44 #define ETL_CLOCK_DEFAULT_DESC_CLASS    _ETL::clock_desc_win32hpcount
45 #endif
46 #ifndef ETL_CLOCK_REALTIME_DESC_CLASS
47 #define ETL_CLOCK_REALTIME_DESC_CLASS   _ETL::clock_desc_win32hpcount
48 #endif
49 #endif
50
51 // If we could not find outselves a better
52 // clock description, go ahead and use the
53 // standard clock() implementation. 
54 // (Better than nothing...)
55 #include "_clock_system.h"
56 #ifndef ETL_CLOCK_DEFAULT_DESC_CLASS
57 #define ETL_CLOCK_DEFAULT_DESC_CLASS    _ETL::clock_desc_sys_clock
58 #endif
59 #ifndef ETL_CLOCK_PROCTIME_DESC_CLASS
60 #define ETL_CLOCK_PROCTIME_DESC_CLASS   _ETL::clock_desc_sys_clock
61 #endif
62 #ifndef ETL_CLOCK_REALTIME_DESC_CLASS
63 #define ETL_CLOCK_REALTIME_DESC_CLASS   _ETL::clock_desc_sys_time
64 #endif
65
66 #include "_clock_base.h"
67
68 _ETL_BEGIN_NAMESPACE
69
70 #if 0
71         typedef _ETL::clock_base<ETL_CLOCK_DEFAULT_DESC_CLASS> clock;
72         #ifdef ETL_CLOCK_PROCTIME_DESC_CLASS
73                 #define ETL_CLOCK_PROCTIME
74                 typedef clock_base<ETL_CLOCK_PROCTIME_DESC_CLASS> clock_proctime;
75         #endif
76         #ifdef ETL_CLOCK_REALTIME_DESC_CLASS
77                 #define ETL_CLOCK_REALTIME
78                 typedef clock_base<ETL_CLOCK_REALTIME_DESC_CLASS> clock_realtime;
79         #else
80                 #warning No realtime clock description found.
81         #endif
82         
83 #else
84         class clock : public _ETL::clock_base<ETL_CLOCK_DEFAULT_DESC_CLASS> { };
85         #ifdef ETL_CLOCK_PROCTIME_DESC_CLASS
86                 #define ETL_CLOCK_PROCTIME
87                 class clock_proctime : public _ETL::clock_base<ETL_CLOCK_PROCTIME_DESC_CLASS> { };
88         #endif
89         #ifdef ETL_CLOCK_REALTIME_DESC_CLASS
90                 #define ETL_CLOCK_REALTIME
91                 class clock_realtime : public _ETL::clock_base<ETL_CLOCK_REALTIME_DESC_CLASS> { };
92         #else
93                 #warning No realtime clock description found.
94         #endif
95 #endif
96
97 _ETL_END_NAMESPACE
98
99 //using etl::clock;
100
101 /* === E N D =============================================================== */
102
103 #endif