Changes between Version 5 and Version 6 of CppSupport


Ignore:
Timestamp:
Mar 6, 2017, 7:17:01 PM (7 years ago)
Author:
leper
Comment:

Adjust minimal supported compilers (GCC>=4.8.1, Clang>=3.4 (3.2 might work, but nothing holds us back, so going for one compiler with full C++14 support is nice)).

Legend:

Unmodified
Added
Removed
Modified
  • CppSupport

    v5 v6  
    11
    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.
     2This 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.
    33
    44= Supported Compilers =
    55
    660 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.7 or newer
    8  * Clang 3.1 or newer
    9   * Shipped with Xcode 4.3.3 on OS X
     7 * 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
    1010  * '''Note:''' older versions may work, but this isn't guaranteed
    1111 * Visual Studio 2013
    1212
    13 The following tables summarize C++1x 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.
     13The 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.
    1414
    1515Code examples are given for many features as the formal names can be unclear.
     
    1717= C++11 Core Language Features =
    1818
    19 ||= Feature =||= Example =||= GCC 4.7 =||= Clang 3.1 =||= VS 2013 =||= '''0 A.D. Support''' =||= Notes =||
    20 {{{#!tr style="background: LightYellow"
    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  || ||
    2222}}}
    2323{{{#!tr style="background: LightYellow"
     
    2525}}}
    2626{{{#!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  || ||
    2828}}}
    2929{{{#!tr style="background: LightGreen"
     
    6363||Declared type of an expression||`typedef decltype(a[0]*b[0]) Tmp;`||  Y  ||  Y  ||  Y  ||  Y  || ||
    6464}}}
    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  || ||
    6767}}}
    6868{{{#!tr style="background: LightGreen"
     
    9191}}}
    9292{{{#!tr style="background: Pink"
    93 ||Generalized attributes||`[[attributes]]`||  N  ||  N  ||  N  ||  N  || ||
     93||Generalized attributes||`[[attributes]]`||  Y  ||  Y  ||  N  ||  N  || ||
    9494}}}
    9595{{{#!tr style="background: Pink"
    9696||Generalized constant expressions||`constexpr int a = b.x;`||  Y  ||  Y  ||  N  ||  N  || ||
    9797}}}
    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  || ||
    100100}}}
    101101{{{#!tr style="background: LightGreen"
     
    103103}}}
    104104{{{#!tr style="background: Pink"
    105 ||Inheriting constructors|| ||  N  ||  N  ||  N  ||  N  || ||
     105||Inheriting constructors|| ||  Y  ||  Y  ||  N  ||  N  || ||
    106106}}}
    107107{{{#!tr style="background: LightGreen"
     
    162162== C++11 Core Language Features: Concurrency ==
    163163
    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  || ||
    167167}}}
    168168{{{#!tr style="background: LightGreen"
    169169||Atomic operations|| ||  Y  ||  Y  ||  Y  ||  Y  || ||
    170170}}}
    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  || ||
    179179}}}
    180180{{{#!tr style="background: LightGreen"
     
    182182}}}
    183183{{{#!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  || ||
    194194}}}
    195195
    196196== C++11 Core Language Features: C99 ==
    197197
    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 =||
    199199{{{#!tr style="background: Pink"
    200200||!__func!__ predefined identifier|| ||  Y  ||  Y  ||  P  ||  N  || ||
    201201}}}
    202202{{{#!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) ||
    204204}}}
    205205{{{#!tr style="background: LightGreen"
     
    207207}}}
    208208{{{#!tr style="background: Pink"
    209 ||Extended integral types|| ||  N  ||  N  ||  N  ||  N  || ||
     209||Extended integral types|| ||  Y  ||  N  ||  N  ||  N  || ||
    210210}}}
    211211
    212212= References =
    213213
    214 1. C++0x/C++11 Support in GCC: https://gcc.gnu.org/projects/cxx-status.html#cxx11
     2141. C++11 Support in GCC: https://gcc.gnu.org/projects/cxx-status.html#cxx11
    2152151. Support For C++11 Features (Modern C++) in Visual C++: https://msdn.microsoft.com/en-us/library/hh567368.aspx
    2162161. C++ Support in Clang: http://clang.llvm.org/cxx_status.html