From 1460c0bbb7fbb9f4a019d1d97cdc2bb79c9e2833 Mon Sep 17 00:00:00 2001 From: Gerald Pfeifer Date: Sun, 25 Aug 2019 22:25:23 +0000 Subject: [PATCH] gmm_malloc.h: Only use and errno if __STDC_HOSTED__. * config/i386/gmm_malloc.h: Only use and errno if __STDC_HOSTED__. From-SVN: r274915 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/gmm_malloc.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 989dff795f7..f7519204782 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-08-26 Gerald Pfeifer + + * config/i386/gmm_malloc.h: Only use and errno if + __STDC_HOSTED__. + 2019-08-23 Mihailo Stojanovic * config/mips/mips.md (mips_get_fcsr, *mips_get_fcsr): Use SI diff --git a/gcc/config/i386/gmm_malloc.h b/gcc/config/i386/gmm_malloc.h index b9886555956..cfe6046ec33 100644 --- a/gcc/config/i386/gmm_malloc.h +++ b/gcc/config/i386/gmm_malloc.h @@ -25,7 +25,9 @@ #define _MM_MALLOC_H_INCLUDED #include +#if __STDC_HOSTED__ #include +#endif static __inline__ void * _mm_malloc (size_t __size, size_t __align) @@ -36,7 +38,9 @@ _mm_malloc (size_t __size, size_t __align) /* Error if align is not a power of two. */ if (__align & (__align - 1)) { +#if __STDC_HOSTED__ errno = EINVAL; +#endif return ((void *) 0); } -- 2.30.2