Skip to content

Commit

Permalink
Added support for ARM Windows. (#41)
Browse files Browse the repository at this point in the history
Also changes "Windows.h" to "windows.h" in getRealTime.c to fix MinGW cross-compilation under *nix.
  • Loading branch information
KarlLudwig3485 authored Dec 6, 2024
1 parent 4db9fbc commit 026e590
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/getRealTime.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#if defined(_WIN32)

#include <Windows.h>
#include <windows.h>

#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))

Expand Down
2 changes: 1 addition & 1 deletion src/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ states that the compiler defines __64BIT__ if compiling in 64-bit mode.
The symbol __ARM_EABI__ is not defined if compiles under the old EABI.
*/
#if !(defined(__ARMEL__) && defined(__ARM_EABI__))
#if !defined (__MINGW32__) && !(defined(__ARMEL__) && defined(__ARM_EABI__))
#error __ARM_ARCH predefine seqeunce expects both __ARMEL__ and __ARM_EABI__ to be defined! Please check your platforms predefine list using 'gcc -dM -E - < /dev/null' and forward the results to the program author/maintainer(s) listed on the README page.
#endif

Expand Down
7 changes: 4 additions & 3 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,14 +1982,15 @@ uint32 get_system_ram(void) {

// Apr 2018: Due to portability issues, replace the system-headers-based version of the "has advanced SIMD?"
// check with one based on what amounts to "is the result of 'grep asimd /proc/cpuinfo' empty or not?".
// Dec 2020: Apple M1 needs special handling, use the Clang/GCC-shared __ARM_NEON__ predefine to detect SIMD support:
// Dec 2020: Apple M1 needs special handling, use the Clang/GCC-shared __ARM_NEON__ predefine to detect SIMD support.
// Nov 2024: Ditto for MinGW Windows, but only on 64-bit, otherwise we get false positives on ARMv7.
#ifdef CPU_IS_ARM_EABI

#ifdef OS_TYPE_MACOSX
#if defined(OS_TYPE_MACOSX) || defined(__MINGW32__)

int has_asimd(void)
{
#ifdef __ARM_NEON
#if defined(__ARM_NEON) && OS_BITS == 64
return (int)__ARM_NEON;
#else
return 0;
Expand Down

0 comments on commit 026e590

Please sign in to comment.