From 4439251f17823ef97397638822516dfd93098628 Mon Sep 17 00:00:00 2001
From: Marko Mikulicic <mkm@cesanta.com>
Date: Tue, 11 Oct 2016 13:09:32 +0300
Subject: [PATCH] Add MBED as platform

Currently this allows V7 to be built on MBED; more
work is likely required to port mongoose.

PUBLISHED_FROM=32cd0a38349c8e9019af46d4ce7e1429e660db25
---
 mongoose.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/mongoose.h b/mongoose.h
index f24aa6ecd..fc9996e31 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -84,6 +84,7 @@
 #define CS_P_CC3200 4
 #define CS_P_MSP432 5
 #define CS_P_CC3100 6
+#define CS_P_MBED 7
 
 /* If not specified explicitly, we guess platform by defines. */
 #ifndef CS_PLATFORM
@@ -97,6 +98,8 @@
 #define CS_PLATFORM CS_P_UNIX
 #elif defined(_WIN32)
 #define CS_PLATFORM CS_P_WINDOWS
+#elif defined(__MBED__)
+#define CS_PLATFORM CS_P_MBED
 #endif
 
 #ifndef CS_PLATFORM
@@ -110,6 +113,7 @@
 /* Amalgamated: #include "common/platforms/platform_esp_lwip.h" */
 /* Amalgamated: #include "common/platforms/platform_cc3200.h" */
 /* Amalgamated: #include "common/platforms/platform_cc3100.h" */
+/* Amalgamated: #include "common/platforms/platform_mbed.h" */
 
 /* Common stuff */
 
@@ -721,6 +725,22 @@ int _stat(const char *pathname, struct stat *st);
 #endif /* CS_PLATFORM == CS_P_MSP432 */
 #endif /* CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_ */
 #ifdef MG_MODULE_LINES
+#line 1 "common/platforms/platform_mbed.h"
+#endif
+/*
+ * Copyright (c) 2014-2016 Cesanta Software Limited
+ * All rights reserved
+ */
+
+#ifndef CS_COMMON_PLATFORMS_PLATFORM_MBED_H_
+#define CS_COMMON_PLATFORMS_PLATFORM_MBED_H_
+#if CS_PLATFORM == CS_P_MBED
+
+/* Amalgamated: #include "mbed.h" */
+
+#endif /* CS_PLATFORM == CS_P_MBED */
+#endif /* CS_COMMON_PLATFORMS_PLATFORM_MBED_H_ */
+#ifdef MG_MODULE_LINES
 #line 1 "common/platforms/simplelink/cs_simplelink.h"
 #endif
 /*
-- 
GitLab