Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions compiler/test/compilable/stdcheaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
#include <limits.h>
#include <locale.h>

#if !(defined(__linux__) && defined(__aarch64__)) // /usr/include/bits/math-vector.h(162): Error: undefined identifier `__Float32x4_t`
#include <math.h>
#ifndef _MSC_VER // C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt\corecrt_math.h(93): Error: reinterpretation through overlapped field `f` is not allowed in CTFE
float x = NAN;
#endif
#endif

#ifndef _MSC_VER // setjmp.h(51): Error: missing tag `identifier` after `struct
#include <setjmp.h>
Expand Down Expand Up @@ -64,11 +62,9 @@ float x = NAN;
// Apple: /Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tgmath.h(39): Error: named parameter required before `...`
// OpenBSD: /usr/lib/clang/13.0.0/include/tgmath.h(34): Error: named parameter required before `...`
// Linux: /tmp/clang/lib/clang/15.0.3/include/tgmath.h(34): Error: named parameter required before `...`
#if !(defined(__linux__) && defined(__aarch64__)) // /usr/include/bits/math-vector.h(162): Error: undefined identifier `__Float32x4_t`
#include <tgmath.h>
#endif
#endif
#endif

#ifndef __linux__
#ifndef __APPLE__
Expand Down
7 changes: 7 additions & 0 deletions druntime/src/__importc_builtins.di
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,10 @@ version (DigitalMars)
ulong a, b;
}
}

version (CRuntime_Glibc) version (AArch64)
{
// math.h needs these
alias __Float32x4_t = __vector(float[4]);
alias __Float64x2_t = __vector(double[2]);
}
8 changes: 8 additions & 0 deletions druntime/src/importc.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,16 @@ typedef unsigned long long __uint64_t;
#define _Float128 long double
#define __float128 long double
#endif

#ifdef __aarch64__
// glibc's math.h needs these types to be defined
typedef struct {} __SVBool_t;
typedef struct {} __SVFloat32_t;
typedef struct {} __SVFloat64_t;
#endif

#endif // __linux__

#if __APPLE__
#undef __SIZEOF_INT128__
#endif
Loading