diff --git a/mongoose.h b/mongoose.h
index 8d8a6e02abf1d99a90fac225cffce9cd7c66ebd5..0373f17ac0d8ae3db1b3093dc5c4ea75a2acece4 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -715,6 +715,10 @@ int _stat(const char *pathname, struct stat *st);
 
 #define SOMAXCONN 8
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
 char *inet_ntoa(struct in_addr in);
 int inet_pton(int af, const char *src, void *dst);
@@ -728,6 +732,10 @@ void mg_run_in_task(void (*cb)(struct mg_mgr *mgr, void *arg), void *cb_arg);
 
 int sl_fs_init();
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* defined(MG_SOCKET_SIMPLELINK) && !defined(__SIMPLELINK_H__) */
 
 #endif /* CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_ */