freebsd-ports/devel/electron4/files/patch-third__party_zlib_arm__features.c
Luca Pizzamiglio 2f40d531c4 devel/electron4: Add electron 4.2.2
Finally, after a long wait, an electron port for FreeBSD lands in the
portstree.

A huge thanks to everyone contributed to this huge effort and to the
maintainer that is willing to take the burden of the maintainership!
2019-05-28 09:12:02 +00:00

29 lines
818 B
C

--- third_party/zlib/arm_features.c.orig 2019-03-15 06:38:25 UTC
+++ third_party/zlib/arm_features.c
@@ -16,12 +16,13 @@
#include <asm/hwcap.h>
#include <sys/auxv.h>
#else
-#error ### No ARM CPU features detection in your platform/OS
+/* #error ### No ARM CPU features detection in your platform/OS */
#endif
int ZLIB_INTERNAL arm_cpu_enable_crc32 = 0;
int ZLIB_INTERNAL arm_cpu_enable_pmull = 0;
+#ifdef ARMV8_OS_LINUX
static pthread_once_t cpu_check_inited_once = PTHREAD_ONCE_INIT;
static void init_arm_features(void)
@@ -53,8 +54,11 @@ static void init_arm_features(void)
if (capabilities & flag_pmull)
arm_cpu_enable_pmull = 1;
}
+#endif
void ZLIB_INTERNAL arm_check_features(void)
{
+#ifdef ARMV8_OS_LINUX
pthread_once(&cpu_check_inited_once, init_arm_features);
+#endif
}