Update main.cpp

This commit is contained in:
alexey-milovidov 2020-10-05 09:28:52 +03:00 committed by GitHub
parent 4d427e822f
commit 674d8d44b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,9 +262,11 @@ void writeErrorLen(const char * data, size_t size)
}
}
/// Macros to avoid using strlen(), since it may fail if SSE is not supported.
#define writeError(data) do { \
static_assert(__builtin_constant_p(data)); \
writeErrorLen(data, ARRAY_SIZE(data) - 1) } while (false)
#define writeError(data) do \
{ \
static_assert(__builtin_constant_p(data)); \
writeErrorLen(data, ARRAY_SIZE(data) - 1); \
} while (false)
/// Check SSE and others instructions availability. Calls exit on fail.
/// This function must be called as early as possible, even before main, because static initializers may use unavailable instructions.