summaryrefslogtreecommitdiff
path: root/png/arm/arm_init.c
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-01-17 09:38:53 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-01-17 09:38:53 +0100
commit39eba133de302f393cc2dabfa5c1d933239cd1ce (patch)
tree0aacb7bfd9d2b30350f8a601515f7f0126a797ad /png/arm/arm_init.c
parentb804c4b72c96630d57166d4d7b94fb104122e95e (diff)
Update bundled libpng to version 1.6.39 (20 nov 2022)
Diffstat (limited to 'png/arm/arm_init.c')
-rw-r--r--png/arm/arm_init.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/png/arm/arm_init.c b/png/arm/arm_init.c
index a34ecdbef..84d05556f 100644
--- a/png/arm/arm_init.c
+++ b/png/arm/arm_init.c
@@ -1,7 +1,7 @@
/* arm_init.c - NEON optimised filter functions
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2022 Cosmin Truta
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
*
@@ -10,9 +10,7 @@
* and license in png.h
*/
-/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
- * called.
- */
+/* This module requires POSIX 1003.1 functions. */
#define _POSIX_SOURCE 1
#include "../pngpriv.h"
@@ -33,21 +31,26 @@
* has partial support is contrib/arm-neon/linux.c - a generic Linux
* implementation which reads /proc/cpufino.
*/
+#include <signal.h> /* for sig_atomic_t */
+
#ifndef PNG_ARM_NEON_FILE
-# ifdef __linux__
-# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
+# if defined(__aarch64__) || defined(_M_ARM64)
+ /* ARM Neon is expected to be unconditionally available on ARM64. */
+# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64"
+# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
+ /* ARM Neon is expected to be available on the target CPU architecture. */
+# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch"
+# elif defined(__linux__)
+# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
+# else
+# error "No support for run-time ARM Neon checking; use compile-time options"
# endif
#endif
-#ifdef PNG_ARM_NEON_FILE
-
-#include <signal.h> /* for sig_atomic_t */
static int png_have_neon(png_structp png_ptr);
-#include PNG_ARM_NEON_FILE
-
-#else /* PNG_ARM_NEON_FILE */
-# error "PNG_ARM_NEON_FILE undefined: no support for run-time ARM NEON checks"
-#endif /* PNG_ARM_NEON_FILE */
+#ifdef PNG_ARM_NEON_FILE
+# include PNG_ARM_NEON_FILE
+#endif
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED