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