Changeset - r22695:74ef624a6be2
[Not reviewed]
master
0 2 0
frosch - 7 years ago 2017-09-24 13:35:27
frosch@openttd.org
(svn r27916) -Codechange: Enable usage of static_assert for MSVC
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/stdafx.h
Show inline comments
 
@@ -374,25 +374,25 @@ typedef unsigned char byte;
 
	typedef   signed int      int32;
 
	typedef unsigned __int64 uint64;
 
	typedef   signed __int64  int64;
 
#endif /* !TROUBLED_INTS */
 

	
 
#if !defined(WITH_PERSONAL_DIR)
 
	#define PERSONAL_DIR ""
 
#endif
 

	
 
/* 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)
 
#elif defined(__OS2__)
 
	/* Disabled for OS/2 */
 
	#define assert_compile(expr)
 
	#define assert_tcompile(expr) assert_compile(expr)
 
#else
 
	#define assert_compile(expr) typedef int __ct_assert__[1 - 2 * !(expr)]
 
	#define assert_tcompile(expr) assert(expr)
 
#endif
 

	
src/viewport_sprite_sorter.h
Show inline comments
 
@@ -28,25 +28,25 @@ struct ParentSpriteToDraw {
 
	int32 xmax;                     ///< maximal world X coordinate of bounding box
 
	int32 ymax;                     ///< maximal world Y coordinate of bounding box
 
	int32 zmax;                     ///< maximal world Z coordinate of bounding box
 
	int32 y;                        ///< screen Y coordinate of sprite
 

	
 
	SpriteID image;                 ///< sprite to draw
 
	PaletteID pal;                  ///< palette to use
 
	const SubSprite *sub;           ///< only draw a rectangular part of the sprite
 

	
 
	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
 
};
 

	
 
typedef SmallVector<ParentSpriteToDraw*, 64> ParentSpriteToSortVector;
 

	
 
/** Type for method for checking whether a viewport sprite sorter exists. */
 
typedef bool (*VpSorterChecker)();
 
/** Type for the actual viewport sprite sorter. */
 
typedef void (*VpSpriteSorter)(ParentSpriteToSortVector *psd);
 

	
 
#ifdef WITH_SSE
 
bool ViewportSortParentSpritesSSE41Checker();
0 comments (0 inline, 0 general)