Skip to content

Commit 8f3f4ea

Browse files
committed
static_assert: wrong cond order + C++ unhandled
First was checkded c < 23 and than c < 11 - the latter one could not had happended. Also handle C++.
1 parent a505844 commit 8f3f4ea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/gpujpeg_common_internal.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@
4444
#include "gpujpeg_util.h"
4545

4646
// static_assert compat
47-
#if __STDC_VERSION__ < 202311L
48-
#include <assert.h> // static_assert compat macro in C11-C17
47+
#if defined __cplusplus
48+
#if __cplusplus < 201103L
49+
#error "compiler is not supporting C++11 - perhaps not passed std?"
50+
#endif
4951
#elif __STDC_VERSION__ < 201112L
5052
#if defined _MSC_VER && _MSC_VER <= 1900
5153
#define static_assert(cond, msg)
5254
#else
5355
#error "compiler is not supporting C11 - perhaps an error?"
5456
#endif
57+
#elif __STDC_VERSION__ < 202311L
58+
#include <assert.h> // static_assert compat macro in C11-C17
5559
#endif
5660

5761
// VS 2015 compat

0 commit comments

Comments
 (0)