diff options
author | frosch <frosch@openttd.org> | 2017-09-24 13:35:27 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2017-09-24 13:35:27 +0000 |
commit | 24a1b82840f108bbca0704bc793f9646a52a9d0e (patch) | |
tree | ad77fb66de25ff829f69d2ca4d3ef17a64e2a34c /src | |
parent | 96b1ac9d0906ab0fc6678b96689b14b676e7069b (diff) | |
download | openttd-24a1b82840f108bbca0704bc793f9646a52a9d0e.tar.xz |
(svn r27916) -Codechange: Enable usage of static_assert for MSVC
Diffstat (limited to 'src')
-rw-r--r-- | src/stdafx.h | 2 | ||||
-rw-r--r-- | src/viewport_sprite_sorter.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/stdafx.h b/src/stdafx.h index 43e52ff27..237ead346 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -383,7 +383,7 @@ typedef unsigned char byte; /* Compile time assertions. Prefer c++0x static_assert(). * Older compilers cannot evaluate some expressions at compile time, * typically when templates are involved, try assert_tcompile() in those cases. */ -#if defined(__STDCXX_VERSION__) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(static_assert) +#if defined(__STDCXX_VERSION__) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(static_assert) || (defined(_MSC_VER) && _MSC_VER >= 1600) /* __STDCXX_VERSION__ is c++0x feature macro, __GXX_EXPERIMENTAL_CXX0X__ is used by gcc, __GXX_EXPERIMENTAL_CPP0X__ by icc */ #define assert_compile(expr) static_assert(expr, #expr ) #define assert_tcompile(expr) assert_compile(expr) diff --git a/src/viewport_sprite_sorter.h b/src/viewport_sprite_sorter.h index 19b903e15..324ece302 100644 --- a/src/viewport_sprite_sorter.h +++ b/src/viewport_sprite_sorter.h @@ -37,7 +37,7 @@ struct ParentSpriteToDraw { int32 left; ///< minimal screen X coordinate of sprite (= x + sprite->x_offs), reference point for child sprites int32 top; ///< minimal screen Y coordinate of sprite (= y + sprite->y_offs), reference point for child sprites - int first_child; ///< the first child to draw. + int32 first_child; ///< the first child to draw. bool comparison_done; ///< Used during sprite sorting: true if sprite has been compared with all other sprites }; |