From 1ceaa83a844cd3ecef25279d60720f910b96f297 Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Tue, 4 Sep 2018 00:53:38 -0400 Subject: [PATCH] Fix the build with MSVC ARM64 --- arm/filter_neon_intrinsics.c | 4 ++-- arm/palette_neon_intrinsics.c | 8 +++++++- pngrtran.c | 12 ++++++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/arm/filter_neon_intrinsics.c b/arm/filter_neon_intrinsics.c index 1cb5aa8af..75399f6e0 100644 --- a/arm/filter_neon_intrinsics.c +++ b/arm/filter_neon_intrinsics.c @@ -20,9 +20,9 @@ #if PNG_ARM_NEON_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */ #if defined(_MSC_VER) && defined(_M_ARM64) -#include +# include #else -#include +# include #endif /* libpng row pointers are not necessarily aligned to any particular boundary, diff --git a/arm/palette_neon_intrinsics.c b/arm/palette_neon_intrinsics.c index c01db1171..fa02d6a8b 100644 --- a/arm/palette_neon_intrinsics.c +++ b/arm/palette_neon_intrinsics.c @@ -1,5 +1,7 @@ + /* palette_neon_intrinsics.c - NEON optimised palette expansion functions * + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 2017-2018 Arm Holdings. All rights reserved. * Written by Richard Townsend , February 2017. * @@ -12,7 +14,11 @@ #if PNG_ARM_NEON_IMPLEMENTATION == 1 -#include +#if defined(_MSC_VER) && defined(_M_ARM64) +# include +#else +# include +#endif /* Build an RGBA palette from the RGB and separate alpha palettes. */ void diff --git a/pngrtran.c b/pngrtran.c index 8b48f79ba..ccc58ce6f 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -19,10 +19,14 @@ #include "pngpriv.h" #ifdef PNG_ARM_NEON_IMPLEMENTATION -#if PNG_ARM_NEON_IMPLEMENTATION == 1 -#define PNG_ARM_NEON_INTRINSICS_AVAILABLE -#include -#endif +# if PNG_ARM_NEON_IMPLEMENTATION == 1 +# define PNG_ARM_NEON_INTRINSICS_AVAILABLE +# if defined(_MSC_VER) && defined(_M_ARM64) +# include +# else +# include +# endif +# endif #endif #ifdef PNG_READ_SUPPORTED