>From c40d58b812d4022552a7b2b34575bf8e04682bf0 Mon Sep 17 00:00:00 2001 From: Peter Bex
Date: Sat, 17 Aug 2013 20:27:28 +0200 Subject: [PATCH] Clean up 64-bit detection logic, for C_SIXTY_FOUR and C_LLP (fixes #979) Also add some notes about C_NONUNIX being misleading and the check around unistd.h, inttypes.h and sys/types being very unsemantical (it's completely unclear what's being checked there). --- chicken.h | 21 +++++++++------------ runtime.c | 1 + 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/chicken.h b/chicken.h index d828a66..044ddde 100644 --- a/chicken.h +++ b/chicken.h @@ -61,16 +61,8 @@ /* Kind of platform */ -#ifndef C_SIXTY_FOUR -# if defined (__alpha__) || defined(__ia64__) || defined(__x86_64__) || defined(__LP64__) || defined(__powerpc64__) -# define C_SIXTY_FOUR -# elif (defined(__sparc_v9__) || defined(__sparcv9)) && defined(__arch64__) -# define C_SIXTY_FOUR -# elif defined(__mips64) && (!defined(__GNUC__) || _MIPS_SZPTR == 64) -# define C_SIXTY_FOUR -# elif defined(__MINGW64__) -# define C_SIXTY_FOUR -# endif +#if defined(__LP64__) || defined(_LP64) || defined(__MINGW64__) || defined(_WIN64) +# define C_SIXTY_FOUR #endif #if defined(__APPLE__) && defined(__MACH__) @@ -86,6 +78,10 @@ #endif #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__MWERKS__) +/* + * XXX This should probably be renamed or changed because it's misleading. + * For example, Haiku is not a Unix either, but this doesn't get defined there. + */ # define C_NONUNIX #endif @@ -93,7 +89,7 @@ # define C_SOLARIS #endif -#ifdef __MINGW64__ +#if defined(__MINGW64__) || defined(_WIN64) # define C_LLP #endif @@ -110,6 +106,7 @@ #include