Open Dynamics Engine
odeou.h
1 /*************************************************************************
2 * *
3 * OU library interface file for Open Dynamics Engine, *
4 * Copyright (C) 2008 Oleh Derevenko. All rights reserved. *
5 * Email: odar@eleks.com (change all "a" to "e") *
6 * *
7 * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
8 * All rights reserved. Email: russ@q12.org Web: www.q12.org *
9 * *
10 * *
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of EITHER: *
13 * (1) The GNU Lesser General Public License as published by the Free *
14 * Software Foundation; either version 2.1 of the License, or (at *
15 * your option) any later version. The text of the GNU Lesser *
16 * General Public License is included with this library in the *
17 * file LICENSE.TXT. *
18 * (2) The BSD-style license that is included with this library in *
19 * the file LICENSE-BSD.TXT. *
20 * *
21 * This library is distributed in the hope that it will be useful, *
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
24 * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
25 * *
26 *************************************************************************/
27 
28 /*
29 
30 ODE interface to OU library functions.
31 
32 */
33 
34 
35 #ifndef _ODE_ODEOU_H_
36 #define _ODE_ODEOU_H_
37 
38 
39 #if dOU_ENABLED
40 
41 #include <ou/assert.h>
42 #include <ou/enumarrays.h>
43 #include <ou/macros.h>
44 #include <ou/templates.h>
45 #include <ou/typewrapper.h>
46 #include <ou/simpleflags.h>
47 #include <ou/customization.h>
48 
49 #if dATOMICS_ENABLED
50 #include <ou/atomic.h>
51 #include <ou/atomicflags.h>
52 #endif
53 
54 #if dTLS_ENABLED
55 #include <ou/threadlocalstorage.h>
56 #endif
57 
58 
59 using _OU_NAMESPACE::CEnumUnsortedElementArray;
60 
61 #if dATOMICS_ENABLED
62 using _OU_NAMESPACE::atomicord32;
63 using _OU_NAMESPACE::atomicptr;
64 using _OU_NAMESPACE::InitializeAtomicAPI;
65 using _OU_NAMESPACE::FinalizeAtomicAPI;
66 using _OU_NAMESPACE::AtomicCompareExchange;
67 using _OU_NAMESPACE::AtomicExchange;
68 using _OU_NAMESPACE::AtomicCompareExchangePointer;
69 using _OU_NAMESPACE::AtomicExchangePointer;
70 #endif
71 
72 
73 class COdeOu
74 {
75 public:
76  static bool DoOUCustomizations();
77  static void UndoOUCustomizations();
78 
79 #if dATOMICS_ENABLED
80  static bool InitializeAtomics() { return InitializeAtomicAPI(); }
81  static void FinalizeAtomics() { FinalizeAtomicAPI(); }
82 #endif
83 };
84 
85 
86 #else // !dOU_ENABLED
87 
88 typedef unsigned int atomicord32;
89 typedef size_t atomicptr;
90 
91 
92 #endif // dOU_ENABLED
93 
94 
95 
96 #endif // _ODE_ODEOU_H_