From 9da46a98cbd20ea8cc48fc2378bf8092abd80795 Mon Sep 17 00:00:00 2001
From: stijn <stijn@ignitron.net>
Date: Wed, 17 Jul 2019 12:08:40 +0200
Subject: [PATCH] windows/mpconfigport.h: Don't define restrict/inline/alignof
 for C++.

The C++ standard forbids redefining keywords, like inline and alignof, so
guard these definitions to avoid that, allowing to include the MicroPython
headers by C++ code.
---
 ports/windows/mpconfigport.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ports/windows/mpconfigport.h b/ports/windows/mpconfigport.h
index 86e44183b..ffe7ae144 100644
--- a/ports/windows/mpconfigport.h
+++ b/ports/windows/mpconfigport.h
@@ -228,9 +228,11 @@ extern const struct _mp_obj_module_t mp_module_time;
 
 // CL specific definitions
 
+#ifndef __cplusplus
 #define restrict
 #define inline                      __inline
 #define alignof(t)                  __alignof(t)
+#endif
 #define PATH_MAX                    MICROPY_ALLOC_PATH_MAX
 #define S_ISREG(m)                  (((m) & S_IFMT) == S_IFREG)
 #define S_ISDIR(m)                  (((m) & S_IFMT) == S_IFDIR)
-- 
GitLab