blob: 4a6a6ec90d7865e85241d4c78469f6e9fe4f9d28 [file] [log] [blame] [raw]
/*
* types.h
* This file has no copyright assigned and is placed in the Public Domain.
* This file is a part of the mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within the package.
*
* The definition of constants, data types and global variables.
*
*/
#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H
/* All the headers include this file. */
#include <_mingw.h>
#define __need_wchar_t
#define __need_size_t
#define __need_ptrdiff_t
#ifndef RC_INVOKED
#include <stddef.h>
#endif /* Not RC_INVOKED */
#ifndef RC_INVOKED
#ifndef _TIME_T_DEFINED
typedef long time_t;
#define _TIME_T_DEFINED
#endif
#ifndef _TIME64_T_DEFINED
typedef __int64 __time64_t;
#define _TIME64_T_DEFINED
#endif
#ifndef _OFF_T_
#define _OFF_T_
typedef long int _off_t;
typedef _off_t off_t;
#endif /* Not _OFF_T_ */
#ifndef _DEV_T_
#define _DEV_T_
#if defined __MSVCRT__ || defined __COREDLL__
typedef unsigned int _dev_t;
#else
typedef short _dev_t;
#endif
#ifndef _NO_OLDNAMES
typedef _dev_t dev_t;
#endif
#endif /* Not _DEV_T_ */
#ifndef _INO_T_
#define _INO_T_
typedef short int _ino_t;
typedef _ino_t ino_t;
#endif /* Not _INO_T_ */
#ifndef _PID_T_
#define _PID_T_
typedef int _pid_t;
typedef _pid_t pid_t;
#endif /* Not _PID_T_ */
#ifndef _MODE_T_
#define _MODE_T_
typedef unsigned short _mode_t;
typedef _mode_t mode_t;
#endif /* Not _MODE_T_ */
#ifndef _SIGSET_T_
#define _SIGSET_T_
typedef int _sigset_t;
typedef _sigset_t sigset_t;
#endif /* Not _SIGSET_T_ */
#ifndef _SSIZE_T_
#define _SSIZE_T_
typedef long int _ssize_t;
typedef _ssize_t ssize_t;
#endif /* Not _SSIZE_T_ */
#ifndef _FPOS64_T_
#define _FPOS64_T_
typedef long long int fpos64_t;
#endif
#ifndef _OFF64_T_
#define _OFF64_T_
typedef long long int off64_t;
#endif
#if !defined __NO_ISOCEXT
typedef unsigned int useconds_t;
#endif /* Not __NO_ISOCEXT */
/*
* Guess on types by examining *_MIN / *_MAX defines.
*/
#if defined(__GNUC__) && (__GNUC__ >= 3 ) \
&& defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 )
/* GCC >= 3.3.0 has __<val>__ implicitly defined. */
#define __EXP(x) __##x##__
#else
/* Fall back to POSIX versions from <limits.h> */
#define __EXP(x) x
#include <limits.h>
#endif
#if __EXP(SCHAR_MAX) == 0x7f
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
#define ___int8_t_defined 1
#endif
#if __EXP(INT_MAX) == 0x7fff
typedef signed int __int16_t;
typedef unsigned int __uint16_t;
#define ___int16_t_defined 1
#elif __EXP(SHRT_MAX) == 0x7fff
typedef signed short __int16_t;
typedef unsigned short __uint16_t;
#define ___int16_t_defined 1
#elif __EXP(SCHAR_MAX) == 0x7fff
typedef signed char __int16_t;
typedef unsigned char __uint16_t;
#define ___int16_t_defined 1
#endif
#if ___int16_t_defined
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
#define ___int_least16_t_defined 1
#if !___int8_t_defined
typedef __int16_t __int_least8_t;
typedef __uint16_t __uint_least8_t;
#define ___int_least8_t_defined 1
#endif
#endif
#if __EXP(INT_MAX) == 0x7fffffffL
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
#define ___int32_t_defined 1
#elif __EXP(LONG_MAX) == 0x7fffffffL
typedef signed long __int32_t;
typedef unsigned long __uint32_t;
#define ___int32_t_defined 1
#elif __EXP(SHRT_MAX) == 0x7fffffffL
typedef signed short __int32_t;
typedef unsigned short __uint32_t;
#define ___int32_t_defined 1
#elif __EXP(SCHAR_MAX) == 0x7fffffffL
typedef signed char __int32_t;
typedef unsigned char __uint32_t;
#define ___int32_t_defined 1
#endif
#if ___int32_t_defined
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
#define ___int_least32_t_defined 1
#if !___int8_t_defined
typedef __int32_t __int_least8_t;
typedef __uint32_t __uint_least8_t;
#define ___int_least8_t_defined 1
#endif
#if !___int16_t_defined
typedef __int32_t __int_least16_t;
typedef __uint32_t __uint_least16_t;
#define ___int_least16_t_defined 1
#endif
#endif
#if __EXP(LONG_MAX) > 0x7fffffff
typedef signed long __int64_t;
typedef unsigned long __uint64_t;
#define ___int64_t_defined 1
/* GCC has __LONG_LONG_MAX__ */
#elif defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff)
typedef signed long long __int64_t;
typedef unsigned long long __uint64_t;
#define ___int64_t_defined 1
/* POSIX mandates LLONG_MAX in <limits.h> */
#elif defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
typedef signed long long __int64_t;
typedef unsigned long long __uint64_t;
#define ___int64_t_defined 1
#elif __EXP(INT_MAX) > 0x7fffffff
typedef signed int __int64_t;
typedef unsigned int __uint64_t;
#define ___int64_t_defined 1
#endif
#undef __EXP
#ifndef _UID_T_
#define _UID_T_
typedef unsigned int uid_t;
#endif
#ifndef _FSBLKCNT_T_
#define _FSBLKCNT_T_
typedef unsigned long int fsblkcnt_t;
#endif
#ifndef _CLOCKID_T_
#define _CLOCKID_T_
typedef int clockid_t;
#endif
#endif /* Not RC_INVOKED */
#endif