[libjpeg_turbo] Fix ARM NEON build

On Android, we produce an ARM build with optional NEON code paths.
Fix compilation issues when producing a NEON-only builds on ARM -
in such builds NEON is not optional.

Patch prepared by fdegans@chromium.org

BUG=451035
R=fdegans@chromium.org

Review URL: https://codereview.appspot.com/245180043

git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/libjpeg_turbo@295576 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/README.chromium b/README.chromium
index d7723a0..e2f0512 100644
--- a/README.chromium
+++ b/README.chromium
@@ -35,6 +35,8 @@
   decoder fallback to slow decoding if the Huffman decoding bit sentinel > 16,
   this to match the exact behavior of jpeg_huff_decode().
   http://crbug.com/398235
+* Fixed an issue with the ARM NEON build.
+  http://crbug.com/451035
 
 The 'google.patch' file represents our changes from the original
 libjpeg-turbo-1.2.
diff --git a/google.patch b/google.patch
index 4d0af8e..f12156b 100644
--- a/google.patch
+++ b/google.patch
@@ -1235,6 +1235,28 @@
  
  EXTN(jsimd_h2v2_downsample_mmx):
  	push	ebp
++Index: simd/jsimd_arm.c
++===================================================================
++--- simd/jsimd_arm.c (revision 272637)
+++++ simd/jsimd_arm.c (working copy)
++@@ -29,0 +29,0 @@
++
++ static unsigned int simd_support = ~0;
++
++-#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
+++#if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
++
++ #define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)
++
++@@ -100,6 +100,6 @@
++ init_simd (void)
++ {
++   char *env = NULL;
++-#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
+++#if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
++   int bufsize = 1024; /* an initial guess for the line buffer size limit */
++ #endif
++
 Index: simd/jsimd_arm_neon.S
 ===================================================================
 --- simd/jsimd_arm_neon.S	(revision 272637)
diff --git a/simd/jsimd_arm.c b/simd/jsimd_arm.c
index bd717a4..a1a9061 100644
--- a/simd/jsimd_arm.c
+++ b/simd/jsimd_arm.c
@@ -29,7 +29,7 @@
 
 static unsigned int simd_support = ~0;
 
-#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
+#if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
 
 #define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)
 
@@ -100,7 +100,7 @@
 init_simd (void)
 {
   char *env = NULL;
-#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
+#if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
   int bufsize = 1024; /* an initial guess for the line buffer size limit */
 #endif