Abstracts away time()/stdlib.h into platform
Substitutes time() into a configurable platform interface to allow it to be
easily substituted.
diff --git a/library/net.c b/library/net.c
index 3b78b6b..4142bc0 100644
--- a/library/net.c
+++ b/library/net.c
@@ -32,6 +32,13 @@
#error "This module only works on Unix and Windows, see MBEDTLS_NET_C in config.h"
#endif
+#if defined(MBEDTLS_PLATFORM_C)
+#include "mbedtls/platform.h"
+#else
+#include <stdlib.h>
+#define mbedtls_time_t time_t
+#endif
+
#include "mbedtls/net.h"
#include <string.h>
@@ -86,7 +93,6 @@
#define MSVC_INT_CAST
#endif
-#include <stdlib.h>
#include <stdio.h>
#include <time.h>