Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2022-03-28 17:27:48 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2022-03-28 17:28:41 +0300
commita1519daa5704988d0f8e1576ab252d5a7aa161de (patch)
tree56d1541be34c969172d5f72ac3ea5c876ce3ae7b
parentdb9ac6ba21e30d886bad85c3b9db7619301bdea6 (diff)
Fix build on MSVC
-rw-r--r--pb.h3
-rw-r--r--tests/SConstruct3
2 files changed, 6 insertions, 0 deletions
diff --git a/pb.h b/pb.h
index 644a759..01320c7 100644
--- a/pb.h
+++ b/pb.h
@@ -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