Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
config2.h
Go to the documentation of this file.
1 /* Copyright (c) 2012 Wildfire Games
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject to
9  * the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 /*
24  * compile-time configuration for isolated spots
25  */
26 
27 #ifndef INCLUDED_CONFIG2
28 #define INCLUDED_CONFIG2
29 
30 // rationale: a centralized header makes it much easier to see what all
31 // can be changed. it is assumed that only a few modules will need
32 // configuration choices, so rebuilding them all is acceptable.
33 // use config.h when settings must apply to the entire project.
34 
35 // allow use of RDTSC for raw tick counts (otherwise, the slower but
36 // more reliable on MP systems wall-clock will be used).
37 #ifndef CONFIG2_TIMER_ALLOW_RDTSC
38 # define CONFIG2_TIMER_ALLOW_RDTSC 1
39 #endif
40 
41 // this enables/disables the actual checking done by OverrunProtector
42 // (quite slow, entailing mprotect() before/after each access).
43 // define to 1 here or in the relevant module if you suspect mem corruption.
44 // we provide this option because OverrunProtector requires some changes to
45 // the object being wrapped, and we want to leave those intact but not
46 // significantly slow things down except when needed.
47 #ifndef CONFIG2_ALLOCATORS_OVERRUN_PROTECTION
48 # define CONFIG2_ALLOCATORS_OVERRUN_PROTECTION 0
49 #endif
50 
51 // zero-copy IO means all clients share the cached buffer; changing their
52 // contents is forbidden. this flag causes the buffers to be marked as
53 // read-only via MMU (writes would cause an exception), which takes a
54 // bit of extra time.
55 #ifndef CONFIG2_CACHE_READ_ONLY
56 #define CONFIG2_CACHE_READ_ONLY 1
57 #endif
58 
59 // enable the wsdl emulator in Windows builds.
60 //
61 // NOTE: the official SDL distribution has two problems on Windows:
62 // - it specifies "/defaultlib:msvcrt.lib". this is troublesome because
63 // multiple heaps are active; errors result when allocated blocks are
64 // (for reasons unknown) passed to a different heap to be freed.
65 // one workaround is to add "/nodefaultlib:msvcrt.lib" to the linker
66 // command line in debug configurations.
67 // - it doesn't support color hardware mouse cursors and clashes with
68 // cursor.cpp's efforts by resetting the mouse cursor after movement.
69 #ifndef CONFIG2_WSDL
70 # define CONFIG2_WSDL 1
71 #endif
72 
73 #ifndef CONFIG2_FILE_ENABLE_AIO
74 // work around a bug introduced in Linux 2.6.38
75 // (http://www.wildfiregames.com/forum/index.php?showtopic=14561&view=findpost&p=217710)
76 // OpenBSD doesn't provide aio.h so we disable its use
77 # if OS_LINUX || OS_OPENBSD
78 # define CONFIG2_FILE_ENABLE_AIO 0
79 # else
80 # define CONFIG2_FILE_ENABLE_AIO 1
81 # endif
82 #endif
83 
84 // allow an attempt to start the Aken driver (i.e. service) at runtime.
85 // enable at your own risk on WinXP systems to allow access to
86 // better timers than Windows provides. on newer Windows versions,
87 // attempts to start the service from code fail unless the process
88 // is elevated, and definitely fail due to lack of cross-signing unless
89 // test-signing mode is active.
90 // if the user has taken explicit action to install and start the
91 // service via aken_install.bat, mahaf.cpp will be able to access it
92 // even if this is defined to 0.
93 #ifndef CONFIG2_MAHAF_ATTEMPT_DRIVER_START
94 # define CONFIG2_MAHAF_ATTEMPT_DRIVER_START 0
95 #endif
96 
97 // build in OpenGL ES 2.0 mode, instead of the default mode designed for
98 // GL 1.1 + extensions.
99 // this disables various features that are not supported by GLES.
100 #ifndef CONFIG2_GLES
101 # define CONFIG2_GLES 0
102 #endif
103 
104 // allow use of OpenAL/Ogg/Vorbis APIs
105 #ifndef CONFIG2_AUDIO
106 # define CONFIG2_AUDIO 1
107 #endif
108 
109 // allow use of NVTT
110 #ifndef CONFIG2_NVTT
111 # define CONFIG2_NVTT 1
112 #endif
113 
114 #endif // #ifndef INCLUDED_CONFIG2