From 7bdf11c2c611a5d8a5171c188461ff267fd555b6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 21 Nov 2012 13:29:50 -0500 Subject: [PATCH] fix powerpc types to match abi, and some feature test issues --- arch/powerpc/bits/alltypes.h.sh | 11 ++++++----- arch/powerpc/bits/limits.h | 2 +- arch/powerpc/bits/mman.h | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/bits/alltypes.h.sh b/arch/powerpc/bits/alltypes.h.sh index 9b616772..befad081 100755 --- a/arch/powerpc/bits/alltypes.h.sh +++ b/arch/powerpc/bits/alltypes.h.sh @@ -16,9 +16,10 @@ union \1 \2;\ #endif\ /' -TYPEDEF unsigned int size_t; -TYPEDEF long ssize_t; -TYPEDEF long ptrdiff_t; +TYPEDEF unsigned size_t; +TYPEDEF int ssize_t; +TYPEDEF int ptrdiff_t; + TYPEDEF __builtin_va_list va_list; #ifndef __cplusplus @@ -52,8 +53,8 @@ TYPEDEF unsigned int uint_fast16_t; TYPEDEF unsigned int uint_fast32_t; TYPEDEF uint64_t uint_fast64_t; -TYPEDEF long intptr_t; -TYPEDEF unsigned long uintptr_t; +TYPEDEF int intptr_t; +TYPEDEF unsigned uintptr_t; TYPEDEF float float_t; TYPEDEF double double_t; diff --git a/arch/powerpc/bits/limits.h b/arch/powerpc/bits/limits.h index e19461df..65a3dd64 100644 --- a/arch/powerpc/bits/limits.h +++ b/arch/powerpc/bits/limits.h @@ -1,5 +1,5 @@ #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define PAGE_SIZE 4096 #define LONG_BIT 32 #endif diff --git a/arch/powerpc/bits/mman.h b/arch/powerpc/bits/mman.h index 302044eb..03f961e8 100644 --- a/arch/powerpc/bits/mman.h +++ b/arch/powerpc/bits/mman.h @@ -30,7 +30,7 @@ #define MCL_CURRENT 1 #define MCL_FUTURE 2 -#ifdef _GNU_SOURCE +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define MADV_NORMAL 0 #define MADV_RANDOM 1 #define MADV_SEQUENTIAL 2