Fix compilation with GCC 5
parent
241984987b
commit
03ed9e4173
|
@ -329,7 +329,10 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(EXE_CFLAGS "${EXE_CFLAGS} /w")
|
set(EXE_CFLAGS "${EXE_CFLAGS} /w")
|
||||||
else()
|
else()
|
||||||
set(EXE_CFLAGS "${EXE_CFLAGS} -Werror -Wall -Werror=implicit-fallthrough")
|
set(EXE_CFLAGS "${EXE_CFLAGS} -Werror -Wall")
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
|
||||||
|
set(EXE_CFLAGS "${EXE_CFLAGS} -Werror=implicit-fallthrough")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ static inline void zig_assert(bool ok, const char *file, int line, const char *f
|
||||||
#define ZIG_FALLTHROUGH
|
#define ZIG_FALLTHROUGH
|
||||||
#elif defined(__clang__)
|
#elif defined(__clang__)
|
||||||
#define ZIG_FALLTHROUGH [[clang::fallthrough]]
|
#define ZIG_FALLTHROUGH [[clang::fallthrough]]
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__) && __GNUC__ >= 7
|
||||||
#define ZIG_FALLTHROUGH __attribute__((fallthrough))
|
#define ZIG_FALLTHROUGH __attribute__((fallthrough))
|
||||||
#else
|
#else
|
||||||
#define ZIG_FALLTHROUGH
|
#define ZIG_FALLTHROUGH
|
||||||
|
|
Loading…
Reference in New Issue