Pyrogenesis  trunk
config2.h
Go to the documentation of this file.
1 /* Copyright (c) 2015 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 #ifndef CONFIG2_FILE_ENABLE_AIO
60 // work around a bug introduced in Linux 2.6.38
61 // (http://www.wildfiregames.com/forum/index.php?showtopic=14561&view=findpost&p=217710)
62 // OpenBSD doesn't provide aio.h so we disable its use
63 # if OS_LINUX || OS_OPENBSD
64 # define CONFIG2_FILE_ENABLE_AIO 0
65 # else
66 # define CONFIG2_FILE_ENABLE_AIO 1
67 # endif
68 #endif
69 
70 // allow an attempt to start the Aken driver (i.e. service) at runtime.
71 // enable at your own risk on WinXP systems to allow access to
72 // better timers than Windows provides. on newer Windows versions,
73 // attempts to start the service from code fail unless the process
74 // is elevated, and definitely fail due to lack of cross-signing unless
75 // test-signing mode is active.
76 // if the user has taken explicit action to install and start the
77 // service via aken_install.bat, mahaf.cpp will be able to access it
78 // even if this is defined to 0.
79 #ifndef CONFIG2_MAHAF_ATTEMPT_DRIVER_START
80 # define CONFIG2_MAHAF_ATTEMPT_DRIVER_START 0
81 #endif
82 
83 // build in OpenGL ES 2.0 mode, instead of the default mode designed for
84 // GL 1.1 + extensions.
85 // this disables various features that are not supported by GLES.
86 #ifndef CONFIG2_GLES
87 # define CONFIG2_GLES 0
88 #endif
89 
90 // allow use of OpenAL/Ogg/Vorbis APIs
91 #ifndef CONFIG2_AUDIO
92 # define CONFIG2_AUDIO 1
93 #endif
94 
95 // allow use of NVTT
96 #ifndef CONFIG2_NVTT
97 # define CONFIG2_NVTT 1
98 #endif
99 
100 // allow use of lobby
101 #ifndef CONFIG2_LOBBY
102 # define CONFIG2_LOBBY 1
103 #endif
104 
105 // allow use of miniupnpc
106 #ifndef CONFIG2_MINIUPNPC
107 # define CONFIG2_MINIUPNPC 1
108 #endif
109 
110 #endif // #ifndef INCLUDED_CONFIG2