* libc/include/stdint.h: Include <sys/_intsup.h>.
        (__STDINT_EXP): Delete.
        (__have_long32): Likewise.
        (__have_long64): Likewise.
        (__have_longlong64): Likewise.
        * libc/include/sys/_intsup.h: New file.
        (__STDINT_EXP): Move from libc/include/stdint.h.
        (__have_long32): Likewise.
        (__have_long64): Likewise.
        (__have_longlong64): Likewise.
        * libc/include/inttypes.h: Include <sys/_intsup.h>.
        (__INTTYPES_EXP): Delete and use __STDINT_EXP() instead.
This commit is contained in:
Jeff Johnston
2014-10-09 15:57:50 +00:00
parent 0613efefc7
commit 50f799240e
4 changed files with 55 additions and 34 deletions

View File

@ -13,20 +13,11 @@
#ifndef _INTTYPES_H
#define _INTTYPES_H
#include <sys/features.h>
#include <sys/_intsup.h>
#include <stdint.h>
#define __need_wchar_t
#include <stddef.h>
/* Don't use __STDINT_EXP test since GCC's stdint.h provides different
macros than newlib's stdint.h. */
#if __GNUC_PREREQ(3, 2)
#define __INTTYPES_EXP(x) __##x##__
#else
#define __INTTYPES_EXP(x) x
#include <limits.h>
#endif
#define __STRINGIFY(a) #a
/* 8-bit types */
@ -252,10 +243,10 @@
#define SCNxMAX __SCNMAX(x)
/* ptr types */
#if PTRDIFF_MAX <= __INTTYPES_EXP(INT_MAX)
#if PTRDIFF_MAX <= __STDINT_EXP(INT_MAX)
# define __PRIPTR(x) __STRINGIFY(x)
# define __SCNPTR(x) __STRINGIFY(x)
#elif PTRDIFF_MAX <= __INTTYPES_EXP(LONG_MAX) || !defined(__have_longlong64)
#elif PTRDIFF_MAX <= __STDINT_EXP(LONG_MAX) || !defined(__have_longlong64)
# define __PRIPTR(x) __STRINGIFY(l##x)
# define __SCNPTR(x) __STRINGIFY(l##x)
#else