Merge "Enable Windows host compilation of scrypt" am: c09f61a395 am: 4c2a09a3c8 am: c9bce8a96a

Original change: https://android-review.googlesource.com/c/platform/external/scrypt/+/2414316

Change-Id: I50a66b0600741b9e6522abe2faca5fd7806a405e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/Android.bp b/Android.bp
index 1d784fc..ae10e23 100644
--- a/Android.bp
+++ b/Android.bp
@@ -53,6 +53,11 @@
     sdk_version: "17",
     host_supported: true,
     vendor_available: true,
+    target: {
+        windows: {
+            enabled: true,
+        },
+    },
 }
 
 cc_test {
diff --git a/config.h b/config.h
index 3514f39..c388856 100644
--- a/config.h
+++ b/config.h
@@ -21,7 +21,9 @@
 #define HAVE_MEMORY_H 1
 
 /* Define to 1 if you have the `posix_memalign' function. */
+#ifndef _WIN32
 #define HAVE_POSIX_MEMALIGN 1
+#endif
 
 /* Define to 1 if you have the <stdint.h> header file. */
 #define HAVE_STDINT_H 1
diff --git a/lib/crypto/crypto_scrypt-sse.c b/lib/crypto/crypto_scrypt-sse.c
index dd18f29..c50204d 100644
--- a/lib/crypto/crypto_scrypt-sse.c
+++ b/lib/crypto/crypto_scrypt-sse.c
@@ -29,7 +29,9 @@
 #include "scrypt_platform.h"
 
 #include <sys/types.h>
+#ifndef _WIN32
 #include <sys/mman.h>
+#endif
 
 #include <emmintrin.h>
 #include <errno.h>