Add <sys/_stdint.h> for FreeBSD compatibility
* libc/include/sys/_stdint.h: New file.
        * libc/include/stdint.h (int8_t): Move to <sys/_stdint.h>.
        (uint8_t): Likewise.
        (int16_t): Likewise.
        (uint16_t): Likewise.
        (int32_t): Likewise.
        (uint32_t): Likewise.
        (int64_t): Likewise.
        (uint64_t): Likewise.
        (intptr_t): Likewise.
        (uintptr_t): Likewise.
        * libc/include/sys/types.h: Include <sys/_stdint.h>.
        * libc/sys/rtems/machine/_types.h: Remove <stdint.h> include.
        * libc/sys/time.h>: Replace __uint32_t with uint32_t and
        __uint64_t with uint64_t.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
			
			
This commit is contained in:
		
				
					committed by
					
						 Corinna Vinschen
						Corinna Vinschen
					
				
			
			
				
	
			
			
			
						parent
						
							9e8932d6da
						
					
				
				
					commit
					897d3a3cc4
				
			| @@ -1,3 +1,21 @@ | |||||||
|  | 2015-04-01  Sebastian Huber  <sebastian.huber@embedded-brains.de> | ||||||
|  |  | ||||||
|  | 	* libc/include/sys/_stdint.h: New file. | ||||||
|  | 	* libc/include/stdint.h (int8_t): Move to <sys/_stdint.h>. | ||||||
|  | 	(uint8_t): Likewise. | ||||||
|  | 	(int16_t): Likewise. | ||||||
|  | 	(uint16_t): Likewise. | ||||||
|  | 	(int32_t): Likewise. | ||||||
|  | 	(uint32_t): Likewise. | ||||||
|  | 	(int64_t): Likewise. | ||||||
|  | 	(uint64_t): Likewise. | ||||||
|  | 	(intptr_t): Likewise. | ||||||
|  | 	(uintptr_t): Likewise. | ||||||
|  | 	* libc/include/sys/types.h: Include <sys/_stdint.h>. | ||||||
|  | 	* libc/sys/rtems/machine/_types.h: Remove <stdint.h> include. | ||||||
|  | 	* libc/sys/time.h>: Replace __uint32_t with uint32_t and | ||||||
|  | 	__uint64_t with uint64_t. | ||||||
|  |  | ||||||
| 2015-04-01  Jon TURNEY  <jon.turney@dronecode.org.uk> | 2015-04-01  Jon TURNEY  <jon.turney@dronecode.org.uk> | ||||||
|  |  | ||||||
| 	* libc/include/sys/signal.h (stack_t): Make typedef generally | 	* libc/include/sys/signal.h (stack_t): Make typedef generally | ||||||
|   | |||||||
| @@ -11,53 +11,30 @@ | |||||||
|  |  | ||||||
| #include <machine/_default_types.h> | #include <machine/_default_types.h> | ||||||
| #include <sys/_intsup.h> | #include <sys/_intsup.h> | ||||||
|  | #include <sys/_stdint.h> | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| extern "C" { | extern "C" { | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef ___int8_t_defined |  | ||||||
| typedef __int8_t int8_t ; |  | ||||||
| typedef __uint8_t uint8_t ; |  | ||||||
| #define __int8_t_defined 1 |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| #ifdef ___int_least8_t_defined | #ifdef ___int_least8_t_defined | ||||||
| typedef __int_least8_t int_least8_t; | typedef __int_least8_t int_least8_t; | ||||||
| typedef __uint_least8_t uint_least8_t; | typedef __uint_least8_t uint_least8_t; | ||||||
| #define __int_least8_t_defined 1 | #define __int_least8_t_defined 1 | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef ___int16_t_defined |  | ||||||
| typedef __int16_t int16_t ; |  | ||||||
| typedef __uint16_t uint16_t ; |  | ||||||
| #define __int16_t_defined 1 |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| #ifdef ___int_least16_t_defined | #ifdef ___int_least16_t_defined | ||||||
| typedef __int_least16_t int_least16_t; | typedef __int_least16_t int_least16_t; | ||||||
| typedef __uint_least16_t uint_least16_t; | typedef __uint_least16_t uint_least16_t; | ||||||
| #define __int_least16_t_defined 1 | #define __int_least16_t_defined 1 | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef ___int32_t_defined |  | ||||||
| typedef __int32_t int32_t ; |  | ||||||
| typedef __uint32_t uint32_t ; |  | ||||||
| #define __int32_t_defined 1 |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| #ifdef ___int_least32_t_defined | #ifdef ___int_least32_t_defined | ||||||
| typedef __int_least32_t int_least32_t; | typedef __int_least32_t int_least32_t; | ||||||
| typedef __uint_least32_t uint_least32_t; | typedef __uint_least32_t uint_least32_t; | ||||||
| #define __int_least32_t_defined 1 | #define __int_least32_t_defined 1 | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef ___int64_t_defined |  | ||||||
| typedef __int64_t int64_t ; |  | ||||||
| typedef __uint64_t uint64_t ; |  | ||||||
| #define __int64_t_defined 1 |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| #ifdef ___int_least64_t_defined | #ifdef ___int_least64_t_defined | ||||||
| typedef __int_least64_t int_least64_t; | typedef __int_least64_t int_least64_t; | ||||||
| typedef __uint_least64_t uint_least64_t; | typedef __uint_least64_t uint_least64_t; | ||||||
| @@ -166,9 +143,6 @@ typedef __uint_least64_t uint_least64_t; | |||||||
|   typedef unsigned long uintmax_t; |   typedef unsigned long uintmax_t; | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| typedef __intptr_t intptr_t; |  | ||||||
| typedef __uintptr_t uintptr_t; |  | ||||||
|  |  | ||||||
| #ifdef __INTPTR_TYPE__ | #ifdef __INTPTR_TYPE__ | ||||||
| #define INTPTR_MIN (-__INTPTR_MAX__ - 1) | #define INTPTR_MIN (-__INTPTR_MAX__ - 1) | ||||||
| #define INTPTR_MAX __INTPTR_MAX__ | #define INTPTR_MAX __INTPTR_MAX__ | ||||||
|   | |||||||
							
								
								
									
										49
									
								
								newlib/libc/include/sys/_stdint.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								newlib/libc/include/sys/_stdint.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | |||||||
|  | /* | ||||||
|  |  * Copyright (c) 2004, 2005 by | ||||||
|  |  * Ralf Corsepius, Ulm/Germany. All rights reserved. | ||||||
|  |  * | ||||||
|  |  * Permission to use, copy, modify, and distribute this software | ||||||
|  |  * is freely granted, provided that this notice is preserved. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | #ifndef _SYS__STDINT_H | ||||||
|  | #define _SYS__STDINT_H | ||||||
|  |  | ||||||
|  | #include <machine/_default_types.h> | ||||||
|  |  | ||||||
|  | #ifdef __cplusplus | ||||||
|  | extern "C" { | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifdef ___int8_t_defined | ||||||
|  | typedef __int8_t int8_t ; | ||||||
|  | typedef __uint8_t uint8_t ; | ||||||
|  | #define __int8_t_defined 1 | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifdef ___int16_t_defined | ||||||
|  | typedef __int16_t int16_t ; | ||||||
|  | typedef __uint16_t uint16_t ; | ||||||
|  | #define __int16_t_defined 1 | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifdef ___int32_t_defined | ||||||
|  | typedef __int32_t int32_t ; | ||||||
|  | typedef __uint32_t uint32_t ; | ||||||
|  | #define __int32_t_defined 1 | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifdef ___int64_t_defined | ||||||
|  | typedef __int64_t int64_t ; | ||||||
|  | typedef __uint64_t uint64_t ; | ||||||
|  | #define __int64_t_defined 1 | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | typedef __intptr_t intptr_t; | ||||||
|  | typedef __uintptr_t uintptr_t; | ||||||
|  |  | ||||||
|  | #ifdef __cplusplus | ||||||
|  | } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #endif /* _SYS__STDINT_H */ | ||||||
| @@ -57,13 +57,13 @@ struct timezone { | |||||||
| #if __BSD_VISIBLE | #if __BSD_VISIBLE | ||||||
| struct bintime { | struct bintime { | ||||||
| 	time_t	sec; | 	time_t	sec; | ||||||
| 	__uint64_t frac; | 	uint64_t frac; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| static __inline void | 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; | 	_u = _bt->frac; | ||||||
| 	_bt->frac += _x; | 	_bt->frac += _x; | ||||||
| @@ -74,7 +74,7 @@ bintime_addx(struct bintime *_bt, __uint64_t _x) | |||||||
| static __inline void | static __inline void | ||||||
| bintime_add(struct bintime *_bt, const struct bintime *_bt2) | bintime_add(struct bintime *_bt, const struct bintime *_bt2) | ||||||
| { | { | ||||||
| 	__uint64_t _u; | 	uint64_t _u; | ||||||
|  |  | ||||||
| 	_u = _bt->frac; | 	_u = _bt->frac; | ||||||
| 	_bt->frac += _bt2->frac; | 	_bt->frac += _bt2->frac; | ||||||
| @@ -86,7 +86,7 @@ bintime_add(struct bintime *_bt, const struct bintime *_bt2) | |||||||
| static __inline void | static __inline void | ||||||
| bintime_sub(struct bintime *_bt, const struct bintime *_bt2) | bintime_sub(struct bintime *_bt, const struct bintime *_bt2) | ||||||
| { | { | ||||||
| 	__uint64_t _u; | 	uint64_t _u; | ||||||
|  |  | ||||||
| 	_u = _bt->frac; | 	_u = _bt->frac; | ||||||
| 	_bt->frac -= _bt2->frac; | 	_bt->frac -= _bt2->frac; | ||||||
| @@ -98,7 +98,7 @@ bintime_sub(struct bintime *_bt, const struct bintime *_bt2) | |||||||
| static __inline void | static __inline void | ||||||
| bintime_mul(struct bintime *_bt, u_int _x) | bintime_mul(struct bintime *_bt, u_int _x) | ||||||
| { | { | ||||||
| 	__uint64_t _p1, _p2; | 	uint64_t _p1, _p2; | ||||||
|  |  | ||||||
| 	_p1 = (_bt->frac & 0xffffffffull) * _x; | 	_p1 = (_bt->frac & 0xffffffffull) * _x; | ||||||
| 	_p2 = (_bt->frac >> 32) * _x + (_p1 >> 32); | 	_p2 = (_bt->frac >> 32) * _x + (_p1 >> 32); | ||||||
| @@ -117,7 +117,7 @@ bintime_shift(struct bintime *_bt, int _exp) | |||||||
| 		_bt->frac <<= _exp; | 		_bt->frac <<= _exp; | ||||||
| 	} else if (_exp < 0) { | 	} else if (_exp < 0) { | ||||||
| 		_bt->frac >>= -_exp; | 		_bt->frac >>= -_exp; | ||||||
| 		_bt->frac |= (__uint64_t)_bt->sec << (64 + _exp); | 		_bt->frac |= (uint64_t)_bt->sec << (64 + _exp); | ||||||
| 		_bt->sec >>= -_exp; | 		_bt->sec >>= -_exp; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -179,8 +179,8 @@ bintime2timespec(const struct bintime *_bt, struct timespec *_ts) | |||||||
| { | { | ||||||
|  |  | ||||||
| 	_ts->tv_sec = _bt->sec; | 	_ts->tv_sec = _bt->sec; | ||||||
| 	_ts->tv_nsec = ((__uint64_t)1000000000 * | 	_ts->tv_nsec = ((uint64_t)1000000000 * | ||||||
| 	    (__uint32_t)(_bt->frac >> 32)) >> 32; | 	    (uint32_t)(_bt->frac >> 32)) >> 32; | ||||||
| } | } | ||||||
|  |  | ||||||
| static __inline void | static __inline void | ||||||
| @@ -189,7 +189,7 @@ timespec2bintime(const struct timespec *_ts, struct bintime *_bt) | |||||||
|  |  | ||||||
| 	_bt->sec = _ts->tv_sec; | 	_bt->sec = _ts->tv_sec; | ||||||
| 	/* 18446744073 = int(2^64 / 1000000000) */ | 	/* 18446744073 = int(2^64 / 1000000000) */ | ||||||
| 	_bt->frac = _ts->tv_nsec * (__uint64_t)18446744073LL; | 	_bt->frac = _ts->tv_nsec * (uint64_t)18446744073LL; | ||||||
| } | } | ||||||
|  |  | ||||||
| static __inline void | static __inline void | ||||||
| @@ -197,7 +197,7 @@ bintime2timeval(const struct bintime *_bt, struct timeval *_tv) | |||||||
| { | { | ||||||
|  |  | ||||||
| 	_tv->tv_sec = _bt->sec; | 	_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 | static __inline void | ||||||
| @@ -206,7 +206,7 @@ timeval2bintime(const struct timeval *_tv, struct bintime *_bt) | |||||||
|  |  | ||||||
| 	_bt->sec = _tv->tv_sec; | 	_bt->sec = _tv->tv_sec; | ||||||
| 	/* 18446744073709 = int(2^64 / 1000000) */ | 	/* 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 | static __inline struct timespec | ||||||
| @@ -215,7 +215,7 @@ sbttots(sbintime_t _sbt) | |||||||
| 	struct timespec _ts; | 	struct timespec _ts; | ||||||
|  |  | ||||||
| 	_ts.tv_sec = _sbt >> 32; | 	_ts.tv_sec = _sbt >> 32; | ||||||
| 	_ts.tv_nsec = ((__uint64_t)1000000000 * (__uint32_t)_sbt) >> 32; | 	_ts.tv_nsec = ((uint64_t)1000000000 * (uint32_t)_sbt) >> 32; | ||||||
| 	return (_ts); | 	return (_ts); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -224,7 +224,7 @@ tstosbt(struct timespec _ts) | |||||||
| { | { | ||||||
|  |  | ||||||
| 	return (((sbintime_t)_ts.tv_sec << 32) + | 	return (((sbintime_t)_ts.tv_sec << 32) + | ||||||
| 	    (_ts.tv_nsec * (((__uint64_t)1 << 63) / 500000000) >> 32)); | 	    (_ts.tv_nsec * (((uint64_t)1 << 63) / 500000000) >> 32)); | ||||||
| } | } | ||||||
|  |  | ||||||
| static __inline struct timeval | static __inline struct timeval | ||||||
| @@ -233,7 +233,7 @@ sbttotv(sbintime_t _sbt) | |||||||
| 	struct timeval _tv; | 	struct timeval _tv; | ||||||
|  |  | ||||||
| 	_tv.tv_sec = _sbt >> 32; | 	_tv.tv_sec = _sbt >> 32; | ||||||
| 	_tv.tv_usec = ((__uint64_t)1000000 * (__uint32_t)_sbt) >> 32; | 	_tv.tv_usec = ((uint64_t)1000000 * (uint32_t)_sbt) >> 32; | ||||||
| 	return (_tv); | 	return (_tv); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -242,7 +242,7 @@ tvtosbt(struct timeval _tv) | |||||||
| { | { | ||||||
|  |  | ||||||
| 	return (((sbintime_t)_tv.tv_sec << 32) + | 	return (((sbintime_t)_tv.tv_sec << 32) + | ||||||
| 	    (_tv.tv_usec * (((__uint64_t)1 << 63) / 500000) >> 32)); | 	    (_tv.tv_usec * (((uint64_t)1 << 63) / 500000) >> 32)); | ||||||
| } | } | ||||||
| #endif /* __BSD_VISIBLE */ | #endif /* __BSD_VISIBLE */ | ||||||
|  |  | ||||||
| @@ -390,7 +390,7 @@ int	tvtohz(struct timeval *tv); | |||||||
| #define	TC_DEFAULTPERC		5 | #define	TC_DEFAULTPERC		5 | ||||||
|  |  | ||||||
| #define	BT2FREQ(bt)                                                     \ | #define	BT2FREQ(bt)                                                     \ | ||||||
| 	(((__uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) /           \ | 	(((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) /           \ | ||||||
| 	    ((bt)->frac >> 1)) | 	    ((bt)->frac >> 1)) | ||||||
|  |  | ||||||
| #define	SBT2FREQ(sbt)	((SBT_1S + ((sbt) >> 1)) / (sbt)) | #define	SBT2FREQ(sbt)	((SBT_1S + ((sbt) >> 1)) / (sbt)) | ||||||
| @@ -398,7 +398,7 @@ int	tvtohz(struct timeval *tv); | |||||||
| #define	FREQ2BT(freq, bt)                                               \ | #define	FREQ2BT(freq, bt)                                               \ | ||||||
| {									\ | {									\ | ||||||
| 	(bt)->sec = 0;                                                  \ | 	(bt)->sec = 0;                                                  \ | ||||||
| 	(bt)->frac = ((__uint64_t)0x8000000000000000  / (freq)) << 1;     \ | 	(bt)->frac = ((uint64_t)0x8000000000000000  / (freq)) << 1;     \ | ||||||
| } | } | ||||||
|  |  | ||||||
| #define	TIMESEL(sbt, sbt2)						\ | #define	TIMESEL(sbt, sbt2)						\ | ||||||
|   | |||||||
| @@ -59,6 +59,7 @@ typedef	quad_t *	qaddr_t; | |||||||
|  |  | ||||||
| #define _SYS_TYPES_H | #define _SYS_TYPES_H | ||||||
| #include <sys/_types.h> | #include <sys/_types.h> | ||||||
|  | #include <sys/_stdint.h> | ||||||
|  |  | ||||||
| #ifdef __i386__ | #ifdef __i386__ | ||||||
| #if defined (GO32) || defined (__MSDOS__) | #if defined (GO32) || defined (__MSDOS__) | ||||||
|   | |||||||
| @@ -9,7 +9,6 @@ | |||||||
| #define _HAVE_SYSTYPES | #define _HAVE_SYSTYPES | ||||||
|  |  | ||||||
| #include <machine/_default_types.h> | #include <machine/_default_types.h> | ||||||
| #include <stdint.h> /* For FreeBSD compatibility */ |  | ||||||
|  |  | ||||||
| typedef __int32_t blksize_t; | typedef __int32_t blksize_t; | ||||||
| typedef __int32_t blkcnt_t; | typedef __int32_t blkcnt_t; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user