diff --git a/src/zm_define.h b/src/zm_define.h index b542351f9..6fd060dce 100644 --- a/src/zm_define.h +++ b/src/zm_define.h @@ -41,4 +41,14 @@ typedef std::uint8_t uint8; #define SZFMTD "%" PRIuPTR +#ifndef FALLTHROUGH +#if defined(__clang__) +#define FALLTHROUGH [[clang::fallthrough]] +#elif defined(__GNUC__) && __GNUC__ >= 7 +#define FALLTHROUGH [[gnu::fallthrough]] +#else +#define FALLTHROUGH +#endif +#endif + #endif // ZONEMINDER_SRC_ZM_DEFINE_H_ diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index 5f5365fc1..fff12c394 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -621,7 +621,7 @@ int RemoteCameraHttp::GetResponse() { content_type[0] = '\0'; content_boundary[0] = '\0'; content_boundary_len = 0; - [[gnu::fallthrough]]; + FALLTHROUGH; } case HEADERCONT : { @@ -838,7 +838,7 @@ int RemoteCameraHttp::GetResponse() { subcontent_type_header[0] = '\0'; content_length = 0; content_type[0] = '\0'; - [[gnu::fallthrough]]; + FALLTHROUGH; } case SUBHEADERCONT : {