entropy_poll/x509_crt: Added MBEDTLS_POP_TARGET_PRAGMA define guards.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
diff --git a/library/entropy_poll.c b/library/entropy_poll.c
index 8fb7f9e..e5cf970 100644
--- a/library/entropy_poll.c
+++ b/library/entropy_poll.c
@@ -52,6 +52,9 @@
#if _WIN32_WINNT >= 0x0501 /* _WIN32_WINNT_WINXP */
#include <bcrypt.h>
#if defined(_MSC_VER) && _MSC_VER <= 1600
+#define MBEDTLS_POP_TARGET_PRAGMA
+#endif
+#if defined(MBEDTLS_POP_TARGET_PRAGMA)
/* Visual Studio 2010 and earlier issue a warning when both <stdint.h> and
* <intsafe.h> are included, as they redefine a number of <TYPE>_MAX constants.
* These constants are guaranteed to be the same, though, so we suppress the
@@ -61,7 +64,7 @@
#pragma warning(disable : 4005)
#endif
#include <intsafe.h>
-#if defined(_MSC_VER) && _MSC_VER <= 1600
+#if defined(MBEDTLS_POP_TARGET_PRAGMA)
#pragma warning(pop)
#endif
@@ -253,4 +256,8 @@
}
#endif /* MBEDTLS_ENTROPY_NV_SEED */
+#if defined(MBEDTLS_POP_TARGET_PRAGMA)
+#undef MBEDTLS_POP_TARGET_PRAGMA
+#endif
+
#endif /* MBEDTLS_ENTROPY_C */
diff --git a/library/x509_crt.c b/library/x509_crt.c
index d4a6dbb..4beda54 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -62,6 +62,9 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#if defined(_MSC_VER) && _MSC_VER <= 1600
+#define MBEDTLS_POP_TARGET_PRAGMA
+#endif
+#if defined(MBEDTLS_POP_TARGET_PRAGMA)
/* Visual Studio 2010 and earlier issue a warning when both <stdint.h> and
* <intsafe.h> are included, as they redefine a number of <TYPE>_MAX constants.
* These constants are guaranteed to be the same, though, so we suppress the
@@ -71,7 +74,7 @@
#pragma warning(disable : 4005)
#endif
#include <intsafe.h>
-#if defined(_MSC_VER) && _MSC_VER <= 1600
+#if defined(MBEDTLS_POP_TARGET_PRAGMA)
#pragma warning(pop)
#endif
#else
@@ -3333,4 +3336,8 @@
}
#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */
+#if defined(MBEDTLS_POP_TARGET_PRAGMA)
+#undef MBEDTLS_POP_TARGET_PRAGMA
+#endif
+
#endif /* MBEDTLS_X509_CRT_PARSE_C */