Remove __STDC_FORMAT/CONSTANT_MACROS
These were added in C99 to avoid interferring with C++, but then C++11 caught up with inttypes/h/stdint.h and removed the need for the macros. They have disappeared from C11 as a result, and also from current glibc implementation (https://sourceware.org/bugzilla/show_bug.cgi?id=15366) So it seems reasonably safe to do the same, and it will save people having to enable access to these macros explicitly when writing C++.
This commit is contained in:
parent
5721d1791e
commit
36576214eb
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 Haiku, Inc. All rights reserved.
|
* Copyright 2002-2017 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _INTTYPES_H_
|
#ifndef _INTTYPES_H_
|
||||||
@ -14,7 +14,6 @@ typedef struct {
|
|||||||
intmax_t rem; /* remainder */
|
intmax_t rem; /* remainder */
|
||||||
} imaxdiv_t;
|
} imaxdiv_t;
|
||||||
|
|
||||||
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
|
|
||||||
/* fprintf() macros for signed integers */
|
/* fprintf() macros for signed integers */
|
||||||
# define PRId8 "d"
|
# define PRId8 "d"
|
||||||
# define PRIdLEAST8 "d"
|
# define PRIdLEAST8 "d"
|
||||||
@ -192,7 +191,6 @@ typedef struct {
|
|||||||
# define SCNoPTR __HAIKU_PRI_PREFIX_ADDR "o"
|
# define SCNoPTR __HAIKU_PRI_PREFIX_ADDR "o"
|
||||||
# define SCNxMAX SCNx64
|
# define SCNxMAX SCNx64
|
||||||
# define SCNxPTR __HAIKU_PRI_PREFIX_ADDR "x"
|
# define SCNxPTR __HAIKU_PRI_PREFIX_ADDR "x"
|
||||||
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2012 Haiku, Inc. All Rights Reserved.
|
* Copyright 2003-2017 Haiku, Inc. All Rights Reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _STDINT_H_
|
#ifndef _STDINT_H_
|
||||||
@ -135,8 +135,6 @@ typedef uint64_t uintmax_t;
|
|||||||
#define WINT_MAX ((wint_t)-1)
|
#define WINT_MAX ((wint_t)-1)
|
||||||
|
|
||||||
|
|
||||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
|
|
||||||
|
|
||||||
/* Macros of Integer Constant Expressions */
|
/* Macros of Integer Constant Expressions */
|
||||||
#define INT8_C(value) value
|
#define INT8_C(value) value
|
||||||
#define INT16_C(value) value
|
#define INT16_C(value) value
|
||||||
@ -158,8 +156,6 @@ typedef uint64_t uintmax_t;
|
|||||||
#define UINTMAX_C(value) value ## ULL
|
#define UINTMAX_C(value) value ## ULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
|
|
||||||
|
|
||||||
|
|
||||||
/* BSD compatibility */
|
/* BSD compatibility */
|
||||||
typedef uint8_t u_int8_t;
|
typedef uint8_t u_int8_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user