Commit graph

21 commits

Author SHA1 Message Date
Elliott Hughes
83c07b5e50 Fix WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.
GCC tells us everything we need to know. clang does its usual half-assed job.

Change-Id: Id4d664529b10345274602768cd564d3df717e931
2014-04-21 18:09:46 -07:00
Calin Juravle
da030de702 Fixed int fast types for LP64
Bug: 13110474
Change-Id: Id5591603ad4ba7e149c0852f4abb25e4e5a5d065
2014-02-21 16:27:21 +00:00
Elliott Hughes
9f87a0b285 Remove <sys/_types.h>.
Bug: 12213562
Change-Id: I0d10664f9da60739bdbad0408be0dd61eea3c1fe
2014-02-07 14:55:58 -08:00
Elliott Hughes
e2a292d278 Remove __STDC_FORMAT_MACROS and __STDC_LIMIT_MACROS guards (and fix SIZE_MAX for LP64).
The various committees decided that everyone should get all these macros,
all the time.

Bug: 12708004
Change-Id: Ib56010dcba9b0656e5701546fefb7f78dc0bf916
2014-01-24 16:38:07 -08:00
Serban Constantinescu
debc021491 AArch64: Fix definitions for STDINT_LIMITS
This patches fixes the definitions for STDINT_LIMITS on __LP64__
systems.

Change-Id: I5eb1664e9ef7c303432a2b041c99cec663816b75
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-10-22 12:40:16 -07:00
Elliott Hughes
5e72c513bf Remove #define _BITSIZE 32.
I've no idea what _BITSIZE was supposed to be, glibc doesn't have it,
the BSDs don't have it, and no code is currently using it. But having
it set unconditionally to 32 sounds like a bad idea.

Change-Id: I900235c1489afba891fff0bc3b43e9d593249a4f
2013-10-02 09:23:46 -07:00
Elliott Hughes
a9a02acc9f Fix inttypes.h and stdint.h for 64-bit (and C++11).
Change-Id: I394630348413c9aafcac137ce1ca5f0a93d9ab6f
2013-09-30 14:46:47 -07:00
Pavel Chupin
0a9c615a89 Fix stdint.h intptr_t/uintptr_t for x86_64/x32
Patch is required in NDK headers as well to be able to build multilib
GCC with libgomp support.
It's here: https://android-review.googlesource.com/#/c/62982

Change-Id: I2bec25d8cbca0e5ef1a0857008ececd92f4911be
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-08-02 19:23:37 +04:00
Sergey Melnikov
dc5d3426d8 stdint.h header is not fully compatible with C99(ISO9899:1999)
stdint.h provides macros with incorrect type:
  * UINT8_C
  * UINT16_C
  * UINT8_MAX
  * UINT16_MAX

Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
Change-Id: I2d130c782d4485bf6c9e9f068de0bdaa4ba7303f
2013-06-19 12:33:31 +04:00
Elliott Hughes
7c89506e3a Ensure that <stdint.h> defines SIZE_MAX and friends.
We were missing SIG_ATOMIC_MAX, SIG_ATOMIC_MIN, SIZE_MAX,
WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.

Change-Id: I2535f36bc220fbaea009b483599b7af811c4cb5c
2013-06-13 16:02:53 -07:00
Elliott Hughes
9248d3a58c Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work."
This reverts commit d8627af159 which caused build breakage:

In file included from bionic/libc/include/limits.h:86:0,
                 from bionic/libc/include/stdint.h:33,
                 from bionic/libc/arch-arm/bionic/crtbegin.c:31:
bionic/libc/include/sys/limits.h:30:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
make: *** [out/target/product/generic/obj/lib/crtbegin_dynamic1.o] Error 1

Change-Id: I128095ecb99df92626e1f57e34c61e08c98a4078
2013-06-12 22:18:47 +00:00
Elliott Hughes
d8627af159 Add SIZE_MAX to <stdint.h> in a way that might actually work.
Take two.

Change-Id: I7d08b6d14c82a171312a7f5898270b4441d5cfa2
2013-06-12 14:54:16 -07:00
Elliott Hughes
2c157aec9b <stdint.h> should expose SIZE_MAX.
Change-Id: Id27222c24955c83f29ad953933cbdc48b6f1e900
2013-06-12 10:28:26 -07:00
Elliott Hughes
3975cec694 Remove (near-)duplicate definitions of size_t and ssize_t.
The near duplicates upset fussier compilers that insist that
typedefs be exactly the same, but the fix isn't to make all
copies identical...

Change-Id: Icfdace41726f36ec33c9ae919dbb5a54d3529cc9
2012-11-29 17:25:23 -08:00
Elliott Hughes
6d6731adc0 Always define the 64-bit int types.
These preprocessor tricks have caused trouble for -std=gnu99 and -ansi, and
both netbsd's libc and glibc seem to unconditionally define these types.

Change-Id: Ib8dffa341a8ca88f80d275ba2b7f93a4c910ee32
2012-08-17 14:30:06 -07:00
David 'Digit' Turner
8b3cea6732 libc: <stdint.h>: Don't make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined.
Change-Id: I8b0ea266eab9c6f75d8407b704953ecaef948221
2011-03-11 14:39:05 +01:00
David 'Digit' Turner
0e5411b4ba libc: <stdint.h>: fix typo in INTMAX_C()/UINTMAX_C() definition
Change-Id: I3c74269901a288c448734dd7eb442a62b9348db8
2011-03-10 20:35:17 +01:00
David 'Digit' Turner
08ff1a6474 libc: <stdint.h>: Proper C++
This patch prevents the definition of various macros when <stdint.h> is
included from C++. The ISO C99 standard mentions that when this header
is included from a C++ source file, limit and constant related macros
should only be defined when asked explicitely by defining
__STDC_LIMIT_MACROS and __STD_CONSTANT_MACROS, respectively.

The <stdint.h> lacked the proper #ifdef .. #endif blocks for the
following macros:

    INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX
    INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX,
    INPTR_C, UINTPR_C, PTRDIFF_C, INTMAX_C, UINTMAX_C

This is intended to fix http://code.google.com/p/android/issues/detail?id=14380
after we copy this file to development/ndk/platforms/android-3/include/

Change-Id: Ia77e0822edfaaf568ea599d7de673b310eeeaa4a
2011-03-10 18:02:01 +01:00
Martin Storsjo
c88110e284 Define 64 bit types if compiling with -std=c99
Compiling with -std=c99 defines __STRICT_ANSI__, but the 64 bit types
and type macros should still be defined in this case.

This helps compiling third party code that needs -std=c99 with the NDK.
2009-09-14 16:45:50 +02:00
The Android Open Source Project
4e468ed2eb Code drop from //branches/cupcake/...@124589 2008-12-17 18:03:48 -08:00
The Android Open Source Project
a27d2baa0c Initial Contribution 2008-10-21 07:00:00 -07:00