Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include')
-rw-r--r--newlib/libc/include/_ansi.h14
-rw-r--r--newlib/libc/include/assert.h4
-rw-r--r--newlib/libc/include/machine/_default_types.h3
-rw-r--r--newlib/libc/include/machine/ieeefp.h12
-rw-r--r--newlib/libc/include/machine/setjmp.h5
-rw-r--r--newlib/libc/include/machine/time.h2
-rw-r--r--newlib/libc/include/math.h5
-rw-r--r--newlib/libc/include/stdint.h6
-rw-r--r--newlib/libc/include/sys/config.h4
-rw-r--r--newlib/libc/include/sys/features.h10
-rw-r--r--newlib/libc/include/tgmath.h3
11 files changed, 53 insertions, 15 deletions
diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h
index 86cb82b35..c5597b30b 100644
--- a/newlib/libc/include/_ansi.h
+++ b/newlib/libc/include/_ansi.h
@@ -34,9 +34,7 @@
#define _BEGIN_STD_C extern "C" {
#define _END_STD_C }
#endif
-#if defined(__GNUC__) && \
- ( (__GNUC__ >= 4) || \
- ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) )
+#if __GNUC_PREREQ (3, 3)
#define _NOTHROW __attribute__ ((nothrow))
#else
#define _NOTHROW throw()
@@ -133,4 +131,14 @@
#define _ELIDABLE_INLINE static __inline__
#endif
+#if __GNUC_PREREQ (3, 1)
+#define _NOINLINE __attribute__ ((__noinline__))
+#define _NOINLINE_STATIC _NOINLINE static
+#else
+/* On non-GNU compilers and GCC prior to version 3.1 the compiler can't be
+ trusted not to inline if it is static. */
+#define _NOINLINE
+#define _NOINLINE_STATIC
+#endif
+
#endif /* _ANSIDECL_H_ */
diff --git a/newlib/libc/include/assert.h b/newlib/libc/include/assert.h
index e542b214f..91bb040ca 100644
--- a/newlib/libc/include/assert.h
+++ b/newlib/libc/include/assert.h
@@ -41,6 +41,10 @@ void _EXFUN(__assert, (const char *, int, const char *)
void _EXFUN(__assert_func, (const char *, int, const char *, const char *)
_ATTRIBUTE ((__noreturn__)));
+#if __STDC_VERSION__ >= 201112L && !defined __cplusplus
+# define static_assert _Static_assert
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/newlib/libc/include/machine/_default_types.h b/newlib/libc/include/machine/_default_types.h
index e79f99399..362e07903 100644
--- a/newlib/libc/include/machine/_default_types.h
+++ b/newlib/libc/include/machine/_default_types.h
@@ -12,8 +12,7 @@ extern "C" {
/*
* Guess on types by examining *_MIN / *_MAX defines.
*/
-#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ >= 3 ) \
- && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 ))
+#if __GNUC_PREREQ (3, 3)
/* GCC >= 3.3.0 has __<val>__ implicitly defined. */
#define __EXP(x) __##x##__
#else
diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h
index 72c1cc542..f8795c072 100644
--- a/newlib/libc/include/machine/ieeefp.h
+++ b/newlib/libc/include/machine/ieeefp.h
@@ -69,6 +69,14 @@
#endif
#endif
+#if defined (__aarch64__)
+#if defined (__AARCH64EL__)
+#define __IEEE_LITTLE_ENDIAN
+#else
+#define __IEEE_BIG_ENDIAN
+#endif
+#endif
+
#ifdef __epiphany__
#define __IEEE_LITTLE_ENDIAN
#define Sudden_Underflow 1
@@ -280,7 +288,11 @@
#endif
#ifdef __moxie__
+#ifdef __MOXIE_BIG_ENDIAN__
#define __IEEE_BIG_ENDIAN
+#else
+#define __IEEE_LITTLE_ENDIAN
+#endif
#endif
#ifdef __ia64__
diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
index 78afc7bdd..48361763d 100644
--- a/newlib/libc/include/machine/setjmp.h
+++ b/newlib/libc/include/machine/setjmp.h
@@ -9,6 +9,11 @@ _BEGIN_STD_C
#define _JBLEN 23
#endif
+#if defined(__aarch64__)
+#define _JBLEN 22
+#define _JBTYPE long long
+#endif
+
#if defined(__AVR__)
#define _JBLEN 24
#endif
diff --git a/newlib/libc/include/machine/time.h b/newlib/libc/include/machine/time.h
index a296857d4..06e2ccffb 100644
--- a/newlib/libc/include/machine/time.h
+++ b/newlib/libc/include/machine/time.h
@@ -4,7 +4,7 @@
#if defined(__rtems__)
#define _CLOCKS_PER_SEC_ sysconf(_SC_CLK_TCK)
#else /* !__rtems__ */
-#if defined(__arm__) || defined(__thumb__)
+#if defined(__aarch64__) || defined(__arm__) || defined(__thumb__)
#define _CLOCKS_PER_SEC_ 100
#endif
#endif /* !__rtems__ */
diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
index 9e6041487..e9328c55a 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -34,10 +34,7 @@ union __ldmath
/* Natural log of 2 */
#define _M_LN2 0.693147180559945309417
-#if defined(__GNUC__) && \
- ( (__GNUC__ >= 4) || \
- ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) )
-
+#if __GNUC_PREREQ (3, 3)
/* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */
# ifndef HUGE_VAL
diff --git a/newlib/libc/include/stdint.h b/newlib/libc/include/stdint.h
index 94759e969..d0374ae2d 100644
--- a/newlib/libc/include/stdint.h
+++ b/newlib/libc/include/stdint.h
@@ -9,13 +9,13 @@
#ifndef _STDINT_H
#define _STDINT_H
+#include <_ansi.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#if defined(__GNUC__) && \
- ( (__GNUC__ >= 4) || \
- ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2) ) )
+#if __GNUC_PREREQ (3, 2)
/* gcc > 3.2 implicitly defines the values we are interested */
#define __STDINT_EXP(x) __##x##__
#else
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index 49c81f915..a6528b832 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -4,6 +4,10 @@
#include <machine/ieeefp.h> /* floating point macros */
#include <sys/features.h> /* POSIX defs */
+#ifdef __aarch64__
+#define MALLOC_ALIGNMENT 16
+#endif
+
/* exceptions first */
#if defined(__H8500__) || defined(__W65__)
#define __SMALL_BITFIELDS
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index e7f9c65dd..f150706db 100644
--- a/newlib/libc/include/sys/features.h
+++ b/newlib/libc/include/sys/features.h
@@ -25,6 +25,16 @@
extern "C" {
#endif
+/* Macro to test version of GCC. Returns 0 for non-GCC or too old GCC. */
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+# define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif /* __GNUC_PREREQ */
+
/* RTEMS adheres to POSIX -- 1003.1b with some features from annexes. */
#ifdef __rtems__
diff --git a/newlib/libc/include/tgmath.h b/newlib/libc/include/tgmath.h
index 52fb88685..f9c8311cc 100644
--- a/newlib/libc/include/tgmath.h
+++ b/newlib/libc/include/tgmath.h
@@ -58,8 +58,7 @@
*/
/* requires GCC >= 3.1 */
-#if !defined(__GNUC__) || __GNUC__ < 3 || \
- (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
+#if !__GNUC_PREREQ (3, 1)
#error "<tgmath.h> not implemented for this compiler"
#endif