diff options
| author | Yonatan Goldschmidt <yon.goldschmidt@gmail.com> | 2022-07-16 16:47:41 +0300 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-07-18 11:11:00 +1000 |
| commit | 6670281472aa3c931b08e623488a02c335aeda20 (patch) | |
| tree | 047e795b3741366c40be04fa09812cf955e4eb6e /py/misc.h | |
| parent | cca2305211688df0e13a14f67f1eaf67d9cb267e (diff) | |
py/misc: Add MP_STATIC_ASSERT_NOT_MSC().
To be used in cases where the condition of the assert does not compile
under msvc.
Signed-off-by: Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
Diffstat (limited to 'py/misc.h')
| -rw-r--r-- | py/misc.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -52,6 +52,11 @@ typedef unsigned int uint; // Static assertion macro #define MP_STATIC_ASSERT(cond) ((void)sizeof(char[1 - 2 * !(cond)])) +#if defined(_MSC_VER) +#define MP_STATIC_ASSERT_NOT_MSC(cond) (1) +#else +#define MP_STATIC_ASSERT_NOT_MSC(cond) MP_STATIC_ASSERT(cond) +#endif // Round-up integer division #define MP_CEIL_DIVIDE(a, b) (((a) + (b) - 1) / (b)) |
