Changes between Version 5 and Version 6 of CppSupport
- Timestamp:
- Mar 6, 2017, 7:17:01 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CppSupport
v5 v6 1 1 2 This page will attempt to describe features of modern C++ standards (C++ 0x, C++11, C++14, etc.) supported by the game. For information on building the game, see BuildInstructions.2 This page will attempt to describe features of modern C++ standards (C++11, C++14, etc.) supported by the game. For information on building the game, see BuildInstructions. 3 3 4 4 = Supported Compilers = 5 5 6 6 0 A.D. is a cross platform game written primarily in C++ and JavaScript, and as such it has to support multiple compilers with different implemented features. Here are the currently supported compilers for the game: 7 * GCC 4. 7or newer8 * Clang 3. 1or newer9 * Shipped with Xcode 4.3.3on OS X7 * GCC 4.8.1 or newer 8 * Clang 3.4 or newer 9 * Shipped with Xcode 5.1 ([https://gist.github.com/yamaya/2924292 according to the documentation]) on OS X 10 10 * '''Note:''' older versions may work, but this isn't guaranteed 11 11 * Visual Studio 2013 12 12 13 The following tables summarize C++1 xsupport for the above compilers. Features available (Y) in all supported compilers are marked green and believed safe to use. Features not available (N) in all supported compilers are marked red and generally should not be used in 0 A.D. In a few cases there is partial support (P), these rows are yellow.13 The following tables summarize C++11 support for the above compilers. Features available (Y) in all supported compilers are marked green and believed safe to use. Features not available (N) in all supported compilers are marked red and generally should not be used in 0 A.D. In a few cases there is partial support (P), these rows are yellow. 14 14 15 15 Code examples are given for many features as the formal names can be unclear. … … 17 17 = C++11 Core Language Features = 18 18 19 ||= Feature =||= Example =||= GCC 4. 7 =||= Clang 3.1=||= VS 2013 =||= '''0 A.D. Support''' =||= Notes =||20 {{{#!tr style="background: Light Yellow"21 ||Emplacement||`emplace`, `emplace_back`|| P || Y || Y || P || GCC < 4.8 is missing emplacement on [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44436 associative containers]||19 ||= Feature =||= Example =||= GCC 4.8.1 =||= Clang 3.4 =||= VS 2013 =||= '''0 A.D. Support''' =||= Notes =|| 20 {{{#!tr style="background: LightGreen" 21 ||Emplacement||`emplace`, `emplace_back`|| Y || Y || Y || Y || || 22 22 }}} 23 23 {{{#!tr style="background: LightYellow" … … 25 25 }}} 26 26 {{{#!tr style="background: Pink" 27 ||Rvalue references for *this||`void RValueFunc() &&;`|| N || N|| N || N || ||27 ||Rvalue references for *this||`void RValueFunc() &&;`|| Y || Y || N || N || || 28 28 }}} 29 29 {{{#!tr style="background: LightGreen" … … 63 63 ||Declared type of an expression||`typedef decltype(a[0]*b[0]) Tmp;`|| Y || Y || Y || Y || || 64 64 }}} 65 {{{#!tr style="background: Pink"66 ||Incomplete return types|| || N || Y || Y || N|| ||65 {{{#!tr style="background: LightGreen" 66 ||Incomplete return types|| || Y || Y || Y || Y || || 67 67 }}} 68 68 {{{#!tr style="background: LightGreen" … … 91 91 }}} 92 92 {{{#!tr style="background: Pink" 93 ||Generalized attributes||`[[attributes]]`|| N || N|| N || N || ||93 ||Generalized attributes||`[[attributes]]`|| Y || Y || N || N || || 94 94 }}} 95 95 {{{#!tr style="background: Pink" 96 96 ||Generalized constant expressions||`constexpr int a = b.x;`|| Y || Y || N || N || || 97 97 }}} 98 {{{#!tr style="background: Pink"99 ||Alignment support||`alignas(16) char[100];`|| N || N || P || N ||||98 {{{#!tr style="background: LightYellow" 99 ||Alignment support||`alignas(16) char[100];`|| Y || Y || P || P || || 100 100 }}} 101 101 {{{#!tr style="background: LightGreen" … … 103 103 }}} 104 104 {{{#!tr style="background: Pink" 105 ||Inheriting constructors|| || N || N|| N || N || ||105 ||Inheriting constructors|| || Y || Y || N || N || || 106 106 }}} 107 107 {{{#!tr style="background: LightGreen" … … 162 162 == C++11 Core Language Features: Concurrency == 163 163 164 ||= Feature =||= Example =||= GCC 4. 7 =||= Clang 3.1=||= VS 2013 =||= '''0 A.D. Support''' =||= Notes =||165 {{{#!tr style="background: Pink" 166 ||Sequence points|| || N || N|| N || N || ||164 ||= Feature =||= Example =||= GCC 4.8.1 =||= Clang 3.4 =||= VS 2013 =||= '''0 A.D. Support''' =||= Notes =|| 165 {{{#!tr style="background: Pink" 166 ||Sequence points|| || Y || Y || N || N || || 167 167 }}} 168 168 {{{#!tr style="background: LightGreen" 169 169 ||Atomic operations|| || Y || Y || Y || Y || || 170 170 }}} 171 {{{#!tr style="background: Pink"172 ||Bidirectional Fences|| || N || Y || Y || N|| ||173 }}} 174 {{{#!tr style="background: Pink" 175 ||Memory model|| || N || N|| N || N || ||176 }}} 177 {{{#!tr style="background: Pink"178 ||Data-dependency ordering: atomics and memory model|| || N || N || Y || N|| ||171 {{{#!tr style="background: LightGreen" 172 ||Bidirectional Fences|| || Y || Y || Y || Y || || 173 }}} 174 {{{#!tr style="background: Pink" 175 ||Memory model|| || Y || Y || N || N || || 176 }}} 177 {{{#!tr style="background: LightGreen" 178 ||Data-dependency ordering: atomics and memory model|| || Y || Y || Y || Y || || 179 179 }}} 180 180 {{{#!tr style="background: LightGreen" … … 182 182 }}} 183 183 {{{#!tr style="background: Pink" 184 ||Abandoning a process and at_quick_exit|| || N || N|| N || N || ||185 }}} 186 {{{#!tr style="background: Pink" 187 ||Allow atomics use in signal handlers|| || N|| Y || N || N || ||188 }}} 189 {{{#!tr style="background: Pink"190 ||Thread-local storage|| || N || N || P || N|| ||191 }}} 192 {{{#!tr style="background: Pink" 193 ||Dynamic initialization and destruction with concurrency|| || N || N|| N || N || ||184 ||Abandoning a process and at_quick_exit|| || Y || Y || N || N || || 185 }}} 186 {{{#!tr style="background: Pink" 187 ||Allow atomics use in signal handlers|| || Y || Y || N || N || || 188 }}} 189 {{{#!tr style="background: LightYellow" 190 ||Thread-local storage|| || Y || Y || P || P || || 191 }}} 192 {{{#!tr style="background: Pink" 193 ||Dynamic initialization and destruction with concurrency|| || Y || Y || N || N || || 194 194 }}} 195 195 196 196 == C++11 Core Language Features: C99 == 197 197 198 ||= Feature =||= Example =||= GCC 4. 7 =||= Clang 3.1=||= VS 2013 =||= '''0 A.D. Support''' =||= Notes =||198 ||= Feature =||= Example =||= GCC 4.8.1 =||= Clang 3.4 =||= VS 2013 =||= '''0 A.D. Support''' =||= Notes =|| 199 199 {{{#!tr style="background: Pink" 200 200 ||!__func!__ predefined identifier|| || Y || Y || P || N || || 201 201 }}} 202 202 {{{#!tr style="background: LightYellow" 203 ||C99 preprocessor|| || Y || Y || P || Y || VS 2013 has partial support ||203 ||C99 preprocessor|| || Y || Y || P || Y || VS 2013 has partial support (Variadic macros are supported) || 204 204 }}} 205 205 {{{#!tr style="background: LightGreen" … … 207 207 }}} 208 208 {{{#!tr style="background: Pink" 209 ||Extended integral types|| || N|| N || N || N || ||209 ||Extended integral types|| || Y || N || N || N || || 210 210 }}} 211 211 212 212 = References = 213 213 214 1. C++ 0x/C++11 Support in GCC: https://gcc.gnu.org/projects/cxx-status.html#cxx11214 1. C++11 Support in GCC: https://gcc.gnu.org/projects/cxx-status.html#cxx11 215 215 1. Support For C++11 Features (Modern C++) in Visual C++: https://msdn.microsoft.com/en-us/library/hh567368.aspx 216 216 1. C++ Support in Clang: http://clang.llvm.org/cxx_status.html