From fde74453a62a1ce4b5efaac0ec1835b9f5731e25 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 1 Mar 2023 11:35:39 -0800 Subject: Use macros for the likely/unlikely attributes The syntax parser for GCC 8 (and earlier?) fails when these attributes are in certain places. --- core/ambdec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/ambdec.cpp') diff --git a/core/ambdec.cpp b/core/ambdec.cpp index 5e2de6af..8ca182c4 100644 --- a/core/ambdec.cpp +++ b/core/ambdec.cpp @@ -61,7 +61,7 @@ al::optional make_error(size_t linenum, const char *fmt, ...) va_start(args, fmt); va_copy(args2, args); const int msglen{std::vsnprintf(&str[plen], str.size()-plen, fmt, args)}; - if(msglen >= 0 && static_cast(msglen) >= str.size()-plen) [[unlikely]] + if(msglen >= 0 && static_cast(msglen) >= str.size()-plen) { str.resize(static_cast(msglen) + plen + 1u); std::vsnprintf(&str[plen], str.size()-plen, fmt, args2); -- cgit v1.2.3