Skip to content

Commit

Permalink
Make compile-time assert error messages more clear.
Browse files Browse the repository at this point in the history
Now the compiler might say this:

'SDL_compile_time_assert_mytest' declared as an array with a negative size

instead of

'SDL_dummy_mytest' declared as an array with a negative size
  • Loading branch information
icculus committed Jun 10, 2017
1 parent bb100d3 commit 43d62b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/SDL_stdinc.h
Expand Up @@ -269,7 +269,7 @@ typedef uint64_t Uint64;
#endif /* SDL_DISABLE_ANALYZE_MACROS */

#define SDL_COMPILE_TIME_ASSERT(name, x) \
typedef int SDL_dummy_ ## name[(x) * 2 - 1]
typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
/** \cond */
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
Expand Down

0 comments on commit 43d62b7

Please sign in to comment.