[PATCH] Check for the __APPLE__ preprocessor macro additionally to __MACH__.
Dmitri Gribenko
gribozavr at gmail.com
Mon Mar 25 10:12:41 PDT 2013
On Mon, Mar 25, 2013 at 6:07 PM, Thomas Schwinge
<thomas at codesourcery.com> wrote:
> __MACH__ is defined for GNU/Hurd, too.
> ---
> SingleSource/UnitTests/ms_struct-bitfield-init-1.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git SingleSource/UnitTests/ms_struct-bitfield-init-1.c SingleSource/UnitTests/ms_struct-bitfield-init-1.c
> index 237ff54..90ca791 100644
> --- SingleSource/UnitTests/ms_struct-bitfield-init-1.c
> +++ SingleSource/UnitTests/ms_struct-bitfield-init-1.c
> @@ -3,7 +3,8 @@
> #define ATTR __attribute__((__ms_struct__))
>
> // GCC only implements #pragma ms_struct on Darwin.
> -#define HAVE_PRAGMA_MS_STRUCT (defined(__clang__) || defined(__MACH__))
> +#define HAVE_PRAGMA_MS_STRUCT (defined(__clang__) || \
> + defined(__APPLE__) && defined(__MACH__))
I think you can drop defined(__MACH__) here. IIRC, defined(__APPLE__)
is used as a condition for Darwin in the rest of the codebase.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
More information about the llvm-commits
mailing list