From 4ccd531a9c7c3c72b3f3f0fbd25df427bde189b0 Mon Sep 17 00:00:00 2001
From: anton isaykin <antonisaikin@demlabs.net>
Date: Fri, 23 Nov 2018 00:20:27 +0700
Subject: [PATCH]  defines and correct libs for Macos

---
 crypto/dap_crypto_common.h | 3 +++
 crypto/msrln/kex.c         | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/crypto/dap_crypto_common.h b/crypto/dap_crypto_common.h
index 92bf8e6..ea57bf7 100644
--- a/crypto/dap_crypto_common.h
+++ b/crypto/dap_crypto_common.h
@@ -18,11 +18,14 @@ extern "C" {
 
 #define OS_WIN       1
 #define OS_LINUX     2
+#define OS_MACOS     3
 
 #if defined(_WIN32)        // Microsoft Windows OS
     #define OS_TARGET OS_WIN
 #elif defined(__linux__)        // Linux OS
     #define OS_TARGET OS_LINUX
+#elif defined(__APPLE__)         // MACOS
+    #define OS_TARGET OS_MACOS
 #else
     #error -- "Unsupported OS"
 #endif
diff --git a/crypto/msrln/kex.c b/crypto/msrln/kex.c
index c532997..8b2eafb 100644
--- a/crypto/msrln/kex.c
+++ b/crypto/msrln/kex.c
@@ -1,5 +1,10 @@
 #include "msrln_priv.h"
-#include <malloc.h>
+#if (OS_TARGET == OS_MACOS)
+    #include <stdio.h>
+#else
+    #include <malloc.h>
+#endif
+
 
 //extern const int32_t MSRLN_psi_rev_ntt1024_12289[1024];
 //extern const int32_t MSRLN_omegainv_rev_ntt1024_12289[1024];
-- 
GitLab