瀏覽代碼

Revert "Improved fallback for SDL_COMPILE_TIME_ASSERT() (thanks @icculus!)"

This reverts commit 9d453daa2389e7bde7e13809309af7a213bcb333.

Oops, it totally doesn't work:
error: unused variable 'SDL_compile_time_assert_SDL_copyp' [-Werror=unused-variable]
Sam Lantinga 2 年之前
父節點
當前提交
080b1dfbdb
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      include/SDL3/SDL_stdinc.h

+ 2 - 1
include/SDL3/SDL_stdinc.h

@@ -335,8 +335,9 @@ typedef uint64_t Uint64;
 #endif /* !SDL_COMPILE_TIME_ASSERT */
 #endif /* !SDL_COMPILE_TIME_ASSERT */
 
 
 #ifndef SDL_COMPILE_TIME_ASSERT
 #ifndef SDL_COMPILE_TIME_ASSERT
+/* universal, but may trigger -Wunused-local-typedefs */
 #define SDL_COMPILE_TIME_ASSERT(name, x)               \
 #define SDL_COMPILE_TIME_ASSERT(name, x)               \
-       extern int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
+       typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
 #endif
 #endif
 
 
 /** \cond */
 /** \cond */