From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 136773954C59; Tue, 3 May 2022 16:58:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 136773954C59 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org, newlib-cvs@sourceware.org Subject: [newlib-cygwin] sys/types.h: Don't include sys/_stdint.h X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 5a6de512ab5d46f7a0f019e7345e800a0a274a62 X-Git-Newrev: 4232d171a620662aaed650879936eac60aefd9e0 Message-Id: <20220503165839.136773954C59@sourceware.org> Date: Tue, 3 May 2022 16:58:39 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2022 16:58:39 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D4232d171a62= 0662aaed650879936eac60aefd9e0 commit 4232d171a620662aaed650879936eac60aefd9e0 Author: Corinna Vinschen Date: Tue May 3 18:58:18 2022 +0200 sys/types.h: Don't include sys/_stdint.h =20 By including sys/_stdint.h, all types from stdint.h are exposed even if stdint.h isn't pulled in explicitely. Include 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, 90 insertions(+), 86 deletions(-) diff --git a/newlib/libc/include/machine/ieee.h b/newlib/libc/include/machi= ne/ieee.h index 0656909ab..251d3036a 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 =3D=3D 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 =3D=3D 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 5a3dec7ab..0d68ab8ab 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; }; =20 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; =20 _u =3D _bt->frac; _bt->frac +=3D _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; =20 _u =3D _bt->frac; _bt->frac +=3D _bt2->frac; @@ -93,7 +93,7 @@ bintime_add(struct bintime *_bt, const struct bintime *_b= t2) static __inline void bintime_sub(struct bintime *_bt, const struct bintime *_bt2) { - uint64_t _u; + __uint64_t _u; =20 _u =3D _bt->frac; _bt->frac -=3D _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; =20 _p1 =3D (_bt->frac & 0xffffffffull) * _x; _p2 =3D (_bt->frac >> 32) * _x + (_p1 >> 32); @@ -124,7 +124,7 @@ bintime_shift(struct bintime *_bt, int _exp) _bt->frac <<=3D _exp; } else if (_exp < 0) { _bt->frac >>=3D -_exp; - _bt->frac |=3D (uint64_t)_bt->sec << (64 + _exp); + _bt->frac |=3D (__uint64_t)_bt->sec << (64 + _exp); _bt->sec >>=3D -_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 less= er - * 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; =20 ns =3D _sbt; if (ns >=3D SBT_1S) @@ -203,7 +203,7 @@ sbttons(sbintime_t _sbt) } =20 static __inline sbintime_t -nstosbt(int64_t _ns) +nstosbt(__int64_t _ns) { sbintime_t sb =3D 0; =20 @@ -216,7 +216,7 @@ nstosbt(int64_t _ns) return (sb); } =20 -static __inline int64_t +static __inline __int64_t sbttous(sbintime_t _sbt) { =20 @@ -224,7 +224,7 @@ sbttous(sbintime_t _sbt) } =20 static __inline sbintime_t -ustosbt(int64_t _us) +ustosbt(__int64_t _us) { sbintime_t sb =3D 0; =20 @@ -237,7 +237,7 @@ ustosbt(int64_t _us) return (sb); } =20 -static __inline int64_t +static __inline __int64_t sbttoms(sbintime_t _sbt) { =20 @@ -245,7 +245,7 @@ sbttoms(sbintime_t _sbt) } =20 static __inline sbintime_t -mstosbt(int64_t _ms) +mstosbt(__int64_t _ms) { sbintime_t sb =3D 0; =20 @@ -277,8 +277,8 @@ bintime2timespec(const struct bintime *_bt, struct time= spec *_ts) { =20 _ts->tv_sec =3D _bt->sec; - _ts->tv_nsec =3D ((uint64_t)1000000000 * - (uint32_t)(_bt->frac >> 32)) >> 32; + _ts->tv_nsec =3D ((__uint64_t)1000000000 * + (__uint32_t)(_bt->frac >> 32)) >> 32; } =20 static __inline void @@ -287,7 +287,7 @@ timespec2bintime(const struct timespec *_ts, struct bin= time *_bt) =20 _bt->sec =3D _ts->tv_sec; /* 18446744073 =3D int(2^64 / 1000000000) */ - _bt->frac =3D _ts->tv_nsec * (uint64_t)18446744073LL; + _bt->frac =3D _ts->tv_nsec * (__uint64_t)18446744073LL; } =20 static __inline void @@ -295,7 +295,7 @@ bintime2timeval(const struct bintime *_bt, struct timev= al *_tv) { =20 _tv->tv_sec =3D _bt->sec; - _tv->tv_usec =3D ((uint64_t)1000000 * (uint32_t)(_bt->frac >> 32)) >> 32; + _tv->tv_usec =3D ((__uint64_t)1000000 * (__uint32_t)(_bt->frac >> 32)) >>= 32; } =20 static __inline void @@ -304,7 +304,7 @@ timeval2bintime(const struct timeval *_tv, struct binti= me *_bt) =20 _bt->sec =3D _tv->tv_sec; /* 18446744073709 =3D int(2^64 / 1000000) */ - _bt->frac =3D _tv->tv_usec * (uint64_t)18446744073709LL; + _bt->frac =3D _tv->tv_usec * (__uint64_t)18446744073709LL; } =20 static __inline struct timespec @@ -313,7 +313,7 @@ sbttots(sbintime_t _sbt) struct timespec _ts; =20 _ts.tv_sec =3D _sbt >> 32; - _ts.tv_nsec =3D sbttons((uint32_t)_sbt); + _ts.tv_nsec =3D sbttons((__uint32_t)_sbt); return (_ts); } =20 @@ -330,7 +330,7 @@ sbttotv(sbintime_t _sbt) struct timeval _tv; =20 _tv.tv_sec =3D _sbt >> 32; - _tv.tv_usec =3D sbttous((uint32_t)_sbt); + _tv.tv_usec =3D sbttous((__uint32_t)_sbt); return (_tv); } =20 diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/type= s.h index 4613ac81f..42e98ce97 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -43,7 +43,7 @@ typedef __intptr_t register_t; =20 #define _SYS_TYPES_H #include -#include +#include =20 #if __BSD_VISIBLE #include diff --git a/newlib/libc/stdlib/arc4random_uniform.c b/newlib/libc/stdlib/a= rc4random_uniform.c index 1aa9a622f..b5ed243a8 100644 --- a/newlib/libc/stdlib/arc4random_uniform.c +++ b/newlib/libc/stdlib/arc4random_uniform.c @@ -18,6 +18,7 @@ =20 #include #include +#include =20 /* * 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 b2d866277..778d4ee73 100644 --- a/winsup/cygserver/bsd_helper.h +++ b/winsup/cygserver/bsd_helper.h @@ -10,6 +10,7 @@ details. */ =20 #include #include +#include =20 enum tun_bool_t { TUN_UNDEF =3D 0, diff --git a/winsup/cygwin/gcrt0.c b/winsup/cygwin/gcrt0.c index f02b3be59..d66bdd72c 100644 --- a/winsup/cygwin/gcrt0.c +++ b/winsup/cygwin/gcrt0.c @@ -13,6 +13,7 @@ details. */ =20 #include #include +#include =20 #ifdef __MINGW32__ #include <_bsd_types.h> diff --git a/winsup/cygwin/include/cygwin/in.h b/winsup/cygwin/include/cygw= in/in.h index 42b776653..83a01d3a3 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]; }; =20 @@ -160,30 +160,30 @@ struct ip_msfilter struct in_pktinfo { struct in_addr ipi_addr; - uint32_t ipi_ifindex; + __uint32_t ipi_ifindex; }; =20 /* Request struct for IP agnostic multicast socket ops */ =20 struct group_req { - uint32_t gr_interface; + __uint32_t gr_interface; struct sockaddr_storage gr_group; }; =20 struct group_source_req { - uint32_t gsr_interface; + __uint32_t gsr_interface; struct sockaddr_storage gsr_group; struct sockaddr_storage gsr_source; }; =20 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]; }; =20 diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/= cygwin/socket.h index 0ca8300d9..4d7a521a2 100644 --- a/winsup/cygwin/include/cygwin/socket.h +++ b/winsup/cygwin/include/cygwin/socket.h @@ -31,16 +31,16 @@ struct sockaddr { =20 /* 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)) =20 struct sockaddr_storage { sa_family_t ss_family; - char _ss_pad1[_SS_PAD1SIZE]; - int64_t __ss_align; - char _ss_pad2[_SS_PAD2SIZE]; + __int8_t _ss_pad1[_SS_PAD1SIZE]; + __int64_t __ss_align; + __int8_t _ss_pad2[_SS_PAD2SIZE]; }; #endif =20 diff --git a/winsup/cygwin/include/sys/dirent.h b/winsup/cygwin/include/sys= /dirent.h index 0e7a78cc0..393c27e41 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 1f265ec28..3cfae786c 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -36,6 +36,7 @@ details. */ #include #include #include +#include =20 /* Declarations for functions used in C and C++ code. */ #ifdef __cplusplus