public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/zack/no-nested-includes] Don’t conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
@ 2019-05-26 16:36 Zack Weinberg
0 siblings, 0 replies; 4+ messages in thread
From: Zack Weinberg @ 2019-05-26 16:36 UTC (permalink / raw)
To: glibc-cvs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2449 bytes --]
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=69411ab1f82999d0f99ea02312b1ed40ff1005de
commit 69411ab1f82999d0f99ea02312b1ed40ff1005de
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 21:18:56 2019 -0500
Donât conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
The declarations of ldiv_t, lldiv_t, and __gwchar_t are all wrapped in
__foo_t_defined conditionals, despite there being only one header in
glibc that declares them. I checked codesearch.debian.net and only
found one other program that refers to the __foo_t_defined
conditionals: u-boot provides its own definition of ldiv_t if
__ldiv_t_defined is not defined by stdlib.h. I conclude that the
conditionals are not necessary, but the definitions of
__ldiv_t_defined and __lldiv_t_defined should be preserved.
* stdlib/inttypes.h: Unconditionally define __gwchar_t.
Donât define ____gwchar_t_defined.
* stdlib/stdlib.h: Unconditionally define ldiv_t.
Condition lldiv_t only on __USE_ISOC99.
Diff:
---
stdlib/inttypes.h | 15 ++++++---------
stdlib/stdlib.h | 6 ++----
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/stdlib/inttypes.h b/stdlib/inttypes.h
index ddcb171..c5fb120 100644
--- a/stdlib/inttypes.h
+++ b/stdlib/inttypes.h
@@ -27,17 +27,14 @@
#include <stdint.h>
/* Get a definition for wchar_t. But we must not define wchar_t itself. */
-#ifndef ____gwchar_t_defined
-# ifdef __cplusplus
-# define __gwchar_t wchar_t
-# elif defined __WCHAR_TYPE__
+#ifdef __cplusplus
+# define __gwchar_t wchar_t
+#elif defined __WCHAR_TYPE__
typedef __WCHAR_TYPE__ __gwchar_t;
-# else
-# define __need_wchar_t
-# include <stddef.h>
+#else
+# define __need_wchar_t
+# include <stddef.h>
typedef wchar_t __gwchar_t;
-# endif
-# define ____gwchar_t_defined 1
#endif
# if __WORDSIZE == 64
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index a9fd989..34996e3 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -62,16 +62,14 @@ typedef struct
} div_t;
/* Returned by `ldiv'. */
-#ifndef __ldiv_t_defined
typedef struct
{
long int quot; /* Quotient. */
long int rem; /* Remainder. */
} ldiv_t;
-# define __ldiv_t_defined 1
-#endif
+#define __ldiv_t_defined 1
-#if defined __USE_ISOC99 && !defined __lldiv_t_defined
+#if defined __USE_ISOC99
/* Returned by `lldiv'. */
__extension__ typedef struct
{
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/zack/no-nested-includes] Don’t conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
@ 2020-01-08 19:19 Zack Weinberg
0 siblings, 0 replies; 4+ messages in thread
From: Zack Weinberg @ 2020-01-08 19:19 UTC (permalink / raw)
To: glibc-cvs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2449 bytes --]
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=795eb42e060039b6d624b7e613d8c334ac70580c
commit 795eb42e060039b6d624b7e613d8c334ac70580c
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 21:18:56 2019 -0500
Donât conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
The declarations of ldiv_t, lldiv_t, and __gwchar_t are all wrapped in
__foo_t_defined conditionals, despite there being only one header in
glibc that declares them. I checked codesearch.debian.net and only
found one other program that refers to the __foo_t_defined
conditionals: u-boot provides its own definition of ldiv_t if
__ldiv_t_defined is not defined by stdlib.h. I conclude that the
conditionals are not necessary, but the definitions of
__ldiv_t_defined and __lldiv_t_defined should be preserved.
* stdlib/inttypes.h: Unconditionally define __gwchar_t.
Donât define ____gwchar_t_defined.
* stdlib/stdlib.h: Unconditionally define ldiv_t.
Condition lldiv_t only on __USE_ISOC99.
Diff:
---
stdlib/inttypes.h | 15 ++++++---------
stdlib/stdlib.h | 6 ++----
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/stdlib/inttypes.h b/stdlib/inttypes.h
index 685dfc1..c5ec307 100644
--- a/stdlib/inttypes.h
+++ b/stdlib/inttypes.h
@@ -27,17 +27,14 @@
#include <stdint.h>
/* Get a definition for wchar_t. But we must not define wchar_t itself. */
-#ifndef ____gwchar_t_defined
-# ifdef __cplusplus
-# define __gwchar_t wchar_t
-# elif defined __WCHAR_TYPE__
+#ifdef __cplusplus
+# define __gwchar_t wchar_t
+#elif defined __WCHAR_TYPE__
typedef __WCHAR_TYPE__ __gwchar_t;
-# else
-# define __need_wchar_t
-# include <stddef.h>
+#else
+# define __need_wchar_t
+# include <stddef.h>
typedef wchar_t __gwchar_t;
-# endif
-# define ____gwchar_t_defined 1
#endif
# if __WORDSIZE == 64
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index e347063..9f1f1b8 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -62,16 +62,14 @@ typedef struct
} div_t;
/* Returned by `ldiv'. */
-#ifndef __ldiv_t_defined
typedef struct
{
long int quot; /* Quotient. */
long int rem; /* Remainder. */
} ldiv_t;
-# define __ldiv_t_defined 1
-#endif
+#define __ldiv_t_defined 1
-#if defined __USE_ISOC99 && !defined __lldiv_t_defined
+#if defined __USE_ISOC99
/* Returned by `lldiv'. */
__extension__ typedef struct
{
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/zack/no-nested-includes] Don’t conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
@ 2019-06-26 15:49 Zack Weinberg
0 siblings, 0 replies; 4+ messages in thread
From: Zack Weinberg @ 2019-06-26 15:49 UTC (permalink / raw)
To: glibc-cvs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2449 bytes --]
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dabb83410e18ee27d3446c6628b71fda4c24d5b1
commit dabb83410e18ee27d3446c6628b71fda4c24d5b1
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 21:18:56 2019 -0500
Donât conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
The declarations of ldiv_t, lldiv_t, and __gwchar_t are all wrapped in
__foo_t_defined conditionals, despite there being only one header in
glibc that declares them. I checked codesearch.debian.net and only
found one other program that refers to the __foo_t_defined
conditionals: u-boot provides its own definition of ldiv_t if
__ldiv_t_defined is not defined by stdlib.h. I conclude that the
conditionals are not necessary, but the definitions of
__ldiv_t_defined and __lldiv_t_defined should be preserved.
* stdlib/inttypes.h: Unconditionally define __gwchar_t.
Donât define ____gwchar_t_defined.
* stdlib/stdlib.h: Unconditionally define ldiv_t.
Condition lldiv_t only on __USE_ISOC99.
Diff:
---
stdlib/inttypes.h | 15 ++++++---------
stdlib/stdlib.h | 6 ++----
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/stdlib/inttypes.h b/stdlib/inttypes.h
index ddcb171..c5fb120 100644
--- a/stdlib/inttypes.h
+++ b/stdlib/inttypes.h
@@ -27,17 +27,14 @@
#include <stdint.h>
/* Get a definition for wchar_t. But we must not define wchar_t itself. */
-#ifndef ____gwchar_t_defined
-# ifdef __cplusplus
-# define __gwchar_t wchar_t
-# elif defined __WCHAR_TYPE__
+#ifdef __cplusplus
+# define __gwchar_t wchar_t
+#elif defined __WCHAR_TYPE__
typedef __WCHAR_TYPE__ __gwchar_t;
-# else
-# define __need_wchar_t
-# include <stddef.h>
+#else
+# define __need_wchar_t
+# include <stddef.h>
typedef wchar_t __gwchar_t;
-# endif
-# define ____gwchar_t_defined 1
#endif
# if __WORDSIZE == 64
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index a9fd989..34996e3 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -62,16 +62,14 @@ typedef struct
} div_t;
/* Returned by `ldiv'. */
-#ifndef __ldiv_t_defined
typedef struct
{
long int quot; /* Quotient. */
long int rem; /* Remainder. */
} ldiv_t;
-# define __ldiv_t_defined 1
-#endif
+#define __ldiv_t_defined 1
-#if defined __USE_ISOC99 && !defined __lldiv_t_defined
+#if defined __USE_ISOC99
/* Returned by `lldiv'. */
__extension__ typedef struct
{
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/zack/no-nested-includes] Don’t conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
@ 2019-06-18 15:34 Zack Weinberg
0 siblings, 0 replies; 4+ messages in thread
From: Zack Weinberg @ 2019-06-18 15:34 UTC (permalink / raw)
To: glibc-cvs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2449 bytes --]
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7c43c50e574ce861b619205883360bfd21b09ede
commit 7c43c50e574ce861b619205883360bfd21b09ede
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 21:18:56 2019 -0500
Donât conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
The declarations of ldiv_t, lldiv_t, and __gwchar_t are all wrapped in
__foo_t_defined conditionals, despite there being only one header in
glibc that declares them. I checked codesearch.debian.net and only
found one other program that refers to the __foo_t_defined
conditionals: u-boot provides its own definition of ldiv_t if
__ldiv_t_defined is not defined by stdlib.h. I conclude that the
conditionals are not necessary, but the definitions of
__ldiv_t_defined and __lldiv_t_defined should be preserved.
* stdlib/inttypes.h: Unconditionally define __gwchar_t.
Donât define ____gwchar_t_defined.
* stdlib/stdlib.h: Unconditionally define ldiv_t.
Condition lldiv_t only on __USE_ISOC99.
Diff:
---
stdlib/inttypes.h | 15 ++++++---------
stdlib/stdlib.h | 6 ++----
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/stdlib/inttypes.h b/stdlib/inttypes.h
index ddcb171..c5fb120 100644
--- a/stdlib/inttypes.h
+++ b/stdlib/inttypes.h
@@ -27,17 +27,14 @@
#include <stdint.h>
/* Get a definition for wchar_t. But we must not define wchar_t itself. */
-#ifndef ____gwchar_t_defined
-# ifdef __cplusplus
-# define __gwchar_t wchar_t
-# elif defined __WCHAR_TYPE__
+#ifdef __cplusplus
+# define __gwchar_t wchar_t
+#elif defined __WCHAR_TYPE__
typedef __WCHAR_TYPE__ __gwchar_t;
-# else
-# define __need_wchar_t
-# include <stddef.h>
+#else
+# define __need_wchar_t
+# include <stddef.h>
typedef wchar_t __gwchar_t;
-# endif
-# define ____gwchar_t_defined 1
#endif
# if __WORDSIZE == 64
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index a9fd989..34996e3 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -62,16 +62,14 @@ typedef struct
} div_t;
/* Returned by `ldiv'. */
-#ifndef __ldiv_t_defined
typedef struct
{
long int quot; /* Quotient. */
long int rem; /* Remainder. */
} ldiv_t;
-# define __ldiv_t_defined 1
-#endif
+#define __ldiv_t_defined 1
-#if defined __USE_ISOC99 && !defined __lldiv_t_defined
+#if defined __USE_ISOC99
/* Returned by `lldiv'. */
__extension__ typedef struct
{
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-08 19:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-26 16:36 [glibc/zack/no-nested-includes] Don’t conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t Zack Weinberg
2019-06-18 15:34 Zack Weinberg
2019-06-26 15:49 Zack Weinberg
2020-01-08 19:19 Zack Weinberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).