Skip to content

Commit

Permalink
[core] fix __WORDSIZE for clang
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rurban committed Oct 2, 2017
1 parent 5609285 commit 1f01976
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions include/parrot/compiler.h
@@ -1,15 +1,19 @@
/* compiler.h
* Copyright (C) 2007-2015, Parrot Foundation.
* Copyright (C) 2007-2017, Parrot Foundation.
* Overview:
* defines compiler capabilities and attributes
*/

#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

/*
Expand Down

0 comments on commit 1f01976

Please sign in to comment.