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:
Adrien Destugues 2017-06-04 17:29:29 +02:00
parent 5721d1791e
commit 36576214eb
2 changed files with 2 additions and 8 deletions

View File

@ -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.
*/
#ifndef _INTTYPES_H_
@ -14,7 +14,6 @@ typedef struct {
intmax_t rem; /* remainder */
} imaxdiv_t;
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
/* fprintf() macros for signed integers */
# define PRId8 "d"
# define PRIdLEAST8 "d"
@ -192,7 +191,6 @@ typedef struct {
# define SCNoPTR __HAIKU_PRI_PREFIX_ADDR "o"
# define SCNxMAX SCNx64
# define SCNxPTR __HAIKU_PRI_PREFIX_ADDR "x"
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
#ifdef __cplusplus

View File

@ -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.
*/
#ifndef _STDINT_H_
@ -135,8 +135,6 @@ typedef uint64_t uintmax_t;
#define WINT_MAX ((wint_t)-1)
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
/* Macros of Integer Constant Expressions */
#define INT8_C(value) value
#define INT16_C(value) value
@ -158,8 +156,6 @@ typedef uint64_t uintmax_t;
#define UINTMAX_C(value) value ## ULL
#endif
#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
/* BSD compatibility */
typedef uint8_t u_int8_t;