diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2022-03-28 17:27:48 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2022-03-28 17:28:41 +0300 |
commit | a1519daa5704988d0f8e1576ab252d5a7aa161de (patch) | |
tree | 56d1541be34c969172d5f72ac3ea5c876ce3ae7b | |
parent | db9ac6ba21e30d886bad85c3b9db7619301bdea6 (diff) |
Fix build on MSVC
-rw-r--r-- | pb.h | 3 | ||||
-rw-r--r-- | tests/SConstruct | 3 |
2 files changed, 6 insertions, 0 deletions
@@ -183,6 +183,9 @@ extern "C" { # define PB_STATIC_ASSERT(COND,MSG) #endif +/* Test that PB_STATIC_ASSERT works */ +PB_STATIC_ASSERT(1, STATIC_ASSERT_IS_NOT_WORKING) + /* Number of required fields to keep track of. */ #ifndef PB_MAX_REQUIRED_FIELDS #define PB_MAX_REQUIRED_FIELDS 64 diff --git a/tests/SConstruct b/tests/SConstruct index b2b8b36..0c17460 100644 --- a/tests/SConstruct +++ b/tests/SConstruct @@ -192,6 +192,9 @@ if not env.get('NODEFARGS'): # More strict checks on the nanopb core env.Append(CORECFLAGS = '/W4') + # Enable C11 standard + env.Append(CFLAGS = ' /std:c11 ') + # Disable warning about sizeof(union{}) construct that is used in # message size macros, in e.g. multiple_files testcase. The C construct # itself is valid, but quite rare, which causes Visual C++ to give a warning |