From 1f01976e0058193c31f15a82e7b5b176ade7f625 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Sun, 1 Oct 2017 15:26:55 +0200 Subject: [PATCH] [core] fix __WORDSIZE for clang Some clang's do not parse sizeof(void*) * 8, darwin and here esp. freebsd clang-4. Thanksfully clang uses their own macro __SIZE_WIDTH__ for the GCC extension __WORDSIZE. See GH #1238 --- include/parrot/compiler.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/parrot/compiler.h b/include/parrot/compiler.h index 6a689304cf..e7de4b88cc 100644 --- a/include/parrot/compiler.h +++ b/include/parrot/compiler.h @@ -1,5 +1,5 @@ /* compiler.h - * Copyright (C) 2007-2015, Parrot Foundation. + * Copyright (C) 2007-2017, Parrot Foundation. * Overview: * defines compiler capabilities and attributes */ @@ -7,9 +7,13 @@ #ifndef PARROT_COMPILER_H_GUARD #define PARROT_COMPILER_H_GUARD -/* darwin clang! */ +/* clang on darwin/freebsd */ #ifndef __WORDSIZE -# define __WORDSIZE (sizeof(void*) * 8) +# ifdef __SIZE_WIDTH__ +# define __WORDSIZE __SIZE_WIDTH__ +# else +# define __WORDSIZE (8 * sizeof void*) +# endif #endif /*