mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 20:32:18 +00:00
Move all stuff from _mingw.h to crtdefs.h that belongs there. Get rid off MINGW_IMPORT
svn path=/trunk/; revision=38266
This commit is contained in:
parent
a4e64ebf0e
commit
1cfe56ee4b
3 changed files with 426 additions and 407 deletions
|
@ -4,11 +4,12 @@
|
||||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _INC_CRTDEFS
|
#ifndef _INC_MINGW
|
||||||
#define _INC_CRTDEFS
|
#define _INC_MINGW
|
||||||
|
|
||||||
#define _INTEGRAL_MAX_BITS 64
|
#define _INTEGRAL_MAX_BITS 64
|
||||||
|
|
||||||
|
// ROS HACK!
|
||||||
#ifndef _WIN64
|
#ifndef _WIN64
|
||||||
#ifndef _USE_32BIT_TIME_T
|
#ifndef _USE_32BIT_TIME_T
|
||||||
#define _USE_32BIT_TIME_T
|
#define _USE_32BIT_TIME_T
|
||||||
|
@ -30,69 +31,14 @@
|
||||||
#define __stdcall
|
#define __stdcall
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#ifdef __GNUC__
|
||||||
# ifdef _DLL
|
/* These compilers do support __declspec */
|
||||||
# ifndef __MINGW_IMPORT
|
# if !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__CYGWIN32__)
|
||||||
# define __MINGW_IMPORT __declspec(dllimport)
|
# define __declspec(x) __attribute__((x))
|
||||||
# endif
|
|
||||||
# ifndef _CRTIMP
|
|
||||||
# define _CRTIMP __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# ifndef __MINGW_IMPORT
|
|
||||||
# define __MINGW_IMPORT
|
|
||||||
# endif
|
|
||||||
# ifndef _CRTIMP
|
|
||||||
# define _CRTIMP
|
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
# define __DECLSPEC_SUPPORTED
|
|
||||||
# define __attribute__(x) /* nothing */
|
|
||||||
# define __restrict__ /* nothing */
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
# ifdef __declspec
|
|
||||||
# ifndef __MINGW_IMPORT
|
|
||||||
# ifdef _DLL
|
|
||||||
/* Note the extern. This is needed to work around GCC's
|
|
||||||
limitations in handling dllimport attribute. */
|
|
||||||
# define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
|
|
||||||
# else
|
|
||||||
# define __MINGW_IMPORT extern
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# ifndef _CRTIMP
|
|
||||||
# undef __USE_CRTIMP
|
|
||||||
# if !defined (_CRTBLD) && !defined (_SYSCRT)
|
|
||||||
# define __USE_CRTIMP 1
|
|
||||||
# endif
|
|
||||||
# ifdef __USE_CRTIMP
|
|
||||||
# ifdef _DLL
|
|
||||||
# define _CRTIMP __attribute__ ((dllimport))
|
|
||||||
# else
|
|
||||||
# define _CRTIMP
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# define _CRTIMP
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# define __DECLSPEC_SUPPORTED
|
|
||||||
# else /* __declspec */
|
|
||||||
# undef __DECLSPEC_SUPPORTED
|
|
||||||
# undef __MINGW_IMPORT
|
|
||||||
# ifndef _CRTIMP
|
|
||||||
# define _CRTIMP
|
|
||||||
# endif
|
|
||||||
# endif /* __declspec */
|
|
||||||
#else
|
#else
|
||||||
# ifndef __MINGW_IMPORT
|
|
||||||
# define __MINGW_IMPORT __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# ifndef _CRTIMP
|
|
||||||
# define _CRTIMP __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# define __DECLSPEC_SUPPORTED
|
|
||||||
# define __attribute__(x) /* nothing */
|
# define __attribute__(x) /* nothing */
|
||||||
#endif /* __GNUC__ */
|
#endif
|
||||||
|
|
||||||
#if defined (__GNUC__) && defined (__GNUC_MINOR__)
|
#if defined (__GNUC__) && defined (__GNUC_MINOR__)
|
||||||
#define __MINGW_GNUC_PREREQ(major, minor) \
|
#define __MINGW_GNUC_PREREQ(major, minor) \
|
||||||
|
@ -102,22 +48,12 @@ limitations in handling dllimport attribute. */
|
||||||
#define __MINGW_GNUC_PREREQ(major, minor) 0
|
#define __MINGW_GNUC_PREREQ(major, minor) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (_MSC_VER)
|
|
||||||
#define __MINGW_MSC_PREREQ(major,minor) \
|
|
||||||
((_MSC_VER /100) > (major) \
|
|
||||||
|| ((_MSC)VER /100) == (major) && (_MSC_VER) % 100) >=(minor)))
|
|
||||||
#else
|
|
||||||
#define __MINGW_MSC_PREREQ(major, minor) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define USE___UUIDOF 0
|
#define USE___UUIDOF 0
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
# define __CRT_INLINE inline
|
# define __CRT_INLINE inline
|
||||||
#else
|
#else
|
||||||
# if defined(_MSC_VER)
|
# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
|
||||||
# define __CRT_INLINE __inline
|
|
||||||
# elif __GNUC_STDC_INLINE__
|
|
||||||
# define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
|
# define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
|
||||||
# else
|
# else
|
||||||
# define __CRT_INLINE extern __inline__
|
# define __CRT_INLINE extern __inline__
|
||||||
|
@ -134,6 +70,16 @@ limitations in handling dllimport attribute. */
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
# define __unaligned
|
||||||
|
#else
|
||||||
|
# ifdef __GNUC__
|
||||||
|
# define __unaligned __attribute((packed))
|
||||||
|
# else
|
||||||
|
# define __UNUSED_PARAM(x) x
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
|
#define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
|
||||||
#define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
|
#define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
|
||||||
|
@ -186,48 +132,25 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */
|
||||||
# define __MSVCRT_VERSION__ 0x0700
|
# define __MSVCRT_VERSION__ 0x0700
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define __mingw_va_start(v,l) __builtin_va_start(v,l)
|
|
||||||
#define __mingw_va_end(v) __builtin_va_end(v)
|
|
||||||
#define __mingw_va_arg(v,l) __builtin_va_arg(v,l)
|
|
||||||
#define __mingw_va_copy(d,s) __builtin_va_copy(d,s)
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#define __mingw_va_start(v,l) __msc_va_start(v,l)
|
|
||||||
#define __mingw_va_end(v) __msc_va_end(v)
|
|
||||||
#define __mingw_va_arg(v,l) __msc_va_arg(v,l)
|
|
||||||
#define __mingw_va_copy(d,s) __msc_va_copy(d,s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//#ifndef WINVER
|
//#ifndef WINVER
|
||||||
//#define WINVER 0x0502
|
//#define WINVER 0x0502
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
#ifndef _WIN32_WINNT
|
//#ifndef _WIN32_WINNT
|
||||||
#define _WIN32_WINNT 0x502
|
//#define _WIN32_WINNT 0x502
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
#ifndef _INT128_DEFINED
|
|
||||||
#define _INT128_DEFINED
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define __int8 char
|
#define __int8 char
|
||||||
#define __int16 short
|
#define __int16 short
|
||||||
#define __int32 int
|
#define __int32 int
|
||||||
#define __int64 long long
|
#define __int64 long long
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
|
typedef int __int128 __attribute__ ((mode (TI)));
|
||||||
typedef int __int128 __attribute__ ((mode (TI)));
|
# endif
|
||||||
|
# define __ptr32
|
||||||
#endif
|
# define __ptr64
|
||||||
|
# define __forceinline extern __inline __attribute((always_inline))
|
||||||
#define __ptr32
|
|
||||||
#define __ptr64
|
|
||||||
#define __unaligned __attribute ((packed))
|
|
||||||
#define __forceinline extern __inline
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
#error Only Win32 target is supported!
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -240,190 +163,15 @@ typedef int __int128 __attribute__ ((mode (TI)));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef _CRT_PACKING
|
|
||||||
#define _CRT_PACKING 8
|
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
#undef USE_MINGW_SETJMP_TWO_ARGS
|
#undef USE_MINGW_SETJMP_TWO_ARGS
|
||||||
#define USE_MINGW_SETJMP_TWO_ARGS
|
#define USE_MINGW_SETJMP_TWO_ARGS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma pack(push,_CRT_PACKING)
|
|
||||||
|
|
||||||
#include <vadefs.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _CRT_STRINGIZE
|
|
||||||
#define __CRT_STRINGIZE(_Value) #_Value
|
|
||||||
#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRT_WIDE
|
|
||||||
#define __CRT_WIDE(_String) L ## _String
|
|
||||||
#define _CRT_WIDE(_String) __CRT_WIDE(_String)
|
|
||||||
#endif
|
|
||||||
#ifndef _W64
|
|
||||||
#define _W64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRTIMP_NOIA64
|
|
||||||
#ifdef __ia64__
|
|
||||||
#define _CRTIMP_NOIA64
|
|
||||||
#else
|
|
||||||
#define _CRTIMP_NOIA64 _CRTIMP
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRTIMP2
|
|
||||||
#define _CRTIMP2 _CRTIMP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRTIMP_ALTERNATIVE
|
|
||||||
#define _CRTIMP_ALTERNATIVE _CRTIMP
|
|
||||||
#define _CRT_ALTERNATIVE_IMPORTED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _MRTIMP2
|
|
||||||
#define _MRTIMP2 _CRTIMP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _DLL
|
|
||||||
#define _DLL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _MT
|
|
||||||
#define _MT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _MCRTIMP
|
|
||||||
#define _MCRTIMP _CRTIMP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRTIMP_PURE
|
|
||||||
#define _CRTIMP_PURE _CRTIMP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PGLOBAL
|
|
||||||
#define _PGLOBAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _AGLOBAL
|
|
||||||
#define _AGLOBAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define __STDC_SECURE_LIB__ 200411L
|
|
||||||
#define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
|
|
||||||
#define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
|
|
||||||
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
|
|
||||||
|
|
||||||
#ifndef _CRT_INSECURE_DEPRECATE_MEMORY
|
|
||||||
#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
|
|
||||||
#endif
|
|
||||||
#ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
|
|
||||||
#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
|
|
||||||
#endif
|
|
||||||
#ifndef _CRT_MANAGED_HEAP_DEPRECATE
|
|
||||||
#define _CRT_MANAGED_HEAP_DEPRECATE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRT_OBSOLETE
|
|
||||||
#define _CRT_OBSOLETE(_NewItem)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _SIZE_T_DEFINED
|
|
||||||
#define _SIZE_T_DEFINED
|
|
||||||
#undef size_t
|
|
||||||
#ifdef _WIN64
|
|
||||||
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
|
||||||
typedef unsigned int size_t __attribute__ ((mode (DI)));
|
|
||||||
#else
|
|
||||||
typedef unsigned __int64 size_t;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _SSIZE_T_DEFINED
|
|
||||||
#define _SSIZE_T_DEFINED
|
|
||||||
#undef ssize_t
|
|
||||||
#ifdef _WIN64
|
|
||||||
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
|
||||||
typedef int ssize_t __attribute__ ((mode (DI)));
|
|
||||||
#else
|
|
||||||
typedef __int64 ssize_t;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
typedef int ssize_t;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _INTPTR_T_DEFINED
|
|
||||||
#define _INTPTR_T_DEFINED
|
|
||||||
#ifndef __intptr_t_defined
|
|
||||||
#define __intptr_t_defined
|
|
||||||
#undef intptr_t
|
|
||||||
#ifdef _WIN64
|
|
||||||
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
|
||||||
typedef int intptr_t __attribute__ ((mode (DI)));
|
|
||||||
#else
|
|
||||||
typedef __int64 intptr_t;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
typedef int intptr_t;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _UINTPTR_T_DEFINED
|
|
||||||
#define _UINTPTR_T_DEFINED
|
|
||||||
#ifndef __uintptr_t_defined
|
|
||||||
#define __uintptr_t_defined
|
|
||||||
#undef uintptr_t
|
|
||||||
#ifdef _WIN64
|
|
||||||
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
|
||||||
typedef unsigned int uintptr_t __attribute__ ((mode (DI)));
|
|
||||||
#else
|
|
||||||
typedef unsigned __int64 uintptr_t;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PTRDIFF_T_DEFINED
|
|
||||||
#define _PTRDIFF_T_DEFINED
|
|
||||||
#ifndef _PTRDIFF_T_
|
|
||||||
#undef ptrdiff_t
|
|
||||||
#ifdef _WIN64
|
|
||||||
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
|
||||||
typedef int ptrdiff_t __attribute__ ((mode (DI)));
|
|
||||||
#else
|
|
||||||
typedef __int64 ptrdiff_t;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
typedef int ptrdiff_t;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _WCHAR_T_DEFINED
|
|
||||||
#define _WCHAR_T_DEFINED
|
|
||||||
#ifndef __cplusplus
|
|
||||||
typedef unsigned short wchar_t;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _WCTYPE_T_DEFINED
|
|
||||||
#define _WCTYPE_T_DEFINED
|
|
||||||
typedef unsigned short wint_t;
|
|
||||||
typedef unsigned short wctype_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __GNUC_VA_LIST
|
#ifndef __GNUC_VA_LIST
|
||||||
#define __GNUC_VA_LIST
|
#define __GNUC_VA_LIST
|
||||||
typedef __builtin_va_list __gnuc_va_list;
|
typedef __builtin_va_list __gnuc_va_list;
|
||||||
|
@ -434,128 +182,15 @@ extern "C" {
|
||||||
typedef __gnuc_va_list va_list;
|
typedef __gnuc_va_list va_list;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _USE_32BIT_TIME_T
|
/* Diable deprecation for now! */
|
||||||
#ifdef _WIN64
|
#define _CRT_SECURE_NO_DEPRECATE
|
||||||
#error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
|
#define _CRT_SECURE_NO_DEPRECATE_CORE
|
||||||
#undef _USE_32BIT_TIME_T
|
#ifdef __WINESRC__
|
||||||
#endif
|
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||||
#else
|
|
||||||
#if _INTEGRAL_MAX_BITS < 64
|
|
||||||
#define _USE_32BIT_TIME_T
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _ERRCODE_DEFINED
|
#if (defined(_MSC_VER) && __STDC__)// || !defined(__WINESRC__)
|
||||||
#define _ERRCODE_DEFINED
|
#define NO_OLDNAMES
|
||||||
typedef int errcode;
|
|
||||||
typedef int errno_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _TIME32_T_DEFINED
|
|
||||||
#define _TIME32_T_DEFINED
|
|
||||||
typedef long __time32_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _TIME64_T_DEFINED
|
|
||||||
#define _TIME64_T_DEFINED
|
|
||||||
//#if _INTEGRAL_MAX_BITS >= 64
|
|
||||||
typedef __int64 __time64_t;
|
|
||||||
#endif
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
#ifndef _TIME_T_DEFINED
|
|
||||||
#define _TIME_T_DEFINED
|
|
||||||
#ifdef _USE_32BIT_TIME_T
|
|
||||||
typedef __time32_t time_t;
|
|
||||||
#else
|
|
||||||
typedef __time64_t time_t;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CONST_RETURN
|
|
||||||
#define _CONST_RETURN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CRT_UNALIGNED
|
|
||||||
#define __CRT_UNALIGNED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef UNALIGNED
|
|
||||||
#if defined(__ia64__) || defined(__x86_64)
|
|
||||||
//#define UNALIGNED __CRT_UNALIGNED
|
|
||||||
#else
|
|
||||||
#define UNALIGNED
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRT_ALIGN
|
|
||||||
#define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRTNOALIAS
|
|
||||||
#define _CRTNOALIAS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _CRTRESTRICT
|
|
||||||
#define _CRTRESTRICT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CRTDECL
|
|
||||||
#define __CRTDECL __cdecl
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define _ARGMAX 100
|
|
||||||
|
|
||||||
#ifndef _TRUNCATE
|
|
||||||
#define _TRUNCATE ((size_t)-1)
|
|
||||||
#endif
|
|
||||||
struct threadlocaleinfostruct;
|
|
||||||
struct threadmbcinfostruct;
|
|
||||||
typedef struct threadlocaleinfostruct *pthreadlocinfo;
|
|
||||||
typedef struct threadmbcinfostruct *pthreadmbcinfo;
|
|
||||||
struct __lc_time_data;
|
|
||||||
|
|
||||||
typedef struct localeinfo_struct {
|
|
||||||
pthreadlocinfo locinfo;
|
|
||||||
pthreadmbcinfo mbcinfo;
|
|
||||||
} _locale_tstruct,*_locale_t;
|
|
||||||
|
|
||||||
#ifndef _TAGLC_ID_DEFINED
|
|
||||||
#define _TAGLC_ID_DEFINED
|
|
||||||
typedef struct tagLC_ID {
|
|
||||||
unsigned short wLanguage;
|
|
||||||
unsigned short wCountry;
|
|
||||||
unsigned short wCodePage;
|
|
||||||
} LC_ID,*LPLC_ID;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _THREADLOCALEINFO
|
|
||||||
#define _THREADLOCALEINFO
|
|
||||||
typedef struct threadlocaleinfostruct {
|
|
||||||
int refcount;
|
|
||||||
unsigned int lc_codepage;
|
|
||||||
unsigned int lc_collate_cp;
|
|
||||||
unsigned long lc_handle[6];
|
|
||||||
LC_ID lc_id[6];
|
|
||||||
struct {
|
|
||||||
char *locale;
|
|
||||||
wchar_t *wlocale;
|
|
||||||
int *refcount;
|
|
||||||
int *wrefcount;
|
|
||||||
} lc_category[6];
|
|
||||||
int lc_clike;
|
|
||||||
int mb_cur_max;
|
|
||||||
int *lconv_intl_refcount;
|
|
||||||
int *lconv_num_refcount;
|
|
||||||
int *lconv_mon_refcount;
|
|
||||||
struct lconv *lconv;
|
|
||||||
int *ctype1_refcount;
|
|
||||||
unsigned short *ctype1;
|
|
||||||
const unsigned short *pctype;
|
|
||||||
const unsigned char *pclmap;
|
|
||||||
const unsigned char *pcumap;
|
|
||||||
struct __lc_time_data *lc_time_curr;
|
|
||||||
} threadlocinfo;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -568,9 +203,7 @@ extern "C" {
|
||||||
#define _CRT_UNUSED(x) (void)x
|
#define _CRT_UNUSED(x) (void)x
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma pack(pop)
|
/* These are here for intrin.h */
|
||||||
|
|
||||||
/* There are here for intrin.h */
|
|
||||||
#ifndef _SIZE_T_DEFINED
|
#ifndef _SIZE_T_DEFINED
|
||||||
#define _SIZE_T_DEFINED
|
#define _SIZE_T_DEFINED
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
|
@ -591,5 +224,5 @@ extern "C" {
|
||||||
|
|
||||||
#include <mingw32/intrin.h>
|
#include <mingw32/intrin.h>
|
||||||
|
|
||||||
#endif
|
#endif /* !_INC_MINGW */
|
||||||
|
|
||||||
|
|
|
@ -4,3 +4,389 @@
|
||||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||||
*/
|
*/
|
||||||
#include <_mingw.h>
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#ifndef _INC_CRTDEFS
|
||||||
|
#define _INC_CRTDEFS
|
||||||
|
|
||||||
|
#ifdef _USE_32BIT_TIME_T
|
||||||
|
#ifdef _WIN64
|
||||||
|
#error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
|
||||||
|
#undef _USE_32BIT_TIME_T
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if _INTEGRAL_MAX_BITS < 64
|
||||||
|
#define _USE_32BIT_TIME_T
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Compatability definition */
|
||||||
|
#if _MSC_VER > 0 && __STDC__
|
||||||
|
#define NO_OLDNAMES
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Properties ***************************************************************/
|
||||||
|
|
||||||
|
#undef _CRT_PACKING
|
||||||
|
#define _CRT_PACKING 8
|
||||||
|
#pragma pack(push,_CRT_PACKING)
|
||||||
|
|
||||||
|
#ifndef _CRT_STRINGIZE
|
||||||
|
#define __CRT_STRINGIZE(_Value) #_Value
|
||||||
|
#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_WIDE
|
||||||
|
#define __CRT_WIDE(_String) L ## _String
|
||||||
|
#define _CRT_WIDE(_String) __CRT_WIDE(_String)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _W64
|
||||||
|
#if !defined(_midl) && defined(_X86_) && _MSC_VER >= 1300
|
||||||
|
#define _W64 __w64
|
||||||
|
#else
|
||||||
|
#define _W64
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRTIMP
|
||||||
|
#ifdef _DLL
|
||||||
|
#define _CRTIMP __declspec(dllimport)
|
||||||
|
#else
|
||||||
|
#define _CRTIMP
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#define _CRT_ALTERNATIVE_INLINES
|
||||||
|
|
||||||
|
#ifndef _CRTIMP_ALT
|
||||||
|
#ifdef _DLL
|
||||||
|
#ifdef _CRT_ALTERNATIVE_INLINES
|
||||||
|
#define _CRTIMP_ALT
|
||||||
|
#else
|
||||||
|
#define _CRTIMP_ALT _CRTIMP
|
||||||
|
#define _CRT_ALTERNATIVE_IMPORTED
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define _CRTIMP_ALT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRTDATA
|
||||||
|
#ifdef _M_CEE_PURE
|
||||||
|
#define _CRTDATA(x) x
|
||||||
|
#else
|
||||||
|
#define _CRTDATA(x) _CRTIMP x
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRTIMP2
|
||||||
|
#define _CRTIMP2 _CRTIMP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRTIMP_PURE
|
||||||
|
#define _CRTIMP_PURE _CRTIMP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRTIMP_ALTERNATIVE
|
||||||
|
#define _CRTIMP_ALTERNATIVE _CRTIMP
|
||||||
|
#define _CRT_ALTERNATIVE_IMPORTED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRTIMP_NOIA64
|
||||||
|
#ifdef __ia64__
|
||||||
|
#define _CRTIMP_NOIA64
|
||||||
|
#else
|
||||||
|
#define _CRTIMP_NOIA64 _CRTIMP
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _MRTIMP2
|
||||||
|
#define _MRTIMP2 _CRTIMP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _MCRTIMP
|
||||||
|
#define _MCRTIMP _CRTIMP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PGLOBAL
|
||||||
|
#define _PGLOBAL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _AGLOBAL
|
||||||
|
#define _AGLOBAL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CONST_RETURN
|
||||||
|
#define _CONST_RETURN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef UNALIGNED
|
||||||
|
#if defined(__ia64__) || defined(__x86_64)
|
||||||
|
#define UNALIGNED __unaligned
|
||||||
|
#else
|
||||||
|
#define UNALIGNED
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_ALIGN
|
||||||
|
#define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRTNOALIAS
|
||||||
|
#define _CRTNOALIAS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRTRESTRICT
|
||||||
|
#define _CRTRESTRICT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CRTDECL
|
||||||
|
#define __CRTDECL __cdecl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_UNUSED
|
||||||
|
#define _CRT_UNUSED(x) (void)x
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CONST_RETURN
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define _CONST_RETURN const
|
||||||
|
#define _CRT_CONST_CORRECT_OVERLOADS
|
||||||
|
#else
|
||||||
|
#define _CONST_RETURN
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __crt_typefix(ctype)
|
||||||
|
|
||||||
|
|
||||||
|
/** Deprecated ***************************************************************/
|
||||||
|
|
||||||
|
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
|
||||||
|
|
||||||
|
#ifndef _CRT_INSECURE_DEPRECATE
|
||||||
|
# ifdef _CRT_SECURE_NO_DEPRECATE
|
||||||
|
# define _CRT_INSECURE_DEPRECATE(_Replacement)
|
||||||
|
# else
|
||||||
|
# define _CRT_INSECURE_DEPRECATE(_Replacement) \
|
||||||
|
_CRT_DEPRECATE_TEXT("This may be unsafe, Try " #_Replacement " instead!")
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_INSECURE_DEPRECATE_CORE
|
||||||
|
# ifdef _CRT_SECURE_NO_DEPRECATE_CORE
|
||||||
|
# define _CRT_INSECURE_DEPRECATE_CORE(_Replacement)
|
||||||
|
# else
|
||||||
|
# define _CRT_INSECURE_DEPRECATE_CORE(_Replacement) \
|
||||||
|
_CRT_DEPRECATE_TEXT("This may be unsafe, Try " #_Replacement " instead! Enable _CRT_SECURE_NO_DEPRECATE to avoid thie warning.")
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_NONSTDC_DEPRECATE
|
||||||
|
# ifdef _CRT_NONSTDC_NO_DEPRECATE
|
||||||
|
# define _CRT_NONSTDC_DEPRECATE(_Replacement)
|
||||||
|
# else
|
||||||
|
# define _CRT_NONSTDC_DEPRECATE(_Replacement) \
|
||||||
|
_CRT_DEPRECATE_TEXT("Deprecated POSIX name, Try " #_Replacement " instead!")
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_INSECURE_DEPRECATE_MEMORY
|
||||||
|
#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
|
||||||
|
#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_MANAGED_HEAP_DEPRECATE
|
||||||
|
#define _CRT_MANAGED_HEAP_DEPRECATE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _CRT_OBSOLETE
|
||||||
|
#define _CRT_OBSOLETE(_NewItem)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Constants ****************************************************************/
|
||||||
|
|
||||||
|
#define _ARGMAX 100
|
||||||
|
|
||||||
|
#ifndef _TRUNCATE
|
||||||
|
#define _TRUNCATE ((size_t)-1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __STDC_SECURE_LIB__ 200411L
|
||||||
|
#define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
|
||||||
|
#define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** Type definitions *********************************************************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _SIZE_T_DEFINED
|
||||||
|
#define _SIZE_T_DEFINED
|
||||||
|
#undef size_t
|
||||||
|
#ifdef _WIN64
|
||||||
|
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
||||||
|
typedef unsigned int size_t __attribute__ ((mode (DI)));
|
||||||
|
#else
|
||||||
|
typedef unsigned __int64 size_t;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
typedef unsigned int size_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _INTPTR_T_DEFINED
|
||||||
|
#define _INTPTR_T_DEFINED
|
||||||
|
#ifndef __intptr_t_defined
|
||||||
|
#define __intptr_t_defined
|
||||||
|
#undef intptr_t
|
||||||
|
#ifdef _WIN64
|
||||||
|
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
||||||
|
typedef int intptr_t __attribute__ ((mode (DI)));
|
||||||
|
#else
|
||||||
|
typedef __int64 intptr_t;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
typedef int intptr_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _UINTPTR_T_DEFINED
|
||||||
|
#define _UINTPTR_T_DEFINED
|
||||||
|
#ifndef __uintptr_t_defined
|
||||||
|
#define __uintptr_t_defined
|
||||||
|
#undef uintptr_t
|
||||||
|
#ifdef _WIN64
|
||||||
|
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
||||||
|
typedef unsigned int uintptr_t __attribute__ ((mode (DI)));
|
||||||
|
#else
|
||||||
|
typedef unsigned __int64 uintptr_t;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
typedef unsigned int uintptr_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PTRDIFF_T_DEFINED
|
||||||
|
#define _PTRDIFF_T_DEFINED
|
||||||
|
#ifndef _PTRDIFF_T_
|
||||||
|
#undef ptrdiff_t
|
||||||
|
#ifdef _WIN64
|
||||||
|
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
|
||||||
|
typedef int ptrdiff_t __attribute__ ((mode (DI)));
|
||||||
|
#else
|
||||||
|
typedef __int64 ptrdiff_t;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
typedef int ptrdiff_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WCHAR_T_DEFINED
|
||||||
|
#define _WCHAR_T_DEFINED
|
||||||
|
#ifndef __cplusplus
|
||||||
|
typedef unsigned short wchar_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WCTYPE_T_DEFINED
|
||||||
|
#define _WCTYPE_T_DEFINED
|
||||||
|
typedef unsigned short wint_t;
|
||||||
|
typedef unsigned short wctype_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _ERRCODE_DEFINED
|
||||||
|
#define _ERRCODE_DEFINED
|
||||||
|
typedef int errcode;
|
||||||
|
typedef int errno_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TIME32_T_DEFINED
|
||||||
|
#define _TIME32_T_DEFINED
|
||||||
|
typedef long __time32_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TIME64_T_DEFINED
|
||||||
|
#define _TIME64_T_DEFINED
|
||||||
|
#if _INTEGRAL_MAX_BITS >= 64
|
||||||
|
typedef __int64 __time64_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TIME_T_DEFINED
|
||||||
|
#define _TIME_T_DEFINED
|
||||||
|
#ifdef _USE_32BIT_TIME_T
|
||||||
|
typedef __time32_t time_t;
|
||||||
|
#else
|
||||||
|
typedef __time64_t time_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct threadlocaleinfostruct;
|
||||||
|
typedef struct threadlocaleinfostruct *pthreadlocinfo;
|
||||||
|
|
||||||
|
struct threadmbcinfostruct;
|
||||||
|
typedef struct threadmbcinfostruct *pthreadmbcinfo;
|
||||||
|
|
||||||
|
struct __lc_time_data;
|
||||||
|
|
||||||
|
typedef struct localeinfo_struct {
|
||||||
|
pthreadlocinfo locinfo;
|
||||||
|
pthreadmbcinfo mbcinfo;
|
||||||
|
} _locale_tstruct,*_locale_t;
|
||||||
|
|
||||||
|
#ifndef _TAGLC_ID_DEFINED
|
||||||
|
#define _TAGLC_ID_DEFINED
|
||||||
|
typedef struct tagLC_ID {
|
||||||
|
unsigned short wLanguage;
|
||||||
|
unsigned short wCountry;
|
||||||
|
unsigned short wCodePage;
|
||||||
|
} LC_ID,*LPLC_ID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _THREADLOCALEINFO
|
||||||
|
#define _THREADLOCALEINFO
|
||||||
|
typedef struct threadlocaleinfostruct {
|
||||||
|
int refcount;
|
||||||
|
unsigned int lc_codepage;
|
||||||
|
unsigned int lc_collate_cp;
|
||||||
|
unsigned long lc_handle[6];
|
||||||
|
LC_ID lc_id[6];
|
||||||
|
struct {
|
||||||
|
char *locale;
|
||||||
|
wchar_t *wlocale;
|
||||||
|
int *refcount;
|
||||||
|
int *wrefcount;
|
||||||
|
} lc_category[6];
|
||||||
|
int lc_clike;
|
||||||
|
int mb_cur_max;
|
||||||
|
int *lconv_intl_refcount;
|
||||||
|
int *lconv_num_refcount;
|
||||||
|
int *lconv_mon_refcount;
|
||||||
|
struct lconv *lconv;
|
||||||
|
int *ctype1_refcount;
|
||||||
|
unsigned short *ctype1;
|
||||||
|
const unsigned short *pctype;
|
||||||
|
const unsigned char *pclmap;
|
||||||
|
const unsigned char *pcumap;
|
||||||
|
struct __lc_time_data *lc_time_curr;
|
||||||
|
} threadlocinfo;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
#endif /* !_INC_CRTDEFS */
|
||||||
|
|
|
@ -121,10 +121,10 @@ extern "C" {
|
||||||
|
|
||||||
#define CLOCKS_PER_SEC 1000
|
#define CLOCKS_PER_SEC 1000
|
||||||
|
|
||||||
__MINGW_IMPORT int _daylight;
|
_CRTDATA(extern int _daylight);
|
||||||
__MINGW_IMPORT long _dstbias;
|
_CRTDATA(extern long _dstbias);
|
||||||
__MINGW_IMPORT long _timezone;
|
_CRTDATA(extern long _timezone);
|
||||||
__MINGW_IMPORT char * _tzname[2];
|
_CRTDATA(extern char * _tzname[2]);
|
||||||
|
|
||||||
_CRTIMP errno_t __cdecl _get_daylight(int *_Daylight);
|
_CRTIMP errno_t __cdecl _get_daylight(int *_Daylight);
|
||||||
_CRTIMP errno_t __cdecl _get_dstbias(long *_Daylight_savings_bias);
|
_CRTIMP errno_t __cdecl _get_dstbias(long *_Daylight_savings_bias);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue