Skip to content

Commit

Permalink
Fix x86 build with msvc compiler
Browse files Browse the repository at this point in the history
Replace check for _M_X64 with _M_IX86 to make sure x86 builds can be compiled
  • Loading branch information
pps83 committed Feb 14, 2024
1 parent b50206c commit e836ddd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion headers/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <iso646.h>
#include <stdint.h>

#if (defined(_M_X64) || defined(_M_AMD64))
#if (defined(_M_IX86) || defined(_M_AMD64))
#include <intrin.h>
#elif defined(_M_ARM64)
#include <simde/x86/sse4.1.h>
Expand Down
40 changes: 20 additions & 20 deletions src/streamvbyte.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
// no particular alignment is assumed or guaranteed for any elements

#if defined(_MSC_VER)
/* Microsoft C/C++-compatible compiler */
#if (defined(_M_X64) || defined(_M_AMD64))
#include <intrin.h>
#elif defined(_M_ARM64)
#include <simde/x86/sse4.1.h>
#endif

#include <iso646.h>
#include <stdint.h>
#define __restrict__ __restrict
/* Microsoft C/C++-compatible compiler */
#if (defined(_M_IX86) || defined(_M_AMD64))
#include <intrin.h>
#elif defined(_M_ARM64)
#include <simde/x86/sse4.1.h>
#endif

#include <iso646.h>
#include <stdint.h>
#define __restrict__ __restrict
#elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
/* GCC-compatible compiler, targeting x86/x86-64 */
#include <x86intrin.h>
/* GCC-compatible compiler, targeting x86/x86-64 */
#include <x86intrin.h>
#elif defined(__aarch64__)
/* GCC-compatible compiler, targeting ARM with NEON */
#include <simde/x86/sse4.1.h>
/* GCC-compatible compiler, targeting ARM with NEON */
#include <simde/x86/sse4.1.h>
#elif defined(__GNUC__) && defined(__IWMMXT__)
/* GCC-compatible compiler, targeting ARM with WMMX */
#include <mmintrin.h>
/* GCC-compatible compiler, targeting ARM with WMMX */
#include <mmintrin.h>
#elif (defined(__GNUC__) || defined(__xlC__)) && (defined(__VEC__) || defined(__ALTIVEC__))
/* XLC or GCC-compatible compiler, targeting PowerPC with VMX/VSX */
#include <altivec.h>
/* XLC or GCC-compatible compiler, targeting PowerPC with VMX/VSX */
#include <altivec.h>
#elif defined(__GNUC__) && defined(__SPE__)
/* GCC-compatible compiler, targeting PowerPC with SPE */
#include <spe.h>
/* GCC-compatible compiler, targeting PowerPC with SPE */
#include <spe.h>
#endif

#include <stdint.h>
Expand Down
22 changes: 11 additions & 11 deletions src/varintdecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@

#if defined(_MSC_VER)
/* Microsoft C/C++-compatible compiler */
#if (defined(_M_X64) || defined(_M_AMD64))
#if (defined(_M_IX86) || defined(_M_AMD64))
#include <intrin.h>
#elif defined(_M_ARM64)
#include <simde/x86/sse4.1.h>
#endif
#elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
/* GCC-compatible compiler, targeting x86/x86-64 */
#include <x86intrin.h>
/* GCC-compatible compiler, targeting x86/x86-64 */
#include <x86intrin.h>

#elif defined(__aarch64__)
/* GCC-compatible compiler, targeting ARM with NEON */
#include <simde/x86/sse4.1.h>
/* GCC-compatible compiler, targeting ARM with NEON */
#include <simde/x86/sse4.1.h>
#elif defined(__GNUC__) && defined(__IWMMXT__)
/* GCC-compatible compiler, targeting ARM with WMMX */
#include <mmintrin.h>
/* GCC-compatible compiler, targeting ARM with WMMX */
#include <mmintrin.h>
#elif (defined(__GNUC__) || defined(__xlC__)) && (defined(__VEC__) || defined(__ALTIVEC__))
/* XLC or GCC-compatible compiler, targeting PowerPC with VMX/VSX */
#include <altivec.h>
/* XLC or GCC-compatible compiler, targeting PowerPC with VMX/VSX */
#include <altivec.h>
#elif defined(__GNUC__) && defined(__SPE__)
/* GCC-compatible compiler, targeting PowerPC with SPE */
#include <spe.h>
/* GCC-compatible compiler, targeting PowerPC with SPE */
#include <spe.h>
#endif
#include <stdint.h>

Expand Down

0 comments on commit e836ddd

Please sign in to comment.