X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=lib%2Fstdint.in.h;fp=lib%2Fstdint.in.h;h=cf65ec62e975d168a39cb4e57c18e491539d009f;hb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;hp=2db8b2e378b0ee6082ccf28db06c72c99217c992;hpb=d57728a6ca2413a7c564d8b7bb13d9e5a5a180f3;p=debian%2Fgzip diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 2db8b2e..cf65ec6 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2013 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2016 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -38,8 +38,7 @@ other system header files; just include the system's . Ideally we should test __BIONIC__ here, but it is only defined after has been included; hence test __ANDROID__ instead. */ -#if defined __ANDROID__ \ - && defined _SYS_TYPES_H_ && !defined __need_size_t +#if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H # @INCLUDE_NEXT@ @NEXT_STDINT_H@ #else @@ -119,15 +118,10 @@ picky compilers. */ #define _STDINT_MIN(signed, bits, zero) \ - ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) + ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero)) #define _STDINT_MAX(signed, bits, zero) \ - ((signed) \ - ? ~ _STDINT_MIN (signed, bits, zero) \ - : /* The expression for the unsigned case. The subtraction of (signed) \ - is a nop in the unsigned case and avoids "signed integer overflow" \ - warnings in the signed case. */ \ - ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) + (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) #if !GNULIB_defined_stdint_types @@ -289,12 +283,17 @@ typedef gl_uint_fast32_t gl_uint_fast16_t; /* 7.18.1.4. Integer types capable of holding object pointers */ +/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own + definitions of intptr_t and uintptr_t (which use int and unsigned) + to avoid clashes with declarations of system functions like sbrk. */ +#ifndef _INTPTR_T_DECLARED #undef intptr_t #undef uintptr_t typedef long int gl_intptr_t; typedef unsigned long int gl_uintptr_t; #define intptr_t gl_intptr_t #define uintptr_t gl_uintptr_t +#endif /* 7.18.1.5. Greatest-width integer types */