public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Revert "sys/types.h: Don't include sys/_stdint.h"
@ 2022-05-04 13:49 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2022-05-04 13:49 UTC (permalink / raw)
  To: cygwin-cvs, newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a404165959f9fcadf690fb40aabc2364bc2b4e4e

commit a404165959f9fcadf690fb40aabc2364bc2b4e4e
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed May 4 15:08:44 2022 +0200

    Revert "sys/types.h: Don't include sys/_stdint.h"
    
    This reverts commit 4232d171a620662aaed650879936eac60aefd9e0.

Diff:
---
 newlib/libc/include/machine/ieee.h      | 98 ++++++++++++++++-----------------
 newlib/libc/include/sys/time.h          | 44 +++++++--------
 newlib/libc/include/sys/types.h         |  2 +-
 newlib/libc/stdlib/arc4random_uniform.c |  1 -
 winsup/cygserver/bsd_helper.h           |  1 -
 winsup/cygwin/gcrt0.c                   |  1 -
 winsup/cygwin/include/cygwin/in.h       | 16 +++---
 winsup/cygwin/include/cygwin/socket.h   |  8 +--
 winsup/cygwin/include/sys/dirent.h      |  4 +-
 winsup/cygwin/winsup.h                  |  1 -
 10 files changed, 86 insertions(+), 90 deletions(-)

diff --git a/newlib/libc/include/machine/ieee.h b/newlib/libc/include/machine/ieee.h
index 251d3036a..0656909ab 100644
--- a/newlib/libc/include/machine/ieee.h
+++ b/newlib/libc/include/machine/ieee.h
@@ -12,21 +12,21 @@
 } while (0)
 #ifdef __IEEE_LITTLE_ENDIAN
 struct ieee_ext {
-    __uint32_t   ext_frac:23;
-    __uint32_t   ext_exp:8;
-    __uint32_t   ext_sign:1;
+    uint32_t   ext_frac:23;
+    uint32_t   ext_exp:8;
+    uint32_t   ext_sign:1;
 };
 #endif
 #ifdef __IEEE_BIG_ENDIAN
 struct ieee_ext {
 #ifndef ___IEEE_BYTES_LITTLE_ENDIAN
-    __uint32_t   ext_sign:1;
-    __uint32_t   ext_exp:8;
-    __uint32_t   ext_frac:23;
+    uint32_t   ext_sign:1;
+    uint32_t   ext_exp:8;
+    uint32_t   ext_frac:23;
 #else /* ARMEL without __VFP_FP__ */
-    __uint32_t   ext_frac:23;
-    __uint32_t   ext_exp:8;
-    __uint32_t   ext_sign:1;
+    uint32_t   ext_frac:23;
+    uint32_t   ext_exp:8;
+    uint32_t   ext_sign:1;
 #endif
 };
 #endif
@@ -38,24 +38,24 @@ struct ieee_ext {
 } while (0)
 #ifdef __IEEE_LITTLE_ENDIAN
 struct ieee_ext {
-    __uint32_t   ext_fracl;
-    __uint32_t   ext_frach:20;
-    __uint32_t   ext_exp:11;
-    __uint32_t   ext_sign:1;
+    uint32_t   ext_fracl;
+    uint32_t   ext_frach:20;
+    uint32_t   ext_exp:11;
+    uint32_t   ext_sign:1;
 };
 #endif
 #ifdef __IEEE_BIG_ENDIAN
 struct ieee_ext {
 #ifndef ___IEEE_BYTES_LITTLE_ENDIAN
-    __uint32_t   ext_sign:1;
-    __uint32_t   ext_exp:11;
-    __uint32_t   ext_frach:20;
+    uint32_t   ext_sign:1;
+    uint32_t   ext_exp:11;
+    uint32_t   ext_frach:20;
 #else /* ARMEL without __VFP_FP__ */
-    __uint32_t   ext_frach:20;
-    __uint32_t   ext_exp:11;
-    __uint32_t   ext_sign:1;
+    uint32_t   ext_frach:20;
+    uint32_t   ext_exp:11;
+    uint32_t   ext_sign:1;
 #endif
-    __uint32_t   ext_fracl;
+    uint32_t   ext_fracl;
 };
 #endif
 #elif LDBL_MANT_DIG == 64
@@ -65,27 +65,27 @@ struct ieee_ext {
 } while (0)
 #ifdef __IEEE_LITTLE_ENDIAN /* for Intel CPU */
 struct ieee_ext {
-    __uint32_t   ext_fracl;
-    __uint32_t   ext_frach;
-    __uint32_t   ext_exp:15;
-    __uint32_t   ext_sign:1;
-    __uint32_t   ext_padl:16;
-    __uint32_t   ext_padh;
+    uint32_t   ext_fracl;
+    uint32_t   ext_frach;
+    uint32_t   ext_exp:15;
+    uint32_t   ext_sign:1;
+    uint32_t   ext_padl:16;
+    uint32_t   ext_padh;
 };
 #endif
 #ifdef __IEEE_BIG_ENDIAN
 struct ieee_ext {
 #ifndef ___IEEE_BYTES_LITTLE_ENDIAN /* for m68k */
-    __uint32_t   ext_sign:1;
-    __uint32_t   ext_exp:15;
-    __uint32_t   ext_pad:16;
+    uint32_t   ext_sign:1;
+    uint32_t   ext_exp:15;
+    uint32_t   ext_pad:16;
 #else /* ARM FPA10 math coprocessor */
-    __uint32_t   ext_exp:15;
-    __uint32_t   ext_pad:16;
-    __uint32_t   ext_sign:1;
+    uint32_t   ext_exp:15;
+    uint32_t   ext_pad:16;
+    uint32_t   ext_sign:1;
 #endif
-    __uint32_t   ext_frach;
-    __uint32_t   ext_fracl;
+    uint32_t   ext_frach;
+    uint32_t   ext_fracl;
 };
 #endif
 #elif LDBL_MANT_DIG == 113
@@ -98,28 +98,28 @@ struct ieee_ext {
 } while (0)
 #ifdef __IEEE_LITTLE_ENDIAN
 struct ieee_ext {
-    __uint32_t   ext_fracl;
-    __uint32_t   ext_fraclm;
-    __uint32_t   ext_frachm;
-    __uint32_t   ext_frach:16;
-    __uint32_t   ext_exp:15;
-    __uint32_t   ext_sign:1;
+    uint32_t   ext_fracl;
+    uint32_t   ext_fraclm;
+    uint32_t   ext_frachm;
+    uint32_t   ext_frach:16;
+    uint32_t   ext_exp:15;
+    uint32_t   ext_sign:1;
 };
 #endif
 #ifdef __IEEE_BIG_ENDIAN
 struct ieee_ext {
 #ifndef ___IEEE_BYTES_LITTLE_ENDIAN
-    __uint32_t   ext_sign:1;
-    __uint32_t   ext_exp:15;
-    __uint32_t   ext_frach:16;
+    uint32_t   ext_sign:1;
+    uint32_t   ext_exp:15;
+    uint32_t   ext_frach:16;
 #else /* ARMEL without __VFP_FP__ */
-    __uint32_t   ext_frach:16;
-    __uint32_t   ext_exp:15;
-    __uint32_t   ext_sign:1;
+    uint32_t   ext_frach:16;
+    uint32_t   ext_exp:15;
+    uint32_t   ext_sign:1;
 #endif
-    __uint32_t   ext_frachm;
-    __uint32_t   ext_fraclm;
-    __uint32_t   ext_fracl;
+    uint32_t   ext_frachm;
+    uint32_t   ext_fraclm;
+    uint32_t   ext_fracl;
 };
 #endif
 #endif
diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h
index 0d68ab8ab..5a3dec7ab 100644
--- a/newlib/libc/include/sys/time.h
+++ b/newlib/libc/include/sys/time.h
@@ -64,13 +64,13 @@ struct timezone {
 #if __BSD_VISIBLE
 struct bintime {
 	time_t	sec;
-	__uint64_t frac;
+	uint64_t frac;
 };
 
 static __inline void
-bintime_addx(struct bintime *_bt, __uint64_t _x)
+bintime_addx(struct bintime *_bt, uint64_t _x)
 {
-	__uint64_t _u;
+	uint64_t _u;
 
 	_u = _bt->frac;
 	_bt->frac += _x;
@@ -81,7 +81,7 @@ bintime_addx(struct bintime *_bt, __uint64_t _x)
 static __inline void
 bintime_add(struct bintime *_bt, const struct bintime *_bt2)
 {
-	__uint64_t _u;
+	uint64_t _u;
 
 	_u = _bt->frac;
 	_bt->frac += _bt2->frac;
@@ -93,7 +93,7 @@ bintime_add(struct bintime *_bt, const struct bintime *_bt2)
 static __inline void
 bintime_sub(struct bintime *_bt, const struct bintime *_bt2)
 {
-	__uint64_t _u;
+	uint64_t _u;
 
 	_u = _bt->frac;
 	_bt->frac -= _bt2->frac;
@@ -105,7 +105,7 @@ bintime_sub(struct bintime *_bt, const struct bintime *_bt2)
 static __inline void
 bintime_mul(struct bintime *_bt, u_int _x)
 {
-	__uint64_t _p1, _p2;
+	uint64_t _p1, _p2;
 
 	_p1 = (_bt->frac & 0xffffffffull) * _x;
 	_p2 = (_bt->frac >> 32) * _x + (_p1 >> 32);
@@ -124,7 +124,7 @@ bintime_shift(struct bintime *_bt, int _exp)
 		_bt->frac <<= _exp;
 	} else if (_exp < 0) {
 		_bt->frac >>= -_exp;
-		_bt->frac |= (__uint64_t)_bt->sec << (64 + _exp);
+		_bt->frac |= (uint64_t)_bt->sec << (64 + _exp);
 		_bt->sec >>= -_exp;
 	}
 }
@@ -184,14 +184,14 @@ sbttobt(sbintime_t _sbt)
  *	((unit * 2^63 / SIFACTOR) + 2^31-1) >> 32
  * and use pre-computed constants that are the ceil of the 2^63 / SIFACTOR
  * term to ensure we are using exactly the right constant. We use the lesser
- * evil of ull rather than a __uint64_t cast to ensure we have well defined
+ * evil of ull rather than a uint64_t cast to ensure we have well defined
  * right shift semantics. With these changes, we get all the ns, us and ms
  * conversions back and forth right.
  */
-static __inline __int64_t
+static __inline int64_t
 sbttons(sbintime_t _sbt)
 {
-	__uint64_t ns;
+	uint64_t ns;
 
 	ns = _sbt;
 	if (ns >= SBT_1S)
@@ -203,7 +203,7 @@ sbttons(sbintime_t _sbt)
 }
 
 static __inline sbintime_t
-nstosbt(__int64_t _ns)
+nstosbt(int64_t _ns)
 {
 	sbintime_t sb = 0;
 
@@ -216,7 +216,7 @@ nstosbt(__int64_t _ns)
 	return (sb);
 }
 
-static __inline __int64_t
+static __inline int64_t
 sbttous(sbintime_t _sbt)
 {
 
@@ -224,7 +224,7 @@ sbttous(sbintime_t _sbt)
 }
 
 static __inline sbintime_t
-ustosbt(__int64_t _us)
+ustosbt(int64_t _us)
 {
 	sbintime_t sb = 0;
 
@@ -237,7 +237,7 @@ ustosbt(__int64_t _us)
 	return (sb);
 }
 
-static __inline __int64_t
+static __inline int64_t
 sbttoms(sbintime_t _sbt)
 {
 
@@ -245,7 +245,7 @@ sbttoms(sbintime_t _sbt)
 }
 
 static __inline sbintime_t
-mstosbt(__int64_t _ms)
+mstosbt(int64_t _ms)
 {
 	sbintime_t sb = 0;
 
@@ -277,8 +277,8 @@ bintime2timespec(const struct bintime *_bt, struct timespec *_ts)
 {
 
 	_ts->tv_sec = _bt->sec;
-	_ts->tv_nsec = ((__uint64_t)1000000000 *
-	    (__uint32_t)(_bt->frac >> 32)) >> 32;
+	_ts->tv_nsec = ((uint64_t)1000000000 *
+	    (uint32_t)(_bt->frac >> 32)) >> 32;
 }
 
 static __inline void
@@ -287,7 +287,7 @@ timespec2bintime(const struct timespec *_ts, struct bintime *_bt)
 
 	_bt->sec = _ts->tv_sec;
 	/* 18446744073 = int(2^64 / 1000000000) */
-	_bt->frac = _ts->tv_nsec * (__uint64_t)18446744073LL;
+	_bt->frac = _ts->tv_nsec * (uint64_t)18446744073LL;
 }
 
 static __inline void
@@ -295,7 +295,7 @@ bintime2timeval(const struct bintime *_bt, struct timeval *_tv)
 {
 
 	_tv->tv_sec = _bt->sec;
-	_tv->tv_usec = ((__uint64_t)1000000 * (__uint32_t)(_bt->frac >> 32)) >> 32;
+	_tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(_bt->frac >> 32)) >> 32;
 }
 
 static __inline void
@@ -304,7 +304,7 @@ timeval2bintime(const struct timeval *_tv, struct bintime *_bt)
 
 	_bt->sec = _tv->tv_sec;
 	/* 18446744073709 = int(2^64 / 1000000) */
-	_bt->frac = _tv->tv_usec * (__uint64_t)18446744073709LL;
+	_bt->frac = _tv->tv_usec * (uint64_t)18446744073709LL;
 }
 
 static __inline struct timespec
@@ -313,7 +313,7 @@ sbttots(sbintime_t _sbt)
 	struct timespec _ts;
 
 	_ts.tv_sec = _sbt >> 32;
-	_ts.tv_nsec = sbttons((__uint32_t)_sbt);
+	_ts.tv_nsec = sbttons((uint32_t)_sbt);
 	return (_ts);
 }
 
@@ -330,7 +330,7 @@ sbttotv(sbintime_t _sbt)
 	struct timeval _tv;
 
 	_tv.tv_sec = _sbt >> 32;
-	_tv.tv_usec = sbttous((__uint32_t)_sbt);
+	_tv.tv_usec = sbttous((uint32_t)_sbt);
 	return (_tv);
 }
 
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 42e98ce97..4613ac81f 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -43,7 +43,7 @@ typedef __intptr_t register_t;
 
 #define _SYS_TYPES_H
 #include <sys/_types.h>
-#include <machine/_default_types.h>
+#include <sys/_stdint.h>
 
 #if __BSD_VISIBLE
 #include <machine/endian.h>
diff --git a/newlib/libc/stdlib/arc4random_uniform.c b/newlib/libc/stdlib/arc4random_uniform.c
index b5ed243a8..1aa9a622f 100644
--- a/newlib/libc/stdlib/arc4random_uniform.c
+++ b/newlib/libc/stdlib/arc4random_uniform.c
@@ -18,7 +18,6 @@
 
 #include <sys/types.h>
 #include <stdlib.h>
-#include <stdint.h>
 
 /*
  * Calculate a uniformly distributed random number less than upper_bound
diff --git a/winsup/cygserver/bsd_helper.h b/winsup/cygserver/bsd_helper.h
index 778d4ee73..b2d866277 100644
--- a/winsup/cygserver/bsd_helper.h
+++ b/winsup/cygserver/bsd_helper.h
@@ -10,7 +10,6 @@ details. */
 
 #include <sys/types.h>
 #include <sys/syslog.h>
-#include <stdint.h>
 
 enum tun_bool_t {
   TUN_UNDEF = 0,
diff --git a/winsup/cygwin/gcrt0.c b/winsup/cygwin/gcrt0.c
index d66bdd72c..f02b3be59 100644
--- a/winsup/cygwin/gcrt0.c
+++ b/winsup/cygwin/gcrt0.c
@@ -13,7 +13,6 @@ details. */
 
 #include <sys/types.h>
 #include <stdlib.h>
-#include <stdint.h>
 
 #ifdef __MINGW32__
 #include <_bsd_types.h>
diff --git a/winsup/cygwin/include/cygwin/in.h b/winsup/cygwin/include/cygwin/in.h
index 83a01d3a3..42b776653 100644
--- a/winsup/cygwin/include/cygwin/in.h
+++ b/winsup/cygwin/include/cygwin/in.h
@@ -148,8 +148,8 @@ struct ip_msfilter
 {
   struct in_addr imsf_multiaddr;
   struct in_addr imsf_interface;
-  __uint32_t       imsf_fmode;
-  __uint32_t       imsf_numsrc;
+  uint32_t       imsf_fmode;
+  uint32_t       imsf_numsrc;
   struct in_addr imsf_slist[1];
 };
 
@@ -160,30 +160,30 @@ struct ip_msfilter
 struct in_pktinfo
 {
   struct in_addr ipi_addr;
-  __uint32_t       ipi_ifindex;
+  uint32_t       ipi_ifindex;
 };
 
 /* Request struct for IP agnostic multicast socket ops */
 
 struct group_req
 {
-  __uint32_t                gr_interface;
+  uint32_t                gr_interface;
   struct sockaddr_storage gr_group;
 };
 
 struct group_source_req
 {
-  __uint32_t                gsr_interface;
+  uint32_t                gsr_interface;
   struct sockaddr_storage gsr_group;
   struct sockaddr_storage gsr_source;
 };
 
 struct group_filter
 {
-  __uint32_t                gf_interface;
+  uint32_t                gf_interface;
   struct sockaddr_storage gf_group;
-  __uint32_t                gf_fmode;
-  __uint32_t                gf_numsrc;
+  uint32_t                gf_fmode;
+  uint32_t                gf_numsrc;
   struct sockaddr_storage gf_slist[1];
 };
 
diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/cygwin/socket.h
index 4d7a521a2..0ca8300d9 100644
--- a/winsup/cygwin/include/cygwin/socket.h
+++ b/winsup/cygwin/include/cygwin/socket.h
@@ -31,16 +31,16 @@ struct sockaddr {
 
 /* Definition of sockaddr_storage according to SUSv3. */
 #define _SS_MAXSIZE 128			/* Maximum size. */
-#define _SS_ALIGNSIZE (sizeof (__int64_t))/* Desired alignment. */
+#define _SS_ALIGNSIZE (sizeof (int64_t))/* Desired alignment. */
 #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (sa_family_t))
 #define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (sa_family_t) \
 		      + _SS_PAD1SIZE + _SS_ALIGNSIZE))
 
 struct sockaddr_storage {
   sa_family_t		ss_family;
-  __int8_t		_ss_pad1[_SS_PAD1SIZE];
-  __int64_t		__ss_align;
-  __int8_t		_ss_pad2[_SS_PAD2SIZE];
+  char			_ss_pad1[_SS_PAD1SIZE];
+  int64_t		__ss_align;
+  char			_ss_pad2[_SS_PAD2SIZE];
 };
 #endif
 
diff --git a/winsup/cygwin/include/sys/dirent.h b/winsup/cygwin/include/sys/dirent.h
index 393c27e41..0e7a78cc0 100644
--- a/winsup/cygwin/include/sys/dirent.h
+++ b/winsup/cygwin/include/sys/dirent.h
@@ -21,7 +21,7 @@
 #define _DIRENT_HAVE_D_TYPE
 struct dirent
 {
-  __uint32_t __d_version;			/* Used internally */
+  uint32_t __d_version;			/* Used internally */
   ino_t d_ino;
   unsigned char d_type;
   unsigned char __d_unused1[3];
@@ -51,7 +51,7 @@ typedef struct __DIR
   char *__d_dirname;			/* directory name with trailing '*' */
   __int32_t __d_position;			/* used by telldir/seekdir */
   int __d_fd;
-  __uintptr_t __d_internal;
+  uintptr_t __d_internal;
   void *__handle;
   void *__fh;
   unsigned __flags;
diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h
index 3cfae786c..1f265ec28 100644
--- a/winsup/cygwin/winsup.h
+++ b/winsup/cygwin/winsup.h
@@ -36,7 +36,6 @@ details. */
 #include <sys/types.h>
 #include <sys/strace.h>
 #include <sys/smallprint.h>
-#include <stdint.h>
 
 /* Declarations for functions used in C and C++ code. */
 #ifdef __cplusplus


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-04 13:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 13:49 [newlib-cygwin] Revert "sys/types.h: Don't include sys/_stdint.h" Corinna Vinschen

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).