[VCRUNTIME] Move compiler runtime headers into their own folder

These headers come with the MS compiler. Some of them are standard, like emmintrin.h, others are MS specific like crtdefs.h
This separation will allow using MS CRT headers. Eventually it can allow compiling with the compilers' runtime headers.
This commit is contained in:
Timo Kreuzer 2024-05-11 08:11:36 +03:00
parent 7b2bb7ecc8
commit 84344399b5
39 changed files with 2 additions and 1 deletions

View file

@ -0,0 +1,268 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_MINGW
#define _INC_MINGW
#ifndef _INTEGRAL_MAX_BITS
#define _INTEGRAL_MAX_BITS 64
#endif
#ifndef MINGW64
#define MINGW64
#define MINGW64_VERSION 1.0
#define MINGW64_VERSION_MAJOR 1
#define MINGW64_VERSION_MINOR 0
#define MINGW64_VERSION_STATE "alpha"
#endif
#ifdef _WIN64
#ifdef __stdcall
#undef __stdcall
#endif
#define __stdcall
#endif
#ifdef __GNUC__
/* These compilers do support __declspec */
# if !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__CYGWIN32__)
# define __declspec(x) __attribute__((x))
# endif
#endif
#ifdef _MSC_VER
#define __restrict__ /* nothing */
#endif
#if defined (__GNUC__) && defined (__GNUC_MINOR__)
#define __MINGW_GNUC_PREREQ(major, minor) \
(__GNUC__ > (major) \
|| (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
#else
#define __MINGW_GNUC_PREREQ(major, minor) 0
#endif
#if defined (_MSC_VER)
#define __MINGW_MSC_PREREQ(major, minor) (_MSC_VER >= (major * 100 + minor * 10))
#else
#define __MINGW_MSC_PREREQ(major, minor) 0
#endif
#define USE___UUIDOF 0
#ifdef __cplusplus
# define __CRT_INLINE inline
#elif defined(_MSC_VER)
# define __CRT_INLINE __inline
#elif defined(__GNUC__)
# if defined(__clang__) || ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
# define __CRT_INLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
# else
# define __CRT_INLINE extern __inline__ __attribute__((__always_inline__))
# endif
#endif
#ifdef __cplusplus
# define __UNUSED_PARAM(x)
#else
# ifdef __GNUC__
# define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
# else
# define __UNUSED_PARAM(x) x
# endif
#endif
#ifdef __cplusplus
# define __unaligned
#else
# ifdef __GNUC__
# define __unaligned
# elif defined(_MSC_VER) && !defined(_M_IA64) && !defined(_M_AMD64)
# define __unaligned
# else
# define __unaligned
# endif
#endif
#ifdef __GNUC__
#define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
#define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
#elif __MINGW_MSC_PREREQ(12, 0)
#define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
#define __MINGW_ATTRIB_CONST
#else
#define __MINGW_ATTRIB_NORETURN
#define __MINGW_ATTRIB_CONST
#endif
#if __MINGW_GNUC_PREREQ (3, 0)
#define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
#define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
#elif __MINGW_MSC_PREREQ(14, 0)
#define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
#define __MINGW_ATTRIB_PURE
#else
#define __MINGW_ATTRIB_MALLOC
#define __MINGW_ATTRIB_PURE
#endif
/* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
variadiac macro facility, because variadic macros cause syntax
errors with --traditional-cpp. */
#if __MINGW_GNUC_PREREQ (3, 3)
#define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
#else
#define __MINGW_ATTRIB_NONNULL(arg)
#endif /* GNUC >= 3.3 */
#ifdef __GNUC__
#define __MINGW_ATTRIB_UNUSED __attribute__ ((__unused__))
#else
#define __MINGW_ATTRIB_UNUSED
#endif /* ATTRIBUTE_UNUSED */
#if __MINGW_GNUC_PREREQ (3, 1)
#define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
#elif __MINGW_MSC_PREREQ(12, 0)
#define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
#else
#define __MINGW_ATTRIB_DEPRECATED
#endif
#if __MINGW_GNUC_PREREQ (3, 1)
#define __MINGW_ATTRIB_DEPRECATED_SEC_WARN //__attribute__ ((__deprecated__))
#elif __MINGW_MSC_PREREQ(12, 0)
#define __MINGW_ATTRIB_DEPRECATED_SEC_WARN //__declspec(deprecated)
#else
#define __MINGW_ATTRIB_DEPRECATED_SEC_WARN
#endif
#if __MINGW_GNUC_PREREQ (3, 1)
#define __MINGW_ATTRIB_DEPRECATED_MSVC2005 //__attribute__ ((__deprecated__))
#elif __MINGW_MSC_PREREQ(12, 0)
#define __MINGW_ATTRIB_DEPRECATED_MSVC2005 //__declspec(deprecated)
#else
#define __MINGW_ATTRIB_DEPRECATED_MSVC2005
#endif
#if __MINGW_GNUC_PREREQ (3, 3)
#define __MINGW_NOTHROW __attribute__ ((__nothrow__))
#elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
#define __MINGW_NOTHROW __declspec(nothrow)
#else
#define __MINGW_NOTHROW
#endif
/* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
allow GCC to optimize away some EH unwind code, at least in DW2 case. */
#ifndef __MINGW_EXTENSION
#if defined(__GNUC__) || defined(__GNUG__)
#define __MINGW_EXTENSION __extension__
#else
#define __MINGW_EXTENSION
#endif
#endif
#ifndef __MSVCRT_VERSION__
/* High byte is the major version, low byte is the minor. */
# define __MSVCRT_VERSION__ 0x0700
#endif
//#ifndef WINVER
//#define WINVER 0x0502
//#endif
//#ifndef _WIN32_WINNT
//#define _WIN32_WINNT 0x502
//#endif
#ifdef __GNUC__
#define __int8 char
#define __int16 short
#define __int32 int
#define __int64 long long
# define __ptr32
# define __ptr64
# ifdef __cplusplus
# define __forceinline inline __attribute__((__always_inline__))
# else
# if (( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) || defined(__clang__))
# define __forceinline extern inline __attribute__((__always_inline__,__gnu_inline__))
# else
# define __forceinline extern __inline__ __attribute__((__always_inline__))
# endif
# endif
#endif
#ifdef __cplusplus
#ifndef __nothrow
#define __nothrow __declspec(nothrow)
#endif
#else
#ifndef __nothrow
#define __nothrow
#endif
#endif
#if defined(_WIN64) && !defined(_MSC_VER)
#undef USE_MINGW_SETJMP_TWO_ARGS
#define USE_MINGW_SETJMP_TWO_ARGS
#endif
/* Disable deprecation for now! */
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE_CORE
#define __crt_typefix(ctype)
#ifndef _CRT_UNUSED
#define _CRT_UNUSED(x) (void)x
#endif
#if defined(_MSC_VER) && !defined(__clang__)
#define ATTRIB_NORETURN
#define _DECLSPEC_INTRIN_TYPE __declspec(intrin_type)
#else
#define ATTRIB_NORETURN DECLSPEC_NORETURN
#define _DECLSPEC_INTRIN_TYPE
#endif
/* Define to a function attribute for Microsoft hotpatch assembly prefix. */
#ifndef DECLSPEC_HOTPATCH
#if defined(_MSC_VER) || defined(__clang__)
/* FIXME: http://llvm.org/bugs/show_bug.cgi?id=20888 */
#define DECLSPEC_HOTPATCH
#else
#define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__))
#endif
#endif /* DECLSPEC_HOTPATCH */
#ifndef __INTRIN_INLINE
# define __INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__,artificial))
#endif
#ifndef HAS_BUILTIN
# ifdef __clang__
# define HAS_BUILTIN(x) __has_builtin(x)
# else
# define HAS_BUILTIN(x) 0
# endif
#endif
#ifdef __cplusplus
# define __mingw_ovr inline __cdecl
#elif defined (__GNUC__)
# define __mingw_ovr static \
__attribute__ ((__unused__)) __inline__ __cdecl
#else
# define __mingw_ovr static __cdecl
#endif /* __cplusplus */
#include "_mingw_mac.h"
#endif /* !_INC_MINGW */

View file

@ -0,0 +1,146 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_CRTDEFS_MACRO
#define _INC_CRTDEFS_MACRO
#define __STRINGIFY(x) #x
#define __MINGW64_STRINGIFY(x) __STRINGIFY(x)
#define __MINGW64_VERSION_MAJOR 1
#define __MINGW64_VERSION_MINOR 1
#define __MINGW64_VERSION_STR __MINGW64_STRINGIFY(__MINGW64_VERSION_MAJOR) "." __MINGW64_STRINGIFY(__MINGW64_VERSION_MINOR)
#define __MINGW64_VERSION_STATE "alpha"
/* mingw.org's version macros: these make gcc to define
MINGW32_SUPPORTS_MT_EH and to use the _CRT_MT global
and the __mingwthr_key_dtor() function from the MinGW
CRT in its private gthr-win32.h header. */
#define __MINGW32_MAJOR_VERSION 3
#define __MINGW32_MINOR_VERSION 11
#ifndef _M_IX86
/* MS does not prefix symbols by underscores for anything other than x86. */
#ifndef __MINGW_USE_UNDERSCORE_PREFIX
/* As we have to support older gcc version, which are using underscores
as symbol prefix for x64, we have to check here for the user label
prefix defined by gcc. */
#ifdef __USER_LABEL_PREFIX__
#pragma push_macro ("_")
#undef _
#define _ 1
#if (__USER_LABEL_PREFIX__ + 0) != 0
#define __MINGW_USE_UNDERSCORE_PREFIX 1
#else
#define __MINGW_USE_UNDERSCORE_PREFIX 0
#endif
#undef _
#pragma pop_macro ("_")
#else
#define __MINGW_USE_UNDERSCORE_PREFIX 0
#endif
#endif
#else
/* For 32-bits we have always to prefix by underscore. */
#undef __MINGW_USE_UNDERSCORE_PREFIX
#define __MINGW_USE_UNDERSCORE_PREFIX 1
#endif
#if __MINGW_USE_UNDERSCORE_PREFIX == 0
#define __MINGW_IMP_SYMBOL(sym) __imp_##sym
#define __MINGW_USYMBOL(sym) sym
#define __MINGW_LSYMBOL(sym) _##sym
#else
#define __MINGW_IMP_SYMBOL(sym) _imp__##sym
#define __MINGW_USYMBOL(sym) _##sym
#define __MINGW_LSYMBOL(sym) sym
#endif
/* Use alias for msvcr80 export of get/set_output_format. */
#ifndef __USE_MINGW_OUTPUT_FORMAT_EMU
#define __USE_MINGW_OUTPUT_FORMAT_EMU 1
#endif
/* Set VC specific compiler target macros. */
#if defined(__x86_64) && defined(_X86_)
#undef _X86_ /* _X86_ is not for __x86_64 */
#endif
#if defined(_X86_) && !defined(_M_IX86) && !defined(_M_IA64) \
&& !defined(_M_AMD64) && !defined(__x86_64)
#if defined(__i486__)
#define _M_IX86 400
#elif defined(__i586__)
#define _M_IX86 500
#else
/* This gives wrong (600 instead of 300) value if -march=i386 is specified
but we cannot check for__i386__ as it is defined for all 32-bit CPUs. */
#define _M_IX86 600
#endif
#endif
#if defined(__x86_64) && !defined(_M_IX86) && !defined(_M_IA64) \
&& !defined(_M_AMD64)
#define _M_AMD64 100
#define _M_X64 100
#endif
#if defined(__ia64__) && !defined(_M_IX86) && !defined(_M_IA64) \
&& !defined(_M_AMD64) && !defined(_X86_) && !defined(__x86_64)
#define _M_IA64 100
#endif
#ifndef __PTRDIFF_TYPE__
#ifdef _WIN64
#define __PTRDIFF_TYPE__ long long int
#else
#define __PTRDIFF_TYPE__ long int
#endif
#endif
#ifndef __SIZE_TYPE__
#ifdef _WIN64
#define __SIZE_TYPE__ long long unsigned int
#else
#define __SIZE_TYPE__ long unsigned int
#endif
#endif
#ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ unsigned short
#endif
#ifndef __WINT_TYPE__
#define __WINT_TYPE__ unsigned short
#endif
#undef __MINGW_EXTENSION
#if defined(__GNUC__) || defined(__GNUG__)
#define __MINGW_EXTENSION __extension__
#else
#define __MINGW_EXTENSION
#endif
/* Special case nameless struct/union. */
#ifndef __C89_NAMELESS
#define __C89_NAMELESS __MINGW_EXTENSION
#define __C89_NAMELESSSTRUCTNAME
#define __C89_NAMELESSUNIONNAME
#endif
#ifndef __GNU_EXTENSION
#define __GNU_EXTENSION __MINGW_EXTENSION
#endif
/* MinGW-w64 has some additional C99 printf/scanf feature support.
So we add some helper macros to ease recognition of them. */
#define __MINGW_HAVE_ANSI_C99_PRINTF 1
#define __MINGW_HAVE_WIDE_C99_PRINTF 1
#define __MINGW_HAVE_ANSI_C99_SCANF 1
#define __MINGW_HAVE_WIDE_C99_SCANF 1
#endif /* _INC_CRTDEFS_MACRO */

View file

@ -0,0 +1,33 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#if !defined(_INC_CRT_UNICODE_MACROS)
/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */
#if defined(UNICODE)
# define _INC_CRT_UNICODE_MACROS 1
# define __MINGW_NAME_AW(func) func##W
# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext
# define __MINGW_NAME_UAW(func) func##_W
# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext
# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */
# define __MINGW_PROCNAMEEXT_AW "W"
#else
# define _INC_CRT_UNICODE_MACROS 2
# define __MINGW_NAME_AW(func) func##A
# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext
# define __MINGW_NAME_UAW(func) func##_A
# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext
# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */
# define __MINGW_PROCNAMEEXT_AW "A"
#endif
#define __MINGW_TYPEDEF_AW(type) \
typedef __MINGW_NAME_AW(type) type;
#define __MINGW_TYPEDEF_UAW(type) \
typedef __MINGW_NAME_UAW(type) type;
#endif /* !defined(_INC_CRT_UNICODE_MACROS) */

View file

@ -0,0 +1,106 @@
#pragma once
#if defined(__cplusplus)
extern "C" {
#endif
typedef enum _tag_ARMINTR_SHIFT_T
{
_ARM_LSR = 0,
_ARM_LSL = 1,
_ARM_ASR = 2,
_ARM_ROR = 3
} _ARMINTR_SHIFT_T;
typedef enum _tag_ARMINTR_CPS_OP
{
_ARM_CPS_ENABLE_INTERRUPTS = 1,
_ARM_CPS_DISABLE_INTERRUPTS = 2,
_ARM_CPS_CHANGE_MODE = 4
} _ARMINTR_CPS_OP;
typedef enum _tag_ARMINTR_CPS_FLAG
{
_ARM_CPS_INTERRUPT_FLAG_F = 1,
_ARM_CPS_INTERRUPT_FLAG_I = 2,
_ARM_CPS_INTERRUPT_FLAG_A = 4
} _ARMINTR_CPS_FLAG;
typedef enum _tag_ARMINTR_BARRIER_TYPE
{
_ARM_BARRIER_SY = 0xF,
_ARM_BARRIER_ST = 0xE,
_ARM_BARRIER_ISH = 0xB,
_ARM_BARRIER_ISHST = 0xA,
_ARM_BARRIER_NSH = 0x7,
_ARM_BARRIER_NSHST = 0x6,
_ARM_BARRIER_OSH = 0x3,
_ARM_BARRIER_OSHST = 0x2
} _ARMINTR_BARRIER_TYPE;
typedef enum _tag_ARMINTR_BANKED_REG
{
_ARM_BANKED_R8_USR = 0x0,
_ARM_BANKED_R9_USR = 0x1,
_ARM_BANKED_R10_USR = 0x2,
_ARM_BANKED_R11_USR = 0x3,
_ARM_BANKED_R12_USR = 0x4,
_ARM_BANKED_R13_USR = 0x5,
_ARM_BANKED_SP_USR = 0x5,
_ARM_BANKED_R14_USR = 0x6,
_ARM_BANKED_LR_USR = 0x6,
_ARM_BANKED_R8_FIQ = 0x8,
_ARM_BANKED_R9_FIQ = 0x9,
_ARM_BANKED_R10_FIQ = 0xA,
_ARM_BANKED_R11_FIQ = 0xB,
_ARM_BANKED_R12_FIQ = 0xC,
_ARM_BANKED_R13_FIQ = 0xD,
_ARM_BANKED_SP_FIQ = 0xD,
_ARM_BANKED_R14_FIQ = 0xE,
_ARM_BANKED_LR_FIQ = 0xE,
_ARM_BANKED_R14_IRQ = 0x10,
_ARM_BANKED_LR_IRQ = 0x10,
_ARM_BANKED_R13_IRQ = 0x11,
_ARM_BANKED_SP_IRQ = 0x11,
_ARM_BANKED_R14_SVC = 0x12,
_ARM_BANKED_LR_SVC = 0x12,
_ARM_BANKED_R13_SVC = 0x13,
_ARM_BANKED_SP_SVC = 0x13,
_ARM_BANKED_R14_ABT = 0x14,
_ARM_BANKED_LR_ABT = 0x14,
_ARM_BANKED_R13_ABT = 0x15,
_ARM_BANKED_SP_ABT = 0x15,
_ARM_BANKED_R14_UND = 0x16,
_ARM_BANKED_LR_UND = 0x16,
_ARM_BANKED_R13_UND = 0x17,
_ARM_BANKED_SP_UND = 0x17,
_ARM_BANKED_R14_MON = 0x1C,
_ARM_BANKED_LR_MON = 0x1C,
_ARM_BANKED_R13_MON = 0x1D,
_ARM_BANKED_SP_MON = 0x1D,
_ARM_BANKED_ELR_HYP = 0x1E,
_ARM_BANKED_R13_HYP = 0x1F,
_ARM_BANKED_SP_HYP = 0x1F,
_ARM_BANKED_SPSR_FIQ = 0x2E,
_ARM_BANKED_SPSR_IRQ = 0x30,
_ARM_BANKED_SPSR_SVC = 0x32,
_ARM_BANKED_SPSR_ABT = 0x34,
_ARM_BANKED_SPSR_UND = 0x36,
_ARM_BANKED_SPSR_MON = 0x3C,
_ARM_BANKED_SPSR_HYP = 0x3E
} _ARMINTR_BANKED_REG;
void __dmb(unsigned int Type);
void __dsb(unsigned int Type);
void __isb(unsigned int Type);
#pragma intrinsic(__dmb)
#pragma intrinsic(__dsb)
#pragma intrinsic(__isb)
#if defined(__cplusplus)
} // extern "C"
#endif

View file

@ -0,0 +1,211 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_COMDEF
#define _INC_COMDEF
#include <_mingw.h>
#ifndef RC_INVOKED
#ifndef __cplusplus
#error Native Compiler support only available in C++ compiler
#endif
#include <ole2.h>
#include <olectl.h>
#include <comutil.h>
#ifndef WINAPI
#define WINAPI __stdcall
#endif
#ifdef __cplusplus
class _com_error;
void WINAPI _com_raise_error(HRESULT hr,IErrorInfo *perrinfo = 0);
void WINAPI _set_com_error_handler(void (WINAPI *pHandler)(HRESULT hr,IErrorInfo *perrinfo));
void WINAPI _com_issue_error(HRESULT);
void WINAPI _com_issue_errorex(HRESULT,IUnknown*,REFIID);
HRESULT WINAPI _com_dispatch_propget(IDispatch*,DISPID,VARTYPE,void*);
HRESULT __cdecl _com_dispatch_propput(IDispatch*,DISPID,VARTYPE,...);
HRESULT __cdecl _com_dispatch_method(IDispatch*,DISPID,WORD,VARTYPE,void*,const wchar_t*,...);
HRESULT WINAPI _com_dispatch_raw_propget(IDispatch*,DISPID,VARTYPE,void*) throw();
HRESULT __cdecl _com_dispatch_raw_propput(IDispatch*,DISPID,VARTYPE,...) throw();
HRESULT __cdecl _com_dispatch_raw_method(IDispatch*,DISPID,WORD,VARTYPE,void*,const wchar_t*,...) throw();
class _com_error {
public:
_com_error(HRESULT hr,IErrorInfo *perrinfo = NULL,bool fAddRef = false) throw();
_com_error(const _com_error &that) throw();
virtual ~_com_error() throw();
_com_error &operator=(const _com_error &that) throw();
HRESULT Error() const throw();
WORD WCode() const throw();
IErrorInfo *ErrorInfo() const throw();
_bstr_t Description() const;
DWORD HelpContext() const throw();
_bstr_t HelpFile() const;
_bstr_t Source() const;
GUID GUID_() const throw();
const TCHAR *ErrorMessage() const throw();
static HRESULT WCodeToHRESULT(WORD wCode) throw();
static WORD HRESULTToWCode(HRESULT hr) throw();
private:
void Dtor() throw();
void Ctor(const _com_error &that) throw();
enum {
WCODE_HRESULT_FIRST = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x200),WCODE_HRESULT_LAST = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF+1,0) - 1
};
HRESULT m_hresult;
IErrorInfo *m_perrinfo;
mutable TCHAR *m_pszMsg;
};
inline _com_error::_com_error(HRESULT hr,IErrorInfo *perrinfo,bool fAddRef) throw() : m_hresult(hr),m_perrinfo(perrinfo),m_pszMsg(NULL) {
if(m_perrinfo!=NULL && fAddRef) m_perrinfo->AddRef();
}
inline _com_error::_com_error(const _com_error &that) throw() {
Ctor(that);
}
inline _com_error::~_com_error() throw() {
Dtor();
}
inline _com_error &_com_error::operator=(const _com_error &that) throw() {
if(this!=&that) {
Dtor();
Ctor(that);
}
return *this;
}
inline HRESULT _com_error::Error() const throw() { return m_hresult; }
inline WORD _com_error::WCode() const throw() { return HRESULTToWCode(m_hresult); }
inline IErrorInfo *_com_error::ErrorInfo() const throw() {
if(m_perrinfo!=NULL) m_perrinfo->AddRef();
return m_perrinfo;
}
inline _bstr_t _com_error::Description() const {
BSTR bstr = NULL;
if(m_perrinfo!=NULL) m_perrinfo->GetDescription(&bstr);
return _bstr_t(bstr,false);
}
inline DWORD _com_error::HelpContext() const throw() {
DWORD dwHelpContext = 0;
if(m_perrinfo!=NULL) m_perrinfo->GetHelpContext(&dwHelpContext);
return dwHelpContext;
}
inline _bstr_t _com_error::HelpFile() const {
BSTR bstr = NULL;
if(m_perrinfo!=NULL) m_perrinfo->GetHelpFile(&bstr);
return _bstr_t(bstr,false);
}
inline _bstr_t _com_error::Source() const {
BSTR bstr = NULL;
if(m_perrinfo!=NULL) m_perrinfo->GetSource(&bstr);
return _bstr_t(bstr,false);
}
inline _GUID _com_error::GUID_() const throw() {
_GUID guid;
memset (&guid, 0, sizeof (_GUID));
if(m_perrinfo!=NULL) m_perrinfo->GetGUID(&guid);
return guid;
}
inline const TCHAR *_com_error::ErrorMessage() const throw() {
if(!m_pszMsg) {
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,NULL,m_hresult,MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),(LPTSTR)&m_pszMsg,0,NULL);
if(m_pszMsg!=NULL) {
int nLen = lstrlen(m_pszMsg);
if(nLen > 1 && m_pszMsg[nLen - 1]=='\n') {
m_pszMsg[nLen-1] = 0;
if(m_pszMsg[nLen - 2]=='\r') m_pszMsg[nLen-2] = 0;
}
} else {
m_pszMsg = (LPTSTR)LocalAlloc(0,32 *sizeof(TCHAR));
if(m_pszMsg!=NULL) {
WORD wCode = WCode();
if(wCode!=0) {
_COM_PRINTF_S_1(m_pszMsg,32,TEXT("IDispatch error #%d"),wCode);
} else {
_COM_PRINTF_S_1(m_pszMsg,32,TEXT("Unknown error 0x%0lX"),m_hresult);
}
}
}
}
return m_pszMsg;
}
inline HRESULT _com_error::WCodeToHRESULT(WORD wCode) throw() { return wCode >= 0xFE00 ? WCODE_HRESULT_LAST : WCODE_HRESULT_FIRST + wCode; }
inline WORD _com_error::HRESULTToWCode(HRESULT hr) throw() { return (hr >= WCODE_HRESULT_FIRST && hr <= WCODE_HRESULT_LAST) ? WORD(hr - WCODE_HRESULT_FIRST) : 0; }
inline void _com_error::Dtor() throw() {
if(m_perrinfo!=NULL) m_perrinfo->Release();
if(m_pszMsg!=NULL) LocalFree((HLOCAL)m_pszMsg);
}
inline void _com_error::Ctor(const _com_error &that) throw() {
m_hresult = that.m_hresult;
m_perrinfo = that.m_perrinfo;
m_pszMsg = NULL;
if(m_perrinfo!=NULL) m_perrinfo->AddRef();
}
typedef int __missing_type__;
#if !defined(_COM_SMARTPTR)
#if !defined(_INC_COMIP)
#include <comip.h>
#endif
#define _COM_SMARTPTR _com_ptr_t
#define _COM_SMARTPTR_LEVEL2 _com_IIID
#endif
#if defined(_COM_SMARTPTR)
#if !defined(_COM_SMARTPTR_TYPEDEF)
#if defined(_COM_SMARTPTR_LEVEL2)
#define _COM_SMARTPTR_TYPEDEF(Interface,IID) UUID IIDArgForTypedef ## Interface = IID; typedef _COM_SMARTPTR< _COM_SMARTPTR_LEVEL2<Interface, &IIDArgForTypedef ## Interface > > Interface ## Ptr
#else
#define _COM_SMARTPTR_TYPEDEF(Interface,IID) UUID IIDArgForTypedef ## Interface = IID; typedef _COM_SMARTPTR<Interface,&IIDArgForTypedef ## Interface > Interface ## Ptr
#endif
#endif
#endif
#if !defined(_COM_NO_STANDARD_GUIDS_)
#if defined(__IFontDisp_INTERFACE_DEFINED__)
#if !defined(Font)
struct Font : IFontDisp {};
#endif
_COM_SMARTPTR_TYPEDEF(Font, IID_IDispatch);
#endif
#if defined(__IFontEventsDisp_INTERFACE_DEFINED__)
#if !defined(FontEvents)
struct FontEvents : IFontEventsDisp {};
#endif
_COM_SMARTPTR_TYPEDEF(FontEvents, IID_IDispatch);
#endif
#if defined(__IPictureDisp_INTERFACE_DEFINED__)
#if !defined(Picture)
struct Picture : IPictureDisp {};
#endif
_COM_SMARTPTR_TYPEDEF(Picture, IID_IDispatch);
#endif
#include "comdefsp.h"
#endif
#endif
#endif /* __cplusplus */
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,378 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_COMIP
#define _INC_COMIP
#include <_mingw.h>
#include <ole2.h>
#include <malloc.h>
#include <comutil.h>
#ifdef __cplusplus
#pragma push_macro("new")
#undef new
#include <new.h>
class _com_error;
#ifndef WINAPI
#define WINAPI __stdcall
#endif
void WINAPI _com_issue_error(HRESULT);
struct IUnknown;
template<typename _Interface,const IID *_IID >
class _com_IIID {
public:
typedef _Interface Interface;
static _Interface *GetInterfacePtr() throw() { return NULL; }
static _Interface& GetInterface() throw() { return *GetInterfacePtr(); }
static const IID& GetIID() throw() { return *_IID; }
};
template<typename _IIID> class _com_ptr_t {
public:
typedef _IIID ThisIIID;
typedef typename _IIID::Interface Interface;
static const IID& GetIID() throw() { return ThisIIID::GetIID(); }
template<typename _OtherIID> _com_ptr_t(const _com_ptr_t<_OtherIID> &p) : m_pInterface(NULL) {
HRESULT hr = _QueryInterface(p);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
}
template<typename _InterfaceType> _com_ptr_t(_InterfaceType *p) : m_pInterface(NULL) {
HRESULT hr = _QueryInterface(p);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
}
template<typename _X> _com_ptr_t(LPSTR str) { new(this) _com_ptr_t(static_cast<LPCSTR> (str),NULL); }
template<typename _X> _com_ptr_t(LPWSTR str) { new(this) _com_ptr_t(static_cast<LPCWSTR> (str),NULL); }
template<typename _X> explicit _com_ptr_t(_com_ptr_t *p) : m_pInterface(NULL) {
if(!p) { _com_issue_error(E_POINTER); }
else {
m_pInterface = p->m_pInterface;
AddRef();
}
}
_com_ptr_t() throw() : m_pInterface(NULL) { }
_com_ptr_t(int null) : m_pInterface(NULL) {
if(null!=0) { _com_issue_error(E_POINTER); }
}
#ifdef _NATIVE_NULLPTR_SUPPORTED
_com_ptr_t(decltype(nullptr)) : m_pInterface(NULL) {}
#endif
_com_ptr_t(const _com_ptr_t &cp) throw() : m_pInterface(cp.m_pInterface) { _AddRef(); }
template<typename _X> _com_ptr_t(Interface *pInterface) throw() : m_pInterface(pInterface) { _AddRef(); }
_com_ptr_t(Interface *pInterface,bool fAddRef) throw() : m_pInterface(pInterface) {
if(fAddRef) _AddRef();
}
_com_ptr_t(const _variant_t& varSrc) : m_pInterface(NULL) {
HRESULT hr = QueryStdInterfaces(varSrc);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
}
explicit _com_ptr_t(const CLSID &clsid,IUnknown *pOuter = NULL,DWORD dwClsContext = CLSCTX_ALL) : m_pInterface(NULL) {
HRESULT hr = CreateInstance(clsid,pOuter,dwClsContext);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
}
explicit _com_ptr_t(LPCWSTR str,IUnknown *pOuter = NULL,DWORD dwClsContext = CLSCTX_ALL) : m_pInterface(NULL) {
HRESULT hr = CreateInstance(str,pOuter,dwClsContext);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
}
explicit _com_ptr_t(LPCSTR str,IUnknown *pOuter = NULL,DWORD dwClsContext = CLSCTX_ALL) : m_pInterface(NULL) {
HRESULT hr = CreateInstance(str,pOuter,dwClsContext);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
}
template<typename _OtherIID> _com_ptr_t &operator=(const _com_ptr_t<_OtherIID> &p) {
HRESULT hr = _QueryInterface(p);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
return *this;
}
template<typename _InterfaceType> _com_ptr_t &operator=(_InterfaceType *p) {
HRESULT hr = _QueryInterface(p);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
return *this;
}
template<typename _X> _com_ptr_t &operator=(Interface *pInterface) throw() {
if(m_pInterface!=pInterface) {
Interface *pOldInterface = m_pInterface;
m_pInterface = pInterface;
_AddRef();
if(pOldInterface!=NULL) pOldInterface->Release();
}
return *this;
}
_com_ptr_t &operator=(const _com_ptr_t &cp) throw() { return operator=(cp.m_pInterface); }
_com_ptr_t &operator=(int null) {
if(null!=0) { _com_issue_error(E_POINTER); }
return operator=(reinterpret_cast<Interface*>(NULL));
}
_com_ptr_t &operator=(const _variant_t& varSrc) {
HRESULT hr = QueryStdInterfaces(varSrc);
if(FAILED(hr) && (hr!=E_NOINTERFACE)) { _com_issue_error(hr); }
return *this;
}
~_com_ptr_t() throw() { _Release(); }
void Attach(Interface *pInterface) throw() {
_Release();
m_pInterface = pInterface;
}
void Attach(Interface *pInterface,bool fAddRef) throw() {
_Release();
m_pInterface = pInterface;
if(fAddRef) {
if(!pInterface) { _com_issue_error(E_POINTER); }
else pInterface->AddRef();
}
}
Interface *Detach() throw() {
Interface *const old = m_pInterface;
m_pInterface = NULL;
return old;
}
operator Interface*() const throw() { return m_pInterface; }
operator Interface&() const {
if(!m_pInterface) { _com_issue_error(E_POINTER); }
return *m_pInterface;
}
Interface& operator*() const {
if(!m_pInterface) { _com_issue_error(E_POINTER); }
return *m_pInterface;
}
Interface **operator&() throw() {
_Release();
m_pInterface = NULL;
return &m_pInterface;
}
Interface *operator->() const {
if(!m_pInterface) { _com_issue_error(E_POINTER); }
return m_pInterface;
}
operator bool() const throw() { return m_pInterface!=NULL; }
template<typename _OtherIID> bool operator==(const _com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)==0; }
template<typename _OtherIID> bool operator==(_com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)==0; }
template<typename _InterfaceType> bool operator==(_InterfaceType *p) { return _CompareUnknown(p)==0; }
template<typename _X> bool operator==(Interface *p) { return (m_pInterface==p) ? true : _CompareUnknown(p)==0; }
template<typename _X> bool operator==(const _com_ptr_t &p) throw() { return operator==(p.m_pInterface); }
template<typename _X> bool operator==(_com_ptr_t &p) throw() { return operator==(p.m_pInterface); }
bool operator==(int null) {
if(null!=0) { _com_issue_error(E_POINTER); }
return !m_pInterface;
}
template<typename _OtherIID> bool operator!=(const _com_ptr_t<_OtherIID> &p) { return !(operator==(p)); }
template<typename _OtherIID> bool operator!=(_com_ptr_t<_OtherIID> &p) { return !(operator==(p)); }
template<typename _InterfaceType> bool operator!=(_InterfaceType *p) { return !(operator==(p)); }
bool operator!=(int null) { return !(operator==(null)); }
template<typename _OtherIID> bool operator<(const _com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)<0; }
template<typename _OtherIID> bool operator<(_com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)<0; }
template<typename _InterfaceType> bool operator<(_InterfaceType *p) { return _CompareUnknown(p)<0; }
template<typename _OtherIID> bool operator>(const _com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)>0; }
template<typename _OtherIID> bool operator>(_com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)>0; }
template<typename _InterfaceType> bool operator>(_InterfaceType *p) { return _CompareUnknown(p)>0; }
template<typename _OtherIID> bool operator<=(const _com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)<=0; }
template<typename _OtherIID> bool operator<=(_com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)<=0; }
template<typename _InterfaceType> bool operator<=(_InterfaceType *p) { return _CompareUnknown(p)<=0; }
template<typename _OtherIID> bool operator>=(const _com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)>=0; }
template<typename _OtherIID> bool operator>=(_com_ptr_t<_OtherIID> &p) { return _CompareUnknown(p)>=0; }
template<typename _InterfaceType> bool operator>=(_InterfaceType *p) { return _CompareUnknown(p)>=0; }
void Release() {
if(!m_pInterface) { _com_issue_error(E_POINTER); }
else {
m_pInterface->Release();
m_pInterface = NULL;
}
}
void AddRef() {
if(!m_pInterface) { _com_issue_error(E_POINTER); }
else m_pInterface->AddRef();
}
Interface *GetInterfacePtr() const throw() { return m_pInterface; }
Interface*& GetInterfacePtr() throw() { return m_pInterface; }
HRESULT CreateInstance(const CLSID &rclsid,IUnknown *pOuter = NULL,DWORD dwClsContext = CLSCTX_ALL) throw() {
HRESULT hr;
_Release();
if(dwClsContext & (CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)) {
IUnknown *pIUnknown;
hr = CoCreateInstance(rclsid,pOuter,dwClsContext,IID_IUnknown,reinterpret_cast<void**>(&pIUnknown));
if(SUCCEEDED(hr)) {
hr = OleRun(pIUnknown);
if(SUCCEEDED(hr)) hr = pIUnknown->QueryInterface(GetIID(),reinterpret_cast<void**>(&m_pInterface));
pIUnknown->Release();
}
} else hr = CoCreateInstance(rclsid,pOuter,dwClsContext,GetIID(),reinterpret_cast<void**>(&m_pInterface));
if(FAILED(hr)) m_pInterface = NULL;
return hr;
}
HRESULT CreateInstance(LPCWSTR clsidString,IUnknown *pOuter = NULL,DWORD dwClsContext = CLSCTX_ALL) throw() {
if(!clsidString) return E_INVALIDARG;
CLSID clsid;
HRESULT hr;
if(clsidString[0]==L'{') hr = CLSIDFromString(const_cast<LPWSTR> (clsidString),&clsid);
else hr = CLSIDFromProgID(const_cast<LPWSTR> (clsidString),&clsid);
if(FAILED(hr)) return hr;
return CreateInstance(clsid,pOuter,dwClsContext);
}
HRESULT CreateInstance(LPCSTR clsidStringA,IUnknown *pOuter = NULL,DWORD dwClsContext = CLSCTX_ALL) throw() {
if(!clsidStringA) return E_INVALIDARG;
int size = lstrlenA(clsidStringA) + 1;
int destSize = MultiByteToWideChar(CP_ACP,0,clsidStringA,size,NULL,0);
if(destSize==0) return HRESULT_FROM_WIN32(GetLastError());
LPWSTR clsidStringW;
clsidStringW = static_cast<LPWSTR>(_malloca(destSize*sizeof(WCHAR)));
if(!clsidStringW) return E_OUTOFMEMORY;
if(MultiByteToWideChar(CP_ACP,0,clsidStringA,size,clsidStringW,destSize)==0) {
_freea(clsidStringW);
return HRESULT_FROM_WIN32(GetLastError());
}
HRESULT hr=CreateInstance(clsidStringW,pOuter,dwClsContext);
_freea(clsidStringW);
return hr;
}
HRESULT GetActiveObject(const CLSID &rclsid) throw() {
_Release();
IUnknown *pIUnknown;
HRESULT hr = ::GetActiveObject(rclsid,NULL,&pIUnknown);
if(SUCCEEDED(hr)) {
hr = pIUnknown->QueryInterface(GetIID(),reinterpret_cast<void**>(&m_pInterface));
pIUnknown->Release();
}
if(FAILED(hr)) m_pInterface = NULL;
return hr;
}
HRESULT GetActiveObject(LPCWSTR clsidString) throw() {
if(!clsidString) return E_INVALIDARG;
CLSID clsid;
HRESULT hr;
if(clsidString[0]=='{') hr = CLSIDFromString(const_cast<LPWSTR> (clsidString),&clsid);
else hr = CLSIDFromProgID(const_cast<LPWSTR> (clsidString),&clsid);
if(FAILED(hr)) return hr;
return GetActiveObject(clsid);
}
HRESULT GetActiveObject(LPCSTR clsidStringA) throw() {
if(!clsidStringA) return E_INVALIDARG;
int size = lstrlenA(clsidStringA) + 1;
int destSize = MultiByteToWideChar(CP_ACP,0,clsidStringA,size,NULL,0);
LPWSTR clsidStringW;
try {
clsidStringW = static_cast<LPWSTR>(_alloca(destSize*sizeof(WCHAR)));
} catch (...) {
clsidStringW = NULL;
}
if(!clsidStringW) return E_OUTOFMEMORY;
if(MultiByteToWideChar(CP_ACP,0,clsidStringA,size,clsidStringW,destSize)==0) return HRESULT_FROM_WIN32(GetLastError());
return GetActiveObject(clsidStringW);
}
template<typename _InterfaceType> HRESULT QueryInterface(const IID& iid,_InterfaceType*& p) throw () {
if(m_pInterface!=NULL) return m_pInterface->QueryInterface(iid,reinterpret_cast<void**>(&p));
return E_POINTER;
}
template<typename _InterfaceType> HRESULT QueryInterface(const IID& iid,_InterfaceType **p) throw() { return QueryInterface(iid,*p); }
private:
Interface *m_pInterface;
void _Release() throw() {
if(m_pInterface!=NULL) m_pInterface->Release();
}
void _AddRef() throw() {
if(m_pInterface!=NULL) m_pInterface->AddRef();
}
template<typename _InterfacePtr> HRESULT _QueryInterface(_InterfacePtr p) throw() {
HRESULT hr;
if(p!=NULL) {
Interface *pInterface;
hr = p->QueryInterface(GetIID(),reinterpret_cast<void**>(&pInterface));
Attach(SUCCEEDED(hr)? pInterface: NULL);
} else {
operator=(static_cast<Interface*>(NULL));
hr = E_NOINTERFACE;
}
return hr;
}
template<typename _InterfacePtr> int _CompareUnknown(_InterfacePtr p) {
IUnknown *pu1,*pu2;
if(m_pInterface!=NULL) {
HRESULT hr = m_pInterface->QueryInterface(IID_IUnknown,reinterpret_cast<void**>(&pu1));
if(FAILED(hr)) {
_com_issue_error(hr);
pu1 = NULL;
} else pu1->Release();
} else pu1 = NULL;
if(p!=NULL) {
HRESULT hr = p->QueryInterface(IID_IUnknown,reinterpret_cast<void**>(&pu2));
if(FAILED(hr)) {
_com_issue_error(hr);
pu2 = NULL;
} else pu2->Release();
} else pu2 = NULL;
return pu1 - pu2;
}
HRESULT QueryStdInterfaces(const _variant_t& varSrc) throw() {
if(V_VT(&varSrc)==VT_DISPATCH) return _QueryInterface(V_DISPATCH(&varSrc));
if(V_VT(&varSrc)==VT_UNKNOWN) return _QueryInterface(V_UNKNOWN(&varSrc));
VARIANT varDest;
VariantInit(&varDest);
HRESULT hr = VariantChangeType(&varDest,const_cast<VARIANT*>(static_cast<const VARIANT*>(&varSrc)),0,VT_DISPATCH);
if(SUCCEEDED(hr)) hr = _QueryInterface(V_DISPATCH(&varSrc));
if(hr==E_NOINTERFACE) {
VariantInit(&varDest);
hr = VariantChangeType(&varDest,const_cast<VARIANT*>(static_cast<const VARIANT*>(&varSrc)),0,VT_UNKNOWN);
if(SUCCEEDED(hr)) hr = _QueryInterface(V_UNKNOWN(&varSrc));
}
VariantClear(&varDest);
return hr;
}
};
template<typename _InterfaceType> bool operator==(int null,_com_ptr_t<_InterfaceType> &p) {
if(null!=0) { _com_issue_error(E_POINTER); }
return !p;
}
template<typename _Interface,typename _InterfacePtr> bool operator==(_Interface *i,_com_ptr_t<_InterfacePtr> &p) { return p==i; }
template<typename _Interface> bool operator!=(int null,_com_ptr_t<_Interface> &p) {
if(null!=0) { _com_issue_error(E_POINTER); }
return p!=NULL;
}
template<typename _Interface,typename _InterfacePtr> bool operator!=(_Interface *i,_com_ptr_t<_InterfacePtr> &p) { return p!=i; }
template<typename _Interface> bool operator<(int null,_com_ptr_t<_Interface> &p) {
if(null!=0) { _com_issue_error(E_POINTER); }
return p>NULL;
}
template<typename _Interface,typename _InterfacePtr> bool operator<(_Interface *i,_com_ptr_t<_InterfacePtr> &p) { return p>i; }
template<typename _Interface> bool operator>(int null,_com_ptr_t<_Interface> &p) {
if(null!=0) { _com_issue_error(E_POINTER); }
return p<NULL;
}
template<typename _Interface,typename _InterfacePtr> bool operator>(_Interface *i,_com_ptr_t<_InterfacePtr> &p) { return p<i; }
template<typename _Interface> bool operator<=(int null,_com_ptr_t<_Interface> &p) {
if(null!=0) { _com_issue_error(E_POINTER); }
return p>=NULL;
}
template<typename _Interface,typename _InterfacePtr> bool operator<=(_Interface *i,_com_ptr_t<_InterfacePtr> &p) { return p>=i; }
template<typename _Interface> bool operator>=(int null,_com_ptr_t<_Interface> &p) {
if(null!=0) { _com_issue_error(E_POINTER); }
return p<=NULL;
}
template<typename _Interface,typename _InterfacePtr> bool operator>=(_Interface *i,_com_ptr_t<_InterfacePtr> &p) { return p<=i; }
#pragma pop_macro("new")
#endif /* __cplusplus */
#endif /* _INC_COMIP */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,481 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#include <_mingw.h>
#include <specstrings.h>
#ifndef _INC_CRTDEFS
#define _INC_CRTDEFS
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
#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
#undef _CRT_PACKING
#define _CRT_PACKING 8
#pragma pack(push,_CRT_PACKING)
/* Disable non-ANSI C definitions if compiling with __STDC__ */
#if (!defined _CRT_DECLARE_NONSTDC_NAMES || !_CRT_DECLARE_NONSTDC_NAMES) && (defined _CRT_DECLARE_NONSTDC_NAMES || __STDC__)
#define NO_OLDNAMES
#endif
#if defined(__GNUC__) && !defined(__clang__)
#define _CRT_DISABLE_GCC_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wbuiltin-declaration-mismatch\"") \
_Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"")
#define _CRT_RESTORE_GCC_WARNINGS _Pragma("GCC diagnostic pop")
#else // __GNUC__
#define _CRT_DISABLE_GCC_WARNINGS
#define _CRT_RESTORE_GCC_WARNINGS
#endif // __GNUC__
/** Properties ***************************************************************/
#ifndef _CRT_STRINGIZE
#define __CRT_STRINGIZE(_Value) #_Value
#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
#endif
#ifndef _CRT_DEFER_MACRO
#define _CRT_DEFER_MACRO(M,...) M(__VA_ARGS__)
#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 CRTDLL /* Defined for ntdll, crtdll, msvcrt, etc */
#define _CRTIMP
#elif defined(_DLL)
#define _CRTIMP __declspec(dllimport)
#else /* !CRTDLL && !_DLL */
#define _CRTIMP
#endif /* CRTDLL || _DLL */
#endif /* !_CRTIMP */
//#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 UNALIGNED
#if defined(__ia64__) || defined(__x86_64) || defined(__arm__) || defined(__arm64__)
#define UNALIGNED __unaligned
#else
#define UNALIGNED
#endif
#endif
#ifndef _CRT_ALIGN
#if defined (__midl) || defined(__WIDL__)
#define _CRT_ALIGN(x)
#elif defined(_MSC_VER)
#define _CRT_ALIGN(x) __declspec(align(x))
#else
#define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
#endif
#endif
#ifndef _CRTNOALIAS
#define _CRTNOALIAS
#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)
#ifndef _STATIC_ASSERT
#ifdef __cplusplus
#define _STATIC_ASSERT(expr) static_assert((expr), #expr)
#elif defined(__clang__) || defined(__GNUC__)
#define _STATIC_ASSERT(expr) _Static_assert((expr), #expr)
#else
#define _STATIC_ASSERT(expr) extern char (*__static_assert__(void)) [(expr) ? 1 : -1]
#endif
#endif /* _STATIC_ASSERT */
/** Deprecated ***************************************************************/
#ifdef __GNUC__
#define _CRT_DEPRECATE_TEXT(_Text) __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
#else
#define _CRT_DEPRECATE_TEXT(_Text)
#endif
#ifndef __STDC_WANT_SECURE_LIB__
#define __STDC_WANT_SECURE_LIB__ 1
#endif
#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
#ifndef _CRT_JIT_INTRINSIC
#define _CRT_JIT_INTRINSIC
#endif
/** Constants ****************************************************************/
#define _ARGMAX 100
#ifndef _TRUNCATE
#define _TRUNCATE ((size_t)-1)
#endif
#ifndef __REACTOS__
#define __STDC_SECURE_LIB__ 200411L
#define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
#define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
#endif
/** 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
__MINGW_EXTENSION 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
__MINGW_EXTENSION 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
__MINGW_EXTENSION 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
__MINGW_EXTENSION typedef __int64 ptrdiff_t;
#endif
#else
typedef int ptrdiff_t;
#endif
#endif
#endif
#ifndef _WCHAR_T_DEFINED
#define _WCHAR_T_DEFINED
#if defined(_MSC_VER) || !defined(__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
#ifdef __GNUC__
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
typedef __builtin_va_list __gnuc_va_list;
#endif
#endif
#ifndef _VA_LIST_DEFINED
#define _VA_LIST_DEFINED
#if defined(__GNUC__)
typedef __gnuc_va_list va_list;
#elif defined(_MSC_VER)
typedef _Writable_bytes_(_Inexpressible_("length varies")) char * va_list;
#endif
#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
__MINGW_EXTENSION 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 threadmbcinfostruct;
typedef struct threadmbcinfostruct *pthreadmbcinfo;
#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, *pthreadlocinfo;
#endif
struct __lc_time_data;
#ifdef __cplusplus
}
#endif
#if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN)
#define _Check_return_opt_ _Check_return_
#else
#define _Check_return_opt_
#endif
#if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN_WAT)
#define _Check_return_wat_ _Check_return_
#else
#define _Check_return_wat_
#endif
#pragma pack(pop)
/* GCC-style diagnostics */
#ifndef PRAGMA_DIAGNOSTIC_IGNORED
# ifdef __clang__
# define PRAGMA_DIAGNOSTIC_PUSH() _Pragma("clang diagnostic push")
# define PRAGMA_DIAGNOSTIC_IGNORED(__x) \
_Pragma(_CRT_STRINGIZE(clang diagnostic ignored _CRT_DEFER_MACRO(_CRT_STRINGIZE,__x)))
# define PRAGMA_DIAGNOSTIC_POP() _Pragma("clang diagnostic pop")
# elif defined (__GNUC__)
# define PRAGMA_DIAGNOSTIC_PUSH() _Pragma("GCC diagnostic push")
# define PRAGMA_DIAGNOSTIC_IGNORED(__x) \
_Pragma("GCC diagnostic ignored \"-Wpragmas\"") /* This allows us to use it for unkonwn warnings */ \
_Pragma(_CRT_STRINGIZE(GCC diagnostic ignored _CRT_DEFER_MACRO(_CRT_STRINGIZE,__x))) \
_Pragma("GCC diagnostic error \"-Wpragmas\"") /* This makes sure that we don't have side effects because we disabled it for our own use. This will be popped anyway. */
# define PRAGMA_DIAGNOSTIC_POP() _Pragma("GCC diagnostic pop")
# else
# define PRAGMA_DIAGNOSTIC_PUSH()
# define PRAGMA_DIAGNOSTIC_IGNORED(__x)
# define PRAGMA_DIAGNOSTIC_POP()
# endif
#endif
#endif /* !_INC_CRTDEFS */

View file

@ -0,0 +1,40 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#include <corecrt.h>
#ifndef _EH_H_
#define _EH_H_
#ifndef RC_INVOKED
#pragma pack(push,_CRT_PACKING)
#ifndef __cplusplus
#error eh.h is only for C++!
#endif
typedef void (__cdecl *terminate_function)(void);
typedef void (__cdecl *terminate_handler)(void);
typedef void (__cdecl *unexpected_function)(void);
typedef void (__cdecl *unexpected_handler)(void);
struct _EXCEPTION_POINTERS;
typedef void (__cdecl *_se_translator_function)(unsigned int,struct _EXCEPTION_POINTERS *);
_CRTIMP __declspec(noreturn) void __cdecl terminate(void);
_CRTIMP void __cdecl unexpected(void);
_CRTIMP int __cdecl _is_exception_typeof(const type_info &_Type,struct _EXCEPTION_POINTERS *_ExceptionPtr);
_CRTIMP terminate_function __cdecl set_terminate(terminate_function _NewPtFunc);
extern "C" _CRTIMP terminate_function __cdecl _get_terminate(void);
_CRTIMP unexpected_function __cdecl set_unexpected(unexpected_function _NewPtFunc);
extern "C" _CRTIMP unexpected_function __cdecl _get_unexpected(void);
_CRTIMP _se_translator_function __cdecl _set_se_translator(_se_translator_function _NewPtFunc);
_CRTIMP bool __cdecl __uncaught_exception(void);
#pragma pack(pop)
#endif
#endif /* End _EH_H_ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,154 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_EXCPT
#define _INC_EXCPT
#include <crtdefs.h>
#pragma pack(push,_CRT_PACKING)
#ifdef __cplusplus
extern "C" {
#endif
typedef enum _EXCEPTION_DISPOSITION
{
ExceptionContinueExecution,
ExceptionContinueSearch,
ExceptionNestedException,
ExceptionCollidedUnwind,
} EXCEPTION_DISPOSITION;
#if (defined(_X86_) && !defined(__x86_64))
struct _EXCEPTION_RECORD;
struct _CONTEXT;
EXCEPTION_DISPOSITION
__cdecl
_except_handler(
_In_ struct _EXCEPTION_RECORD *_ExceptionRecord,
_In_ void *_EstablisherFrame,
_Inout_ struct _CONTEXT *_ContextRecord,
_Inout_ void *_DispatcherContext);
#elif defined(__ia64__)
typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
struct _EXCEPTION_RECORD;
struct _CONTEXT;
struct _DISPATCHER_CONTEXT;
__MINGW_EXTENSION
_CRTIMP
EXCEPTION_DISPOSITION
__cdecl
__C_specific_handler(
_In_ struct _EXCEPTION_RECORD *_ExceptionRecord,
_In_ unsigned __int64 _MemoryStackFp,
_In_ unsigned __int64 _BackingStoreFp,
_Inout_ struct _CONTEXT *_ContextRecord,
_Inout_ struct _DISPATCHER_CONTEXT *_DispatcherContext,
_In_ unsigned __int64 _GlobalPointer);
#elif defined(__x86_64) || defined(_M_ARM) || defined(_M_ARM64)
struct _EXCEPTION_RECORD;
struct _CONTEXT;
struct _DISPATCHER_CONTEXT;
_CRTIMP
EXCEPTION_DISPOSITION
__cdecl
__C_specific_handler(
_In_ struct _EXCEPTION_RECORD *_ExceptionRecord,
_In_ void *_EstablisherFrame,
_Inout_ struct _CONTEXT *_ContextRecord,
_Inout_ struct _DISPATCHER_CONTEXT *_DispatcherContext);
#endif
#if defined(_MSC_VER) || (defined(__clang__) && defined(__SEH__))
#define GetExceptionCode _exception_code
#define exception_code _exception_code
#define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
#define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
#define AbnormalTermination _abnormal_termination
#define abnormal_termination _abnormal_termination
unsigned long __cdecl _exception_code(void);
void *__cdecl _exception_info(void);
int __cdecl _abnormal_termination(void);
#endif
#define EXCEPTION_EXECUTE_HANDLER 1
#define EXCEPTION_CONTINUE_SEARCH 0
#define EXCEPTION_CONTINUE_EXECUTION -1
#if 0
/* CRT stuff */
typedef void (__cdecl * _PHNDLR)(int);
struct _XCPT_ACTION {
unsigned long XcptNum;
int SigNum;
_PHNDLR XcptAction;
};
extern struct _XCPT_ACTION _XcptActTab[];
extern int _XcptActTabCount;
extern int _XcptActTabSize;
extern int _First_FPE_Indx;
extern int _Num_FPE;
int __cdecl __CppXcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
int __cdecl _XcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
/*
* The type of function that is expected as an exception handler to be
* installed with _try1.
*/
typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
#ifndef HAVE_NO_SEH
/*
* This is not entirely necessary, but it is the structure installed by
* the _try1 primitive below.
*/
typedef struct _EXCEPTION_REGISTRATION {
struct _EXCEPTION_REGISTRATION *prev;
EXCEPTION_DISPOSITION (*handler)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
} EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
#endif
#if (defined(_X86_) && !defined(__x86_64))
#define __try1(pHandler) \
__asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
#define __except1 \
__asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
: : : "%eax");
#elif defined(__x86_64)
#define __try1(pHandler) \
__asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler));
#define __except1 \
__asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \
: : : "%rax");
#else
#define __try1(pHandler)
#define __except1
#endif
#endif // 0
#ifdef __cplusplus
}
#endif
#pragma pack(pop)
#endif

View file

@ -0,0 +1,26 @@
/*
* PROJECT: ReactOS PSDK
* LICENSE: MIT (https://spdx.org/licenses/MIT)
* PURPOSE: Standard Annotation Language (SAL) definitions - GCC overrides
* COPYRIGHT: 2021 - Jérôme Gardou
*/
#pragma once
#ifndef __GNUC__
#error "Not for your compiler!"
#endif
#ifndef __has_attribute
#pragma GCC warning "GCC without __has_attribute, no SAL niceties for you"
#define __has_attribute(__x) 0
#endif
#if __has_attribute(warn_unused_result)
# undef _Must_inspect_result_
/* FIXME: Not really equivalent */
# define _Must_inspect_result_ __attribute__((__warn_unused_result__))
# undef _Check_return_
/* This one is 1:1 equivalent */
# define _Check_return_ __attribute__((__warn_unused_result__))
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,85 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#pragma once
#include <crtdefs.h>
#ifndef _INC_LIMITS
#define _INC_LIMITS
/*
* File system limits
*
* TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
* same as FILENAME_MAX and FOPEN_MAX from stdio.h?
* NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
* required for the NUL. TODO: Test?
*/
#define PATH_MAX (259)
#define CHAR_BIT 8
#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
#define UCHAR_MAX 0xff
#ifdef _CHAR_UNSIGNED
#define CHAR_MIN 0
#define CHAR_MAX UCHAR_MAX
#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
#endif /* _CHAR_UNSIGNED */
#define MB_LEN_MAX 5
#define SHRT_MIN (-32768)
#define SHRT_MAX 32767
#define USHRT_MAX 0xffff
#define INT_MIN (-2147483647 - 1)
#define INT_MAX 2147483647
#define UINT_MAX 0xffffffff
#define LONG_MIN (-2147483647L - 1)
#define LONG_MAX 2147483647L
#define ULONG_MAX 0xffffffffUL
#define LLONG_MAX 9223372036854775807LL
#define LLONG_MIN (-9223372036854775807LL - 1)
#define ULLONG_MAX 0xffffffffffffffffULL
#define _I8_MIN ((signed char)(-127 - 1))
#define _I8_MAX ((signed char)127)
#define _UI8_MAX ((unsigned char)0xff)
#define _I16_MIN ((short)(-32767 - 1))
#define _I16_MAX ((short)32767)
#define _UI16_MAX ((unsigned short)0xffffU)
#define _I32_MIN (-2147483647 - 1)
#define _I32_MAX 2147483647
#define _UI32_MAX 0xffffffffu
#define _I64_MIN (-9223372036854775807LL - 1)
#define _I64_MAX 9223372036854775807LL
#define _UI64_MAX 0xffffffffffffffffULL
#if defined(_MSC_VER) && (_INTEGRAL_MAX_BITS >= 128)
#define _I128_MIN (-170141183460469231731687303715884105727i128 - 1)
#define _I128_MAX 170141183460469231731687303715884105727i128
#define _UI128_MAX 0xffffffffffffffffffffffffffffffffui128
#endif
#ifndef SIZE_MAX
#ifdef _WIN64
#define SIZE_MAX _UI64_MAX
#else
#define SIZE_MAX UINT_MAX
#endif
#endif /* SIZE_MAX */
#if __STDC_WANT_SECURE_LIB__
#ifndef RSIZE_MAX
#define RSIZE_MAX SIZE_MAX
#endif /* RSIZE_MAX */
#endif /* __STDC_WANT_SECURE_LIB__ */
#endif /* _INC_LIMITS */

View file

@ -0,0 +1,162 @@
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you include this header file into source
files compiled by GCC, this header file does not by itself cause
the resulting executable to be covered by the GNU General Public
License. This exception does not however invalidate any other
reasons why the executable file might be covered by the GNU General
Public License. */
/*
* ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h>
*/
#ifndef _FLOAT_H___
#define _FLOAT_H___
/* Radix of exponent representation, b. */
#undef FLT_RADIX
#define FLT_RADIX __FLT_RADIX__
/* Number of base-FLT_RADIX digits in the significand, p. */
#undef FLT_MANT_DIG
#undef DBL_MANT_DIG
#undef LDBL_MANT_DIG
#define FLT_MANT_DIG __FLT_MANT_DIG__
#define DBL_MANT_DIG __DBL_MANT_DIG__
#define LDBL_MANT_DIG __LDBL_MANT_DIG__
/* Number of decimal digits, q, such that any floating-point number with q
decimal digits can be rounded into a floating-point number with p radix b
digits and back again without change to the q decimal digits,
p * log10(b) if b is a power of 10
floor((p - 1) * log10(b)) otherwise
*/
#undef FLT_DIG
#undef DBL_DIG
#undef LDBL_DIG
#define FLT_DIG __FLT_DIG__
#define DBL_DIG __DBL_DIG__
#define LDBL_DIG __LDBL_DIG__
/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */
#undef FLT_MIN_EXP
#undef DBL_MIN_EXP
#undef LDBL_MIN_EXP
#define FLT_MIN_EXP __FLT_MIN_EXP__
#define DBL_MIN_EXP __DBL_MIN_EXP__
#define LDBL_MIN_EXP __LDBL_MIN_EXP__
/* Minimum negative integer such that 10 raised to that power is in the
range of normalized floating-point numbers,
ceil(log10(b) * (emin - 1))
*/
#undef FLT_MIN_10_EXP
#undef DBL_MIN_10_EXP
#undef LDBL_MIN_10_EXP
#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */
#undef FLT_MAX_EXP
#undef DBL_MAX_EXP
#undef LDBL_MAX_EXP
#define FLT_MAX_EXP __FLT_MAX_EXP__
#define DBL_MAX_EXP __DBL_MAX_EXP__
#define LDBL_MAX_EXP __LDBL_MAX_EXP__
/* Maximum integer such that 10 raised to that power is in the range of
representable finite floating-point numbers,
floor(log10((1 - b**-p) * b**emax))
*/
#undef FLT_MAX_10_EXP
#undef DBL_MAX_10_EXP
#undef LDBL_MAX_10_EXP
#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
/* Maximum representable finite floating-point number,
(1 - b**-p) * b**emax
*/
#undef FLT_MAX
#undef DBL_MAX
#undef LDBL_MAX
#define FLT_MAX __FLT_MAX__
#define DBL_MAX __DBL_MAX__
#define LDBL_MAX __LDBL_MAX__
/* The difference between 1 and the least value greater than 1 that is
representable in the given floating point type, b**1-p. */
#undef FLT_EPSILON
#undef DBL_EPSILON
#undef LDBL_EPSILON
#define FLT_EPSILON __FLT_EPSILON__
#define DBL_EPSILON __DBL_EPSILON__
#define LDBL_EPSILON __LDBL_EPSILON__
/* Minimum normalized positive floating-point number, b**(emin - 1). */
#undef FLT_MIN
#undef DBL_MIN
#undef LDBL_MIN
#define FLT_MIN __FLT_MIN__
#define DBL_MIN __DBL_MIN__
#define LDBL_MIN __LDBL_MIN__
/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */
/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */
#undef FLT_ROUNDS
#define FLT_ROUNDS 1
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* The floating-point expression evaluation method.
-1 indeterminate
0 evaluate all operations and constants just to the range and
precision of the type
1 evaluate operations and constants of type float and double
to the range and precision of the double type, evaluate
long double operations and constants to the range and
precision of the long double type
2 evaluate all operations and constants to the range and
precision of the long double type
??? This ought to change with the setting of the fp control word;
the value provided by the compiler assumes the widest setting. */
#undef FLT_EVAL_METHOD
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
/* Number of decimal digits, n, such that any floating-point number in the
widest supported floating type with pmax radix b digits can be rounded
to a floating-point number with n decimal digits and back again without
change to the value,
pmax * log10(b) if b is a power of 10
ceil(1 + pmax * log10(b)) otherwise
*/
#undef DECIMAL_DIG
#define DECIMAL_DIG __DECIMAL_DIG__
#endif /* C99 */
#endif /* _FLOAT_H___ */

View file

@ -0,0 +1,114 @@
/*
Compatibility <intrin.h> header for GCC -- GCC equivalents of intrinsic
Microsoft Visual C++ functions. Originally developed for the ReactOS
(<https://reactos.org/>) and TinyKrnl (<http://www.tinykrnl.org/>)
projects.
Copyright (c) 2006 KJK::Hyperion <hackbunny@reactos.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef KJK_INTRIN_H_
#define KJK_INTRIN_H_
#ifndef RC_INVOKED
#ifndef _SIZE_T_DEFINED
#define _SIZE_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 size_t;
#else
typedef unsigned int size_t;
#endif
#endif
#ifndef _UINTPTR_T_DEFINED
#define _UINTPTR_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
#else
typedef unsigned int uintptr_t;
#endif
#endif
/*
FIXME: review all "memory" clobbers, add/remove to match Visual C++
behavior: some "obvious" memory barriers are not present in the Visual C++
implementation - e.g. __stosX; on the other hand, some memory barriers that
*are* present could have been missed
*/
/*
NOTE: this is a *compatibility* header. Some functions may look wrong at
first, but they're only "as wrong" as they would be on Visual C++. Our
priority is compatibility
NOTE: unlike most people who write inline asm for GCC, I didn't pull the
constraints and the uses of __volatile__ out of my... hat. Do not touch
them. I hate cargo cult programming
NOTE: be very careful with declaring "memory" clobbers. Some "obvious"
barriers aren't there in Visual C++ (e.g. __stosX)
NOTE: review all intrinsics with a return value, add/remove __volatile__
where necessary. If an intrinsic whose value is ignored generates a no-op
under Visual C++, __volatile__ must be omitted; if it always generates code
(for example, if it has side effects), __volatile__ must be specified. GCC
will only optimize out non-volatile asm blocks with outputs, so input-only
blocks are safe. Oddities such as the non-volatile 'rdmsr' are intentional
and follow Visual C++ behavior
NOTE: on GCC 4.1.0, please use the __sync_* built-ins for barriers and
atomic operations. Test the version like this:
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
...
Pay attention to the type of barrier. Make it match with what Visual C++
would use in the same case
*/
#if defined(__i386__)
#include "intrin_x86.h"
#elif defined(_PPC_)
#include "intrin_ppc.h"
#elif defined(_MIPS_)
#include "intrin_mips.h"
#elif defined(_M_ARM)
#include "intrin_arm.h"
#elif defined(__x86_64__)
/* TODO: the x64 architecture shares most of the i386 intrinsics. It should be easy to support */
#include "intrin_x86.h"
#else
#error Unsupported architecture
#endif
/*** Miscellaneous ***/
/* BUGBUG: only good for use in macros. Cannot be taken the address of */
#define __noop(...) ((void)0)
#define __assume(x) if (!(x)) __builtin_unreachable()
#endif
#endif
/* EOF */

View file

@ -0,0 +1,404 @@
/*
Compatibility <intrin.h> header for GCC -- GCC equivalents of intrinsic
Microsoft Visual C++ functions. Originally developed for the ReactOS
(<https://reactos.org/>) and TinyKrnl (<http://www.tinykrnl.org/>)
projects.
Copyright (c) 2006 KJK::Hyperion <hackbunny@reactos.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef KJK_INTRIN_ARM_H_
#define KJK_INTRIN_ARM_H_
#ifndef __GNUC__
#error Unsupported compiler
#endif
#define _ReturnAddress() (__builtin_return_address(0))
#define _ReadWriteBarrier() __sync_synchronize()
__INTRIN_INLINE void __yield(void) { __asm__ __volatile__("yield"); }
__INTRIN_INLINE void __break(unsigned int value) { __asm__ __volatile__("bkpt %0": : "M" (value)); }
__INTRIN_INLINE unsigned short _byteswap_ushort(unsigned short value)
{
return (value >> 8) | (value << 8);
}
__INTRIN_INLINE unsigned _CountLeadingZeros(long Mask)
{
return Mask ? __builtin_clz(Mask) : 32;
}
__INTRIN_INLINE unsigned _CountTrailingZeros(long Mask)
{
return Mask ? __builtin_ctz(Mask) : 32;
}
__INTRIN_INLINE unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask)
{
*Index = __builtin_ctz(Mask);
return Mask ? 1 : 0;
}
__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
{
short a, b;
__asm__ __volatile__ ( "0:\n\t"
"ldr %1, [%2]\n\t"
"cmp %1, %4\n\t"
"bne 1f\n\t"
"swp %0, %3, [%2]\n\t"
"cmp %0, %1\n\t"
"swpne %3, %0, [%2]\n\t"
"bne 0b\n\t"
"1:"
: "=&r" (a), "=&r" (b)
: "r" (Destination), "r" (Exchange), "r" (Comperand)
: "cc", "memory");
return a;
}
__INTRIN_INLINE short _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
{
short a, b, c;
__asm__ __volatile__ ( "0:\n\t"
"ldr %0, [%3]\n\t"
"add %1, %0, %4\n\t"
"swp %2, %1, [%3]\n\t"
"cmp %0, %2\n\t"
"swpne %1, %2, [%3]\n\t"
"bne 0b"
: "=&r" (a), "=&r" (b), "=&r" (c)
: "r" (Value), "r" (Addend)
: "cc", "memory");
return a;
}
__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp)
{
long a, b;
__asm__ __volatile__ ( "0:\n\t"
"ldr %1, [%2]\n\t"
"cmp %1, %4\n\t"
"bne 1f\n\t"
"swp %0, %3, [%2]\n\t"
"cmp %0, %1\n\t"
"swpne %3, %0, [%2]\n\t"
"bne 0b\n\t"
"1:"
: "=&r" (a), "=&r" (b)
: "r" (dest), "r" (exch), "r" (comp)
: "cc", "memory");
return a;
}
__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const dest, const long long exch, const long long comp)
{
//
// FIXME
//
long long result;
result = *dest;
if (*dest == comp) *dest = exch;
return result;
}
__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
{
return (void*)_InterlockedCompareExchange((volatile long* const)Destination, (const long)Exchange, (const long)Comperand);
}
__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const dest, const long add)
{
long a, b, c;
__asm__ __volatile__ ( "0:\n\t"
"ldr %0, [%3]\n\t"
"add %1, %0, %4\n\t"
"swp %2, %1, [%3]\n\t"
"cmp %0, %2\n\t"
"swpne %1, %2, [%3]\n\t"
"bne 0b"
: "=&r" (a), "=&r" (b), "=&r" (c)
: "r" (dest), "r" (add)
: "cc", "memory");
return a;
}
__INTRIN_INLINE long _InterlockedExchange(volatile long * const dest, const long exch)
{
long a;
__asm__ __volatile__ ( "swp %0, %2, [%1]"
: "=&r" (a)
: "r" (dest), "r" (exch));
return a;
}
__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
{
return (void *)_InterlockedExchange((volatile long * const)Target, (const long)Value);
}
__INTRIN_INLINE unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask)
{
*Index = 31 - __builtin_clz(Mask);
return Mask ? 1 : 0;
}
__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask)
{
char x;
char y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange8(value, x & mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask)
{
short x;
short y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange16(value, x & mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask)
{
long x;
long y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange(value, x & mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask)
{
char x;
char y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange8(value, x | mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask)
{
short x;
short y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange16(value, x | mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask)
{
long x;
long y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange(value, x | mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask)
{
char x;
char y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange8(value, x ^ mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask)
{
short x;
short y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange16(value, x ^ mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask)
{
long x;
long y;
y = *value;
do
{
x = y;
y = _InterlockedCompareExchange(value, x ^ mask, x);
}
while(y != x);
return y;
}
__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend)
{
return _InterlockedExchangeAdd(lpAddend, -1) - 1;
}
__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend)
{
return _InterlockedExchangeAdd(lpAddend, 1) + 1;
}
__INTRIN_INLINE long _InterlockedDecrement16(volatile short * const lpAddend)
{
return _InterlockedExchangeAdd16(lpAddend, -1) - 1;
}
__INTRIN_INLINE long _InterlockedIncrement16(volatile short * const lpAddend)
{
return _InterlockedExchangeAdd16(lpAddend, 1) + 1;
}
__INTRIN_INLINE long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value)
{
*Addend += Value;
return Value;
}
__INTRIN_INLINE void _disable(void)
{
__asm__ __volatile__
(
"cpsid i @ __cli" : : : "memory", "cc"
);
}
__INTRIN_INLINE void _enable(void)
{
__asm__ __volatile__
(
"cpsie i @ __sti" : : : "memory", "cc"
);
}
__INTRIN_INLINE unsigned char _interlockedbittestandset(volatile long * a, const long b)
{
return (_InterlockedOr(a, 1 << b) >> b) & 1;
}
__INTRIN_INLINE unsigned char _interlockedbittestandreset(volatile long * a, const long b)
{
return (_InterlockedAnd(a, ~(1 << b)) >> b) & 1;
}
#ifndef __MSVCRT__
__INTRIN_INLINE unsigned int _rotl(const unsigned int value, int shift)
{
return (((value) << ((int)(shift))) | ((value) >> (32 - (int)(shift))));
}
#endif
#define _clz(a) \
({ ULONG __value, __arg = (a); \
asm ("clz\t%0, %1": "=r" (__value): "r" (__arg)); \
__value; })
#endif
/* EOF */

View file

@ -0,0 +1,791 @@
/*
Compatibility <intrin.h> header for GCC -- GCC equivalents of intrinsic
Microsoft Visual C++ functions. Originally developed for the ReactOS
(<https://reactos.org/>) and TinyKrnl (<http://www.tinykrnl.org/>)
projects.
Copyright (c) 2006 KJK::Hyperion <hackbunny@reactos.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef KJK_INTRIN_PPC_H_
#define KJK_INTRIN_PPC_H_
//#define PPC_QUAL static __inline__ __attribute__((always_inline))
#define PPC_QUAL extern __inline__
#ifndef __GNUC__
#error Unsupported compiler
#endif
/*** Stack frame juggling ***/
#define _ReturnAddress() (__builtin_return_address(0))
#define _AddressOfReturnAddress() (&(((void **)(__builtin_frame_address(0)))[1]))
/* TODO: __getcallerseflags but how??? */
/*** Atomic operations ***/
/* TODO: _ReadBarrier */
/* TODO: _WriteBarrier */
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
#define _ReadWriteBarrier() __sync_synchronize()
#else
/* TODO: _ReadWriteBarrier() */
#endif
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
PPC_QUAL char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
PPC_QUAL short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
PPC_QUAL long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
PPC_QUAL long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
PPC_QUAL void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
PPC_QUAL long _InterlockedExchange(volatile long * const Target, const long Value)
{
/* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
__sync_synchronize();
return __sync_lock_test_and_set(Target, Value);
}
PPC_QUAL void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
{
/* NOTE: ditto */
__sync_synchronize();
return __sync_lock_test_and_set(Target, Value);
}
PPC_QUAL long _InterlockedExchangeAdd(volatile long * const Addend, const long Value)
{
return __sync_fetch_and_add(Addend, Value);
}
PPC_QUAL char _InterlockedAnd8(volatile char * const value, const char mask)
{
return __sync_fetch_and_and(value, mask);
}
PPC_QUAL short _InterlockedAnd16(volatile short * const value, const short mask)
{
return __sync_fetch_and_and(value, mask);
}
PPC_QUAL long _InterlockedAnd(volatile long * const value, const long mask)
{
return __sync_fetch_and_and(value, mask);
}
PPC_QUAL char _InterlockedOr8(volatile char * const value, const char mask)
{
return __sync_fetch_and_or(value, mask);
}
PPC_QUAL short _InterlockedOr16(volatile short * const value, const short mask)
{
return __sync_fetch_and_or(value, mask);
}
PPC_QUAL long _InterlockedOr(volatile long * const value, const long mask)
{
return __sync_fetch_and_or(value, mask);
}
PPC_QUAL char _InterlockedXor8(volatile char * const value, const char mask)
{
return __sync_fetch_and_xor(value, mask);
}
PPC_QUAL short _InterlockedXor16(volatile short * const value, const short mask)
{
return __sync_fetch_and_xor(value, mask);
}
PPC_QUAL long _InterlockedXor(volatile long * const value, const long mask)
{
return __sync_fetch_and_xor(value, mask);
}
#else
PPC_QUAL char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
{
volatile long retval __asm__("r8") = 0;
__asm__ __volatile__ (
"sync\n"
"1: lbarx %0,0,%1\n"
: "=r" (retval) : "r" (Destination));
__asm__ __volatile__ (
" cmpw %3,%1\n"
" bne- 2f\n"
" stbcx. %2,0,%0\n"
" bne- 1b\n"
"2: isync"
:
: "r" (Destination), "r" (Comperand), "r" (Exchange), "r" (retval));
return retval;
}
PPC_QUAL short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
{
volatile long retval __asm__("r8") = 0;
__asm__ __volatile__ (
"sync\n"
"1: lharx %0,0,%1\n"
: "=&r" (retval) : "r" (Destination));
__asm__ __volatile__ (
" cmpw %3,%1\n"
" bne- 2f\n"
" sthcx. %2,0,%0\n"
" bne- 1b\n"
"2: isync"
:
: "r" (Destination), "r" (Comperand), "r" (Exchange), "r" (retval));
return retval;
}
PPC_QUAL long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
{
volatile long retval __asm__("r8") = 0;
__asm__ __volatile__ (
"sync\n"
"1: lwarx %0,0,%1\n"
: "=&r" (retval) : "r" (Destination));
__asm__ __volatile__ (
" cmpw %3,%1\n"
" bne- 2f\n"
" stwcx. %2,0,%0\n"
" bne- 1b\n"
"2: isync"
:
: "r" (Destination), "r" (Comperand), "r" (Exchange), "r" (retval));
return retval;
}
PPC_QUAL long long _InterlockedCompareExchange64(volatile long long * const Target, const long long Exchange, const long long Comperand)
{
long long capture = *Target;
if (*Target == Comperand) *Target = Exchange;
return capture;
}
PPC_QUAL void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
{
return (void *)_InterlockedCompareExchange
((long *)Destination, (long) Exchange, (long) Comperand);
}
PPC_QUAL long _InterlockedExchange(volatile long * const Target, const long Value)
{
long retval __asm__("r8");
__asm__ __volatile__ (
"sync\n"
"1: lwarx 8,0,3\n"
" stwcx. 4,0,3\n"
" bne- 1b\n"
" mr 3,8\n"
: "=b" (retval)
: "b" (Target), "b" (Value)
: "cr0", "memory");
return retval;
}
PPC_QUAL void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
{
return (void *)_InterlockedExchange((long *)Target, (long)Value);
}
#define PPC_MakeInterlockedFunction(type,name,op,proto) \
PPC_QUAL type name proto \
{ \
long addend, y; \
do \
{ \
addend = *value; \
y = _InterlockedCompareExchange(value, addend op modify, addend); \
} \
while(y != addend); \
\
return y; \
}
PPC_QUAL unsigned char _interlockedbittestandreset(volatile long * const a, const long b)
{
long x;
long y;
long mask = ~(1<<b);
do
{
x = *a;
y = _InterlockedCompareExchange(a, x & mask, x);
}
while(y != x);
return (y & ~mask) != 0;
}
PPC_MakeInterlockedFunction(long,_InterlockedExchangeAdd,+,(volatile long * const value, const long modify))
PPC_MakeInterlockedFunction(char,_InterlockedAnd8,&,(volatile char * const value, const char modify))
PPC_MakeInterlockedFunction(short,_InterlockedAnd16,&,(volatile short * const value, const short modify))
PPC_MakeInterlockedFunction(long,_InterlockedAnd,&,(volatile long * const value, const long modify))
PPC_MakeInterlockedFunction(char,_InterlockedOr8,|,(volatile char * const value, const char modify))
PPC_MakeInterlockedFunction(short,_InterlockedOr16,|,(volatile short * const value, const short modify))
PPC_MakeInterlockedFunction(long,_InterlockedOr,|,(volatile long * const value, const long modify))
PPC_MakeInterlockedFunction(char,_InterlockedXor8,^,(volatile char * const value, const char modify))
PPC_MakeInterlockedFunction(short,_InterlockedXor16,^,(volatile short * const value, const short modify))
PPC_MakeInterlockedFunction(long,_InterlockedXor,^,(volatile long * const value, const long modify))
PPC_QUAL unsigned char _interlockedbittestandset(volatile long * const a, const long b)
{
long x;
long y;
long mask = 1<<b;
do
{
x = *a;
y = _InterlockedCompareExchange(a, x | mask, x);
}
while(y != x);
return (y & ~mask) != 0;
}
#endif
PPC_QUAL long _InterlockedDecrement(volatile long * const lpAddend)
{
return _InterlockedExchangeAdd(lpAddend, -1) - 1;
}
PPC_QUAL long _InterlockedIncrement(volatile long * const lpAddend)
{
return _InterlockedExchangeAdd(lpAddend, 1) + 1;
}
/*** String operations ***/
/* NOTE: we don't set a memory clobber in the __stosX functions because Visual C++ doesn't */
/* Note that the PPC store multiple operations may raise an exception in LE
* mode */
PPC_QUAL void __stosb(unsigned char * Dest, const unsigned char Data, unsigned long Count)
{
memset(Dest, Data, Count);
}
PPC_QUAL void __stosw(unsigned short * Dest, const unsigned short Data, unsigned long Count)
{
while(Count--)
*Dest++ = Data;
}
PPC_QUAL void __stosd(unsigned long * Dest, const unsigned long Data, unsigned long Count)
{
while(Count--)
*Dest++ = Data;
}
PPC_QUAL void __movsb(unsigned char * Destination, const unsigned char * Source, unsigned long Count)
{
memcpy(Destination, Source, Count);
}
PPC_QUAL void __movsw(unsigned short * Destination, const unsigned short * Source, unsigned long Count)
{
memcpy(Destination, Source, Count * sizeof(*Source));
}
PPC_QUAL void __movsd(unsigned long * Destination, const unsigned long * Source, unsigned long Count)
{
memcpy(Destination, Source, Count * sizeof(*Source));
}
/*** FS segment addressing ***/
/* On PowerPC, r13 points to TLS data, including the TEB at 0(r13) from what I
* can tell */
PPC_QUAL void __writefsbyte(const unsigned long Offset, const unsigned char Data)
{
char *addr;
__asm__("\tadd %0,13,%1\n\tstb %2,0(%0)" : "=r" (addr) : "r" (Offset), "r" (Data));
}
PPC_QUAL void __writefsword(const unsigned long Offset, const unsigned short Data)
{
char *addr;
__asm__("\tadd %0,13,%1\n\tsth %2,0(%0)" : "=r" (addr) : "r" (Offset), "r" (Data));
}
PPC_QUAL void __writefsdword(const unsigned long Offset, const unsigned long Data)
{
char *addr;
__asm__("\tadd %0,13,%1\n\tstw %2,0(%0)" : "=r" (addr) : "r" (Offset), "r" (Data));
}
PPC_QUAL unsigned char __readfsbyte(const unsigned long Offset)
{
unsigned short result;
__asm__("\tadd 7,13,%1\n"
"\tlbz %0,0(7)\n"
: "=r" (result)
: "r" (Offset)
: "r7");
return result;
}
PPC_QUAL unsigned short __readfsword(const unsigned long Offset)
{
unsigned short result;
__asm__("\tadd 7,13,%1\n"
"\tlhz %0,0(7)\n"
: "=r" (result)
: "r" (Offset)
: "r7");
return result;
}
PPC_QUAL unsigned long __readfsdword(const unsigned long Offset)
{
unsigned long result;
__asm__("\tadd 7,13,%1\n"
"\tlwz %0,0(7)\n"
: "=r" (result)
: "r" (Offset)
: "r7");
return result;
}
PPC_QUAL void __incfsbyte(const unsigned long Offset)
{
__writefsbyte(Offset, __readfsbyte(Offset)+1);
}
PPC_QUAL void __incfsword(const unsigned long Offset)
{
__writefsword(Offset, __readfsword(Offset)+1);
}
PPC_QUAL void __incfsdword(const unsigned long Offset)
{
__writefsdword(Offset, __readfsdword(Offset)+1);
}
/* NOTE: the bizarre implementation of __addfsxxx mimics the broken Visual C++ behavior */
/* PPC Note: Not sure about the bizarre behavior. We'll try to emulate it later */
PPC_QUAL void __addfsbyte(const unsigned long Offset, const unsigned char Data)
{
__writefsbyte(Offset, __readfsbyte(Offset) + Data);
}
PPC_QUAL void __addfsword(const unsigned long Offset, const unsigned short Data)
{
__writefsword(Offset, __readfsword(Offset) + Data);
}
PPC_QUAL void __addfsdword(const unsigned long Offset, const unsigned int Data)
{
__writefsdword(Offset, __readfsdword(Offset) + Data);
}
/*** Bit manipulation ***/
PPC_QUAL unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask)
{
if(Mask == 0) return 0;
else {
unsigned long mask = Mask;
mask &= -mask;
*Index =
((mask & 0xffff0000) ? 16 : 0) +
((mask & 0xff00ff00) ? 8 : 0) +
((mask & 0xf0f0f0f0) ? 4 : 0) +
((mask & 0xcccccccc) ? 2 : 0) +
((mask & 0xaaaaaaaa) ? 1 : 0);
return 1;
}
}
/* Thanks http://www.jjj.de/bitwizardry/files/bithigh.h */
PPC_QUAL unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask)
{
unsigned long check = 16, checkmask;
if(Mask == 0) return 0;
else {
unsigned long mask = Mask;
*Index = 0;
while(check) {
checkmask = ((1<<check)-1) << check;
if( mask & checkmask ) {
mask >>= check;
*Index += check;
}
check >>= 1;
}
return 1;
}
}
/* NOTE: again, the bizarre implementation follows Visual C++ */
PPC_QUAL unsigned char _bittest(const long * const a, const long b)
{
return ((*a) & (1<<b)) != 0;
}
PPC_QUAL unsigned char _bittestandcomplement(long * const a, const long b)
{
unsigned char ret = ((*a) & (1<<b)) != 0;
(*a) ^= (1<<b);
return ret;
}
PPC_QUAL unsigned char _bittestandreset(long * const a, const long b)
{
unsigned char ret = ((*a) & (1<<b)) != 0;
(*a) &= ~(1<<b);
return ret;
}
PPC_QUAL unsigned char _bittestandset(long * const a, const long b)
{
unsigned char ret = ((*a) & (1<<b)) != 0;
(*a) |= (1<<b);
return ret;
}
PPC_QUAL unsigned char _rotl8(const unsigned char value, const unsigned char shift)
{
return (value << shift) | (value >> (8-shift));
}
PPC_QUAL unsigned short _rotl16(const unsigned short value, const unsigned char shift)
{
return (value << shift) | (value >> (16-shift));
}
PPC_QUAL unsigned char _rotr8(const unsigned char value, const unsigned char shift)
{
return (value >> shift) | (value << (8-shift));
}
PPC_QUAL unsigned short _rotr16(const unsigned short value, const unsigned char shift)
{
return (value >> shift) | (value << (16-shift));
}
PPC_QUAL unsigned long long __ll_lshift(const unsigned long long Mask, int Bit)
{
return Mask << Bit;
}
PPC_QUAL long long __ll_rshift(const long long Mask, const int Bit)
{
return Mask >> Bit;
}
PPC_QUAL unsigned long long __ull_rshift(const unsigned long long Mask, int Bit)
{
return Mask >> Bit;
}
/*** 64-bit math ***/
PPC_QUAL long long __emul(const int a, const int b)
{
return a * b;
}
PPC_QUAL unsigned long long __emulu(const unsigned int a, const unsigned int b)
{
return a * b;
}
/*** Port I/O ***/
PPC_QUAL unsigned char __inbyte(const unsigned long Port)
{
int ret;
__asm__(
"mfmsr 5\n\t"
"andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
"mtmsr 6\n\t"
"isync\n\t"
"sync\n\t"
"lbz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */
"mtmsr 5\n\t" : "=r" (ret) : "b" (Port)
);
return ret;
}
PPC_QUAL unsigned short __inword(const unsigned long Port)
{
int ret;
__asm__(
"mfmsr 5\n\t"
"andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
"mtmsr 6\n\t"
"isync\n\t"
"sync\n\t"
"lhz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */
"mtmsr 5\n\t" : "=r" (ret) : "b" (Port)
);
return ret;
}
PPC_QUAL unsigned long __indword(const unsigned long Port)
{
int ret;
__asm__(
"mfmsr 5\n\t"
"andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
"mtmsr 6\n\t"
"isync\n\t"
"sync\n\t"
"lwz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */
"mtmsr 5\n\t" : "=r" (ret) : "b" (Port)
);
return ret;
}
PPC_QUAL void __inbytestring(unsigned long Port, unsigned char * Buffer, unsigned long Count)
{
while(Count--) {
*Buffer++ = __inbyte(Port);
}
}
PPC_QUAL void __inwordstring(unsigned long Port, unsigned short * Buffer, unsigned long Count)
{
while(Count--) {
*Buffer++ = __inword(Port);
}
}
PPC_QUAL void __indwordstring(unsigned long Port, unsigned long * Buffer, unsigned long Count)
{
while(Count--) {
*Buffer++ = __indword(Port);
}
}
PPC_QUAL void __outbyte(unsigned long const Port, const unsigned char Data)
{
__asm__(
"mfmsr 5\n\t"
"andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
"mtmsr 6\n\t"
"sync\n\t"
"eieio\n\t"
"stb %1,0(%0)\n\t" /* Set actual value at phys addr r3 */
"dcbst 0,%1\n\t"
"mtmsr 5\n\t"
"sync\n\t"
"eieio\n\t" : : "b" (Port), "r" (Data)
);
}
PPC_QUAL void __outword(unsigned long const Port, const unsigned short Data)
{
__asm__(
"mfmsr 5\n\t"
"andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
"mtmsr 6\n\t"
"sync\n\t"
"eieio\n\t"
"sth %1,0(%0)\n\t" /* Set actual value at phys addr r3 */
"dcbst 0,%1\n\t"
"mtmsr 5\n\t"
"sync\n\t"
"eieio\n\t" : : "b" (Port), "b" (Data)
);
}
PPC_QUAL void __outdword(unsigned long const Port, const unsigned long Data)
{
__asm__(
"mfmsr 5\n\t"
"andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
"mtmsr 6\n\t"
"sync\n\t"
"eieio\n\t"
"stw %1,0(%0)\n\t" /* Set actual value at phys addr r3 */
"dcbst 0,%1\n\t"
"mtmsr 5\n\t"
"sync\n\t"
"eieio\n\t" : : "b" (Port), "b" (Data)
);
}
PPC_QUAL void __outbytestring(unsigned long const Port, const unsigned char * const Buffer, const unsigned long Count)
{
unsigned long count = Count;
const unsigned char *buffer = Buffer;
while(count--) {
__outbyte(Port, *buffer++);
}
}
PPC_QUAL void __outwordstring(unsigned long const Port, const unsigned short * const Buffer, const unsigned long Count)
{
unsigned long count = Count;
const unsigned short *buffer = Buffer;
while(count--) {
__outword(Port, *buffer++);
}
}
PPC_QUAL void __outdwordstring(unsigned long const Port, const unsigned long * const Buffer, const unsigned long Count)
{
unsigned long count = Count;
const unsigned long *buffer = Buffer;
while(count--) {
__outdword(Port, *buffer++);
}
}
/*** System information ***/
PPC_QUAL void __cpuid(int CPUInfo[], const int InfoType)
{
unsigned long lo32;
__asm__("mfpvr" : "=b" (lo32));
}
PPC_QUAL unsigned long long __rdtsc(void)
{
unsigned long lo32;
__asm__("mfdec %0" : "=b" (lo32));
return -lo32;
}
/*** Interrupts ***/
/* Finally decided to do this by enabling single step trap */
PPC_QUAL void __debugbreak(void)
{
}
PPC_QUAL void __int2c(void)
{
/* Not sure yet */
}
#ifndef _ENABLE_DISABLE_DEFINED
#define _ENABLE_DISABLE_DEFINED
PPC_QUAL void _disable(void)
{
__asm__ __volatile__("mfmsr 0\n\t" \
"li 8,0x7fff\n\t" \
"and 0,8,0\n\t" \
"mtmsr 0\n\t");
}
PPC_QUAL void _enable(void)
{
__asm__ __volatile__("mfmsr 8\n\t" \
"ori 8,8,0x8000\n\t" \
"mtmsr 8\n\t");
}
/*** Protected memory management ***/
PPC_QUAL unsigned long __readsdr1(void)
{
unsigned long value;
__asm__("mfsdr1 %0" : "=b" (value));
return value;
}
PPC_QUAL void __writesdr1(const unsigned long long Data)
{
__asm__("mtsdr1 %0" : : "b" (Data));
}
/*** System operations ***/
/* This likely has a different meaning from the X86 equivalent. We'll keep
* the name cause it fits */
PPC_QUAL unsigned long long __readmsr()
{
unsigned long temp;
__asm__("mfmsr %0" : "=b" (temp));
return temp;
}
PPC_QUAL void __writemsr(const unsigned long Value)
{
__asm__("mtmsr %0" : : "b" (Value));
}
/* We'll make sure of the following:
* IO operations have completed
* Write operations through cache have completed
* We've reloaded anything in the data or instruction cache that might have
* changed in real ram.
*/
PPC_QUAL void __wbinvd(void)
{
__asm__("eieio\n\t"
"dcs\n\t"
"sync\n\t"
"isync\n\t");
}
#endif
PPC_QUAL long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value)
{
#if 0
__asm__
(
"lock; add %[Value], %[Lo32];"
"jae LABEL%=;"
"lock; adc $0, %[Hi32];"
"LABEL%=:;" :
[Lo32] "=m" (*((volatile long *)(Addend) + 0)), [Hi32] "=m" (*((volatile long *)(Addend) + 1)) :
[Value] "ir" (Value)
);
#endif
return Value;
}
/*** Miscellaneous ***/
/* BUGBUG: only good for use in macros. Cannot be taken the address of */
#define __noop(...) ((void)0)
#define __assume(x) if (!(x)) __builtin_unreachable()
#endif
/* EOF */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,662 @@
/*
* mmintrin.h
*
* This file is part of the ReactOS CRT package.
*
* Contributors:
* Timo Kreuzer (timo.kreuzer@reactos.org)
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#pragma once
#ifndef _MMINTRIN_H_INCLUDED
#define _MMINTRIN_H_INCLUDED
#include <crtdefs.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _MSC_VER
#define DECLSPEC_INTRINTYPE __declspec(intrin_type)
#else
#define DECLSPEC_INTRINTYPE
#endif
#if defined(_MSC_VER) && !defined(__clang__)
typedef union DECLSPEC_INTRINTYPE _CRT_ALIGN(8) __m64
{
unsigned __int64 m64_u64;
float m64_f32[2];
__int8 m64_i8[8];
__int16 m64_i16[4];
__int32 m64_i32[2];
__int64 m64_i64;
unsigned __int8 m64_u8[8];
unsigned __int16 m64_u16[4];
unsigned __int32 m64_u32[2];
} __m64;
#else /* _MSC_VER */
typedef long long __v1di __attribute__((__vector_size__(8)));
typedef int __v2si __attribute__((__vector_size__(8)));
typedef short __v4hi __attribute__((__vector_size__(8)));
typedef char __v8qi __attribute__((__vector_size__(8)));
typedef float __m64 __attribute__((__vector_size__(8), __aligned__(16)));
#ifdef __clang__
#define __INTRIN_INLINE_MMX __INTRIN_INLINE __attribute__((__target__("mmx"),__min_vector_width__(64)))
#else
#define __INTRIN_INLINE_MMX __INTRIN_INLINE __attribute__((__target__("mmx")))
#endif
#endif /* _MSC_VER */
#ifdef _M_IX86
void _m_empty(void);
__m64 _m_from_int(int i);
int _m_to_int(__m64 m);
__m64 _m_packsswb(__m64 a, __m64 b);
__m64 _m_packssdw(__m64 a, __m64 b);
__m64 _m_packuswb(__m64 a, __m64 b);
__m64 _m_punpckhbw(__m64 a, __m64 b);
__m64 _m_punpckhwd(__m64 a, __m64 b);
__m64 _m_punpckhdq(__m64 a, __m64 b);
__m64 _m_punpcklbw(__m64 a, __m64 b);
__m64 _m_punpcklwd(__m64 a, __m64 b);
__m64 _m_punpckldq(__m64 a, __m64 b);
__m64 _m_paddb(__m64 a, __m64 b);
__m64 _m_paddw(__m64 a, __m64 b);
__m64 _m_paddd(__m64 a, __m64 b);
__m64 _m_paddsb(__m64 a, __m64 b);
__m64 _m_paddsw(__m64 a, __m64 b);
__m64 _m_paddusb(__m64 a, __m64 b);
__m64 _m_paddusw(__m64 a, __m64 b);
__m64 _m_psubb(__m64 a, __m64 b);
__m64 _m_psubw(__m64 a, __m64 b);
__m64 _m_psubd(__m64 a, __m64 b);
__m64 _m_psubsb(__m64 a, __m64 b);
__m64 _m_psubsw(__m64 a, __m64 b);
__m64 _m_psubusb(__m64 a, __m64 b);
__m64 _m_psubusw(__m64 a, __m64 b);
__m64 _m_pmaddwd(__m64 a, __m64 b);
__m64 _m_pmulhw(__m64 a, __m64 b);
__m64 _m_pmullw(__m64 a, __m64 b);
__m64 _m_psllw(__m64 a, __m64 count);
__m64 _m_psllwi(__m64 a, int imm8);
__m64 _m_pslld(__m64 a, __m64 count);
__m64 _m_pslldi(__m64 a, int imm8);
__m64 _m_psllq(__m64 a, __m64 count);
__m64 _m_psllqi(__m64 a, int imm8);
__m64 _m_psraw(__m64 a, __m64 count);
__m64 _m_psrawi(__m64 a, int imm8);
__m64 _m_psrad(__m64 a, __m64 count);
__m64 _m_psradi(__m64 a, int imm8);
__m64 _m_psrlw(__m64 a, __m64 count);
__m64 _m_psrlwi(__m64 a, int imm8);
__m64 _m_psrld(__m64 a, __m64 count);
__m64 _m_psrldi(__m64 a, int imm8);
__m64 _m_psrlq(__m64 a, __m64 count);
__m64 _m_psrlqi(__m64 a, int imm8);
__m64 _m_pand(__m64 a, __m64 b);
__m64 _m_pandn(__m64 a, __m64 b);
__m64 _m_por(__m64 a, __m64 b);
__m64 _m_pxor(__m64 a, __m64 b);
__m64 _m_pcmpeqb(__m64 a, __m64 b);
__m64 _m_pcmpgtb(__m64 a, __m64 b);
__m64 _m_pcmpeqw(__m64 a, __m64 b);
__m64 _m_pcmpgtw(__m64 a, __m64 b);
__m64 _m_pcmpeqd(__m64 a, __m64 b);
__m64 _m_pcmpgtd(__m64 a, __m64 b);
__m64 _mm_setzero_si64(void);
__m64 _mm_set_pi32(int i1, int i0);
__m64 _mm_set_pi16(short s3, short s2, short s1, short s0);
__m64 _mm_set_pi8(char b7, char b6, char b5, char b4,
char b3, char b2, char b1, char b0);
__m64 _mm_setr_pi32(int i1, int i0);
__m64 _mm_setr_pi16(short s3, short s2, short s1, short s0);
__m64 _mm_setr_pi8(char b7, char b6, char b5, char b4,
char b3, char b2, char b1, char b0);
__m64 _mm_set1_pi32(int i);
__m64 _mm_set1_pi16(short s);
__m64 _mm_set1_pi8(char b);
/* Alternate names */
#define _mm_empty _m_empty
#define _mm_cvtsi32_si64 _m_from_int
#define _mm_cvtsi64_si32 _m_to_int
#define _mm_packs_pi16 _m_packsswb
#define _mm_packs_pi32 _m_packssdw
#define _mm_packs_pu16 _m_packuswb
#define _mm_unpackhi_pi8 _m_punpckhbw
#define _mm_unpackhi_pi16 _m_punpckhwd
#define _mm_unpackhi_pi32 _m_punpckhdq
#define _mm_unpacklo_pi8 _m_punpcklbw
#define _mm_unpacklo_pi16 _m_punpcklwd
#define _mm_unpacklo_pi32 _m_punpckldq
#define _mm_add_pi8 _m_paddb
#define _mm_add_pi16 _m_paddw
#define _mm_add_pi32 _m_paddd
#define _mm_adds_pi8 _m_paddsb
#define _mm_adds_pi16 _m_paddsw
#define _mm_adds_pu8 _m_paddusb
#define _mm_adds_pu16 _m_paddusw
#define _mm_sub_pi8 _m_psubb
#define _mm_sub_pi16 _m_psubw
#define _mm_sub_pi32 _m_psubd
#define _mm_subs_pi8 _m_psubsb
#define _mm_subs_pi16 _m_psubsw
#define _mm_subs_pu8 _m_psubusb
#define _mm_subs_pu16 _m_psubusw
#define _mm_madd_pi16 _m_pmaddwd
#define _mm_mulhi_pi16 _m_pmulhw
#define _mm_mullo_pi16 _m_pmullw
#define _mm_sll_pi16 _m_psllw
#define _mm_slli_pi16 _m_psllwi
#define _mm_sll_pi32 _m_pslld
#define _mm_slli_pi32 _m_pslldi
#define _mm_sll_si64 _m_psllq
#define _mm_slli_si64 _m_psllqi
#define _mm_sra_pi16 _m_psraw
#define _mm_srai_pi16 _m_psrawi
#define _mm_sra_pi32 _m_psrad
#define _mm_srai_pi32 _m_psradi
#define _mm_srl_pi16 _m_psrlw
#define _mm_srli_pi16 _m_psrlwi
#define _mm_srl_pi32 _m_psrld
#define _mm_srli_pi32 _m_psrldi
#define _mm_srl_si64 _m_psrlq
#define _mm_srli_si64 _m_psrlqi
#define _mm_and_si64 _m_pand
#define _mm_andnot_si64 _m_pandn
#define _mm_or_si64 _m_por
#define _mm_xor_si64 _m_pxor
#define _mm_cmpeq_pi8 _m_pcmpeqb
#define _mm_cmpgt_pi8 _m_pcmpgtb
#define _mm_cmpeq_pi16 _m_pcmpeqw
#define _mm_cmpgt_pi16 _m_pcmpgtw
#define _mm_cmpeq_pi32 _m_pcmpeqd
#define _mm_cmpgt_pi32 _m_pcmpgtd
/* Use intrinsics on MSVC */
#if defined(_MSC_VER) && !defined(__clang__)
#pragma intrinsic(_m_empty)
#pragma intrinsic(_m_from_int)
#pragma intrinsic(_m_to_int)
#pragma intrinsic(_m_packsswb)
#pragma intrinsic(_m_packssdw)
#pragma intrinsic(_m_packuswb)
#pragma intrinsic(_m_punpckhbw)
#pragma intrinsic(_m_punpckhwd)
#pragma intrinsic(_m_punpckhdq)
#pragma intrinsic(_m_punpcklbw)
#pragma intrinsic(_m_punpcklwd)
#pragma intrinsic(_m_punpckldq)
#pragma intrinsic(_m_paddb)
#pragma intrinsic(_m_paddw)
#pragma intrinsic(_m_paddd)
#pragma intrinsic(_m_paddsb)
#pragma intrinsic(_m_paddsw)
#pragma intrinsic(_m_paddusb)
#pragma intrinsic(_m_paddusw)
#pragma intrinsic(_m_psubb)
#pragma intrinsic(_m_psubw)
#pragma intrinsic(_m_psubd)
#pragma intrinsic(_m_psubsb)
#pragma intrinsic(_m_psubsw)
#pragma intrinsic(_m_psubusb)
#pragma intrinsic(_m_psubusw)
#pragma intrinsic(_m_pmaddwd)
#pragma intrinsic(_m_pmulhw)
#pragma intrinsic(_m_pmullw)
#pragma intrinsic(_m_psllw)
#pragma intrinsic(_m_psllwi)
#pragma intrinsic(_m_pslld)
#pragma intrinsic(_m_pslldi)
#pragma intrinsic(_m_psllq)
#pragma intrinsic(_m_psllqi)
#pragma intrinsic(_m_psraw)
#pragma intrinsic(_m_psrawi)
#pragma intrinsic(_m_psrad)
#pragma intrinsic(_m_psradi)
#pragma intrinsic(_m_psrlw)
#pragma intrinsic(_m_psrlwi)
#pragma intrinsic(_m_psrld)
#pragma intrinsic(_m_psrldi)
#pragma intrinsic(_m_psrlq)
#pragma intrinsic(_m_psrlqi)
#pragma intrinsic(_m_pand)
#pragma intrinsic(_m_pandn)
#pragma intrinsic(_m_por)
#pragma intrinsic(_m_pxor)
#pragma intrinsic(_m_pcmpeqb)
#pragma intrinsic(_m_pcmpgtb)
#pragma intrinsic(_m_pcmpeqw)
#pragma intrinsic(_m_pcmpgtw)
#pragma intrinsic(_m_pcmpeqd)
#pragma intrinsic(_m_pcmpgtd)
#pragma intrinsic(_mm_setzero_si64)
#pragma intrinsic(_mm_set_pi32)
#pragma intrinsic(_mm_set_pi16)
#pragma intrinsic(_mm_set_pi8)
#pragma intrinsic(_mm_setr_pi32)
#pragma intrinsic(_mm_setr_pi16)
#pragma intrinsic(_mm_setr_pi8)
#pragma intrinsic(_mm_set1_pi32)
#pragma intrinsic(_mm_set1_pi16)
#pragma intrinsic(_mm_set1_pi8)
/* Use inline functions on GCC/Clang */
#else // GCC / Clang Clang-CL
/*
- GCC: https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/mmintrin.h
- Clang: https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/mmintrin.h
*/
// _m_empty
__INTRIN_INLINE_MMX void _mm_empty(void)
{
__builtin_ia32_emms();
}
// _m_from_int
__INTRIN_INLINE_MMX __m64 _mm_cvtsi32_si64(int i)
{
return (__m64)__builtin_ia32_vec_init_v2si(i, 0);
}
// _m_to_int
__INTRIN_INLINE_MMX int _mm_cvtsi64_si32(__m64 m)
{
return __builtin_ia32_vec_ext_v2si((__v2si)m, 0);
}
// _m_packsswb
__INTRIN_INLINE_MMX __m64 _mm_packs_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_packsswb((__v4hi)a, (__v4hi)b);
}
// _m_packssdw
__INTRIN_INLINE_MMX __m64 _mm_packs_pi32(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_packssdw((__v2si)a, (__v2si)b);
}
// _m_packuswb
__INTRIN_INLINE_MMX __m64 _mm_packs_pu16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_packuswb((__v4hi)a, (__v4hi)b);
}
// _m_punpckhbw
__INTRIN_INLINE_MMX __m64 _mm_unpackhi_pi8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_punpckhbw((__v8qi)a, (__v8qi)b);
}
// _m_punpckhwd
__INTRIN_INLINE_MMX __m64 _mm_unpackhi_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_punpckhwd((__v4hi)a, (__v4hi)b);
}
// _m_punpckhdq
__INTRIN_INLINE_MMX __m64 _mm_unpackhi_pi32(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_punpckhdq((__v2si)a, (__v2si)b);
}
// _m_punpcklbw
__INTRIN_INLINE_MMX __m64 _mm_unpacklo_pi8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_punpcklbw((__v8qi)a, (__v8qi)b);
}
// _m_punpcklwd
__INTRIN_INLINE_MMX __m64 _mm_unpacklo_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_punpcklwd((__v4hi)a, (__v4hi)b);
}
// _m_punpckldq
__INTRIN_INLINE_MMX __m64 _mm_unpacklo_pi32(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_punpckldq((__v2si)a, (__v2si)b);
}
// _m_paddb
__INTRIN_INLINE_MMX __m64 _mm_add_pi8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_paddb((__v8qi)a, (__v8qi)b);
}
// _m_paddw
__INTRIN_INLINE_MMX __m64 _mm_add_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_paddw((__v4hi)a, (__v4hi)b);
}
// _m_paddd
__INTRIN_INLINE_MMX __m64 _mm_add_pi32(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_paddd((__v2si)a, (__v2si)b);
}
// _m_paddsb
__INTRIN_INLINE_MMX __m64 _mm_adds_pi8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_paddsb((__v8qi)a, (__v8qi)b);
}
// _m_paddsw
__INTRIN_INLINE_MMX __m64 _mm_adds_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_paddsw((__v4hi)a, (__v4hi)b);
}
// _m_paddusb
__INTRIN_INLINE_MMX __m64 _mm_adds_pu8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_paddusb((__v8qi)a, (__v8qi)b);
}
// _m_paddusw
__INTRIN_INLINE_MMX __m64 _mm_adds_pu16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_paddusw((__v4hi)a, (__v4hi)b);
}
// _m_psubb
__INTRIN_INLINE_MMX __m64 _mm_sub_pi8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_psubb((__v8qi)a, (__v8qi)b);
}
// _m_psubw
__INTRIN_INLINE_MMX __m64 _mm_sub_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_psubw((__v4hi)a, (__v4hi)b);
}
// _m_psubd
__INTRIN_INLINE_MMX __m64 _mm_sub_pi32(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_psubd((__v2si)a, (__v2si)b);
}
// _m_psubsb
__INTRIN_INLINE_MMX __m64 _mm_subs_pi8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_psubsb((__v8qi)a, (__v8qi)b);
}
// _m_psubsw
__INTRIN_INLINE_MMX __m64 _mm_subs_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_psubsw((__v4hi)a, (__v4hi)b);
}
// _m_psubusb
__INTRIN_INLINE_MMX __m64 _mm_subs_pu8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_psubusb((__v8qi)a, (__v8qi)b);
}
// _m_psubusw
__INTRIN_INLINE_MMX __m64 _mm_subs_pu16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_psubusw((__v4hi)a, (__v4hi)b);
}
// _m_pmaddwd
__INTRIN_INLINE_MMX __m64 _mm_madd_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pmaddwd((__v4hi)a, (__v4hi)b);
}
// _m_pmulhw
__INTRIN_INLINE_MMX __m64 _mm_mulhi_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pmulhw((__v4hi)a, (__v4hi)b);
}
// _m_pmullw
__INTRIN_INLINE_MMX __m64 _mm_mullo_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pmullw((__v4hi)a, (__v4hi)b);
}
// _m_psllw
__INTRIN_INLINE_MMX __m64 _mm_sll_pi16(__m64 a, __m64 count)
{
return (__m64)__builtin_ia32_psllw((__v4hi)a, (__v4hi)count);
}
// _m_psllwi
__INTRIN_INLINE_MMX __m64 _mm_slli_pi16(__m64 a, int imm8)
{
return (__m64)__builtin_ia32_psllwi((__v4hi)a, imm8);
}
// _m_pslld
__INTRIN_INLINE_MMX __m64 _mm_sll_pi32(__m64 a, __m64 count)
{
return (__m64)__builtin_ia32_pslld((__v2si)a, (__v2si)count);
}
// _m_pslldi
__INTRIN_INLINE_MMX __m64 _mm_slli_pi32(__m64 a, int imm8)
{
return (__m64)__builtin_ia32_pslldi((__v2si)a, imm8);
}
// _m_psllq
__INTRIN_INLINE_MMX __m64 _mm_sll_si64(__m64 a, __m64 count)
{
return (__m64)__builtin_ia32_psllq((__v1di)a, (__v1di)count);
}
// _m_psllqi
__INTRIN_INLINE_MMX __m64 _mm_slli_si64(__m64 a, int imm8)
{
return (__m64)__builtin_ia32_psllqi((__v1di)a, imm8);
}
// _m_psraw
__INTRIN_INLINE_MMX __m64 _mm_sra_pi16(__m64 a, __m64 count)
{
return (__m64)__builtin_ia32_psraw((__v4hi)a, (__v4hi)count);
}
// _m_psrawi
__INTRIN_INLINE_MMX __m64 _mm_srai_pi16(__m64 a, int imm8)
{
return (__m64)__builtin_ia32_psrawi((__v4hi)a, imm8);
}
// _m_psrad
__INTRIN_INLINE_MMX __m64 _mm_sra_pi32(__m64 a, __m64 count)
{
return (__m64)__builtin_ia32_psrad((__v2si)a, (__v2si)count);
}
// _m_psradi
__INTRIN_INLINE_MMX __m64 _mm_srai_pi32(__m64 a, int imm8)
{
return (__m64)__builtin_ia32_psradi((__v2si)a, imm8);
}
// _m_psrlw
__INTRIN_INLINE_MMX __m64 _mm_srl_pi16(__m64 a, __m64 count)
{
return (__m64)__builtin_ia32_psrlw((__v4hi)a, (__v4hi)count);
}
// _m_psrlwi
__INTRIN_INLINE_MMX __m64 _mm_srli_pi16(__m64 a, int imm8)
{
return (__m64)__builtin_ia32_psrlwi((__v4hi)a, imm8);
}
// _m_psrld
__INTRIN_INLINE_MMX __m64 _mm_srl_pi32(__m64 a, __m64 count)
{
return (__m64)__builtin_ia32_psrld((__v2si)a, (__v2si)count);
}
// _m_psrldi
__INTRIN_INLINE_MMX __m64 _mm_srli_pi32(__m64 a, int imm8)
{
return (__m64)__builtin_ia32_psrldi((__v2si)a, imm8);
}
// _m_psrlq
__INTRIN_INLINE_MMX __m64 _mm_srl_si64(__m64 a, __m64 count)
{
return (__m64)__builtin_ia32_psrlq((__v1di)a, (__v1di)count);
}
// _m_psrlqi
__INTRIN_INLINE_MMX __m64 _mm_srli_si64(__m64 a, int imm8)
{
return (__m64)__builtin_ia32_psrlqi((__v1di)a, imm8);
}
// _m_pand
__INTRIN_INLINE_MMX __m64 _mm_and_si64(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pand((__v2si)a, (__v2si)b);
}
// _m_pandn
__INTRIN_INLINE_MMX __m64 _mm_andnot_si64(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pandn((__v2si)a, (__v2si)b);
}
// _m_por
__INTRIN_INLINE_MMX __m64 _mm_or_si64(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_por((__v2si)a, (__v2si)b);
}
// _m_pxor
__INTRIN_INLINE_MMX __m64 _mm_xor_si64(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pxor((__v2si)a, (__v2si)b);
}
// _m_pcmpeqb
__INTRIN_INLINE_MMX __m64 _mm_cmpeq_pi8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pcmpeqb((__v8qi)a, (__v8qi)b);
}
// _m_pcmpgtb
__INTRIN_INLINE_MMX __m64 _mm_cmpgt_pi8(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pcmpgtb((__v8qi)a, (__v8qi)b);
}
// _m_pcmpeqw
__INTRIN_INLINE_MMX __m64 _mm_cmpeq_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pcmpeqw((__v4hi)a, (__v4hi)b);
}
// _m_pcmpgtw
__INTRIN_INLINE_MMX __m64 _mm_cmpgt_pi16(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pcmpgtw((__v4hi)a, (__v4hi)b);
}
// _m_pcmpeqd
__INTRIN_INLINE_MMX __m64 _mm_cmpeq_pi32(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pcmpeqd((__v2si)a, (__v2si)b);
}
// _m_pcmpgtd
__INTRIN_INLINE_MMX __m64 _mm_cmpgt_pi32(__m64 a, __m64 b)
{
return (__m64)__builtin_ia32_pcmpgtd((__v2si)a, (__v2si)b);
}
__INTRIN_INLINE_MMX __m64 _mm_setzero_si64(void)
{
return (__m64) { 0 };
}
__INTRIN_INLINE_MMX __m64 _mm_set_pi32(int i1, int i0)
{
return (__m64)__builtin_ia32_vec_init_v2si(i0, i1);
}
__INTRIN_INLINE_MMX __m64 _mm_set_pi16(short s3, short s2, short s1, short s0)
{
return (__m64)__builtin_ia32_vec_init_v4hi(s0, s1, s2, s3);
}
__INTRIN_INLINE_MMX __m64 _mm_set_pi8(char b7, char b6, char b5, char b4,
char b3, char b2, char b1, char b0)
{
return (__m64)__builtin_ia32_vec_init_v8qi(b0, b1, b2, b3, b4, b5, b6, b7);
}
__INTRIN_INLINE_MMX __m64 _mm_setr_pi32(int i1, int i0)
{
return _mm_set_pi32(i0, i1);
}
__INTRIN_INLINE_MMX __m64 _mm_setr_pi16(short s3, short s2, short s1, short s0)
{
return _mm_set_pi16(s0, s1, s2, s3);
}
__INTRIN_INLINE_MMX __m64 _mm_setr_pi8(char b7, char b6, char b5, char b4,
char b3, char b2, char b1, char b0)
{
return _mm_set_pi8(b7, b6, b5, b4, b3, b2, b1, b0);
}
__INTRIN_INLINE_MMX __m64 _mm_set1_pi32(int i)
{
return _mm_set_pi32(i, i);
}
__INTRIN_INLINE_MMX __m64 _mm_set1_pi16(short s)
{
return _mm_set_pi16(s, s, s, s);
}
__INTRIN_INLINE_MMX __m64 _mm_set1_pi8(char b)
{
return _mm_set_pi8(b, b, b, b, b, b, b, b);
}
#endif /* __GNUC__ */
#endif /* _M_IX86 */
#ifdef __cplusplus
}
#endif
#endif /* _MMINTRIN_H_INCLUDED */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,420 @@
#ifdef __cplusplus
extern "C" {
#endif
/*** Stack frame juggling ***/
#pragma intrinsic(_ReturnAddress)
#pragma intrinsic(_AddressOfReturnAddress)
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__getcallerseflags)
#endif
/*** Memory barriers ***/
#pragma intrinsic(_ReadWriteBarrier)
#pragma intrinsic(_ReadBarrier)
#pragma intrinsic(_WriteBarrier)
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(_mm_mfence)
#pragma intrinsic(_mm_lfence)
#pragma intrinsic(_mm_sfence)
#endif
#if defined(_M_AMD64)
#pragma intrinsic(__faststorefence)
#elif defined(_M_ARM)
#pragma intrinsic(__iso_volatile_load16)
#pragma intrinsic(__iso_volatile_load32)
#pragma intrinsic(__iso_volatile_load64)
#pragma intrinsic(__iso_volatile_load8)
#pragma intrinsic(__iso_volatile_store16)
#pragma intrinsic(__iso_volatile_store32)
#pragma intrinsic(__iso_volatile_store64)
#pragma intrinsic(__iso_volatile_store8)
#endif
/*** Atomic operations ***/
#pragma intrinsic(_InterlockedCompareExchange)
#pragma intrinsic(_InterlockedCompareExchange8)
#pragma intrinsic(_InterlockedCompareExchange16)
#pragma intrinsic(_InterlockedCompareExchange64)
#pragma intrinsic(_InterlockedExchange)
#pragma intrinsic(_InterlockedExchange8)
#pragma intrinsic(_InterlockedExchange16)
#pragma intrinsic(_InterlockedExchangeAdd)
#pragma intrinsic(_InterlockedExchangeAdd8)
#pragma intrinsic(_InterlockedExchangeAdd16)
#pragma intrinsic(_InterlockedAnd8)
#pragma intrinsic(_InterlockedAnd16)
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedOr8)
#pragma intrinsic(_InterlockedOr16)
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedXor8)
#pragma intrinsic(_InterlockedXor16)
#pragma intrinsic(_InterlockedXor)
#pragma intrinsic(_InterlockedDecrement)
#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedDecrement16)
#pragma intrinsic(_InterlockedIncrement16)
#pragma intrinsic(_interlockedbittestandreset)
#pragma intrinsic(_interlockedbittestandset)
#if defined(_M_IX86)
#pragma intrinsic(_InterlockedAddLargeStatistic)
#elif defined(_M_AMD64)
#pragma intrinsic(_InterlockedExchange64)
#pragma intrinsic(_InterlockedExchangeAdd64)
#pragma intrinsic(_InterlockedCompareExchangePointer)
#pragma intrinsic(_InterlockedExchangePointer)
#pragma intrinsic(_InterlockedCompareExchange128)
#pragma intrinsic(_InterlockedAnd64)
#pragma intrinsic(_InterlockedOr64)
#pragma intrinsic(_InterlockedDecrement64)
#pragma intrinsic(_InterlockedIncrement64)
#pragma intrinsic(_interlockedbittestandreset64)
#pragma intrinsic(_interlockedbittestandset64)
#pragma intrinsic(_InterlockedAnd_np)
#pragma intrinsic(_InterlockedAnd8_np)
#pragma intrinsic(_InterlockedAnd16_np)
#pragma intrinsic(_InterlockedAnd64_np)
#pragma intrinsic(_InterlockedCompareExchange16_np)
#pragma intrinsic(_InterlockedCompareExchange64_np)
#pragma intrinsic(_InterlockedCompareExchange128_np)
#pragma intrinsic(_InterlockedCompareExchangePointer_np)
#pragma intrinsic(_InterlockedCompareExchange_np)
#pragma intrinsic(_InterlockedOr16_np)
#pragma intrinsic(_InterlockedOr8_np)
#pragma intrinsic(_InterlockedOr_np)
#pragma intrinsic(_InterlockedXor16_np)
#pragma intrinsic(_InterlockedXor64_np)
#pragma intrinsic(_InterlockedXor8_np)
#pragma intrinsic(_InterlockedXor_np)
#pragma intrinsic(_InterlockedOr64_np)
#elif defined(_M_ARM)
#endif
#if defined(_M_AMD64) || defined(_M_ARM)
#endif
/*** String operations ***/
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__stosb)
#pragma intrinsic(__stosw)
#pragma intrinsic(__stosd)
#pragma intrinsic(__movsb)
#pragma intrinsic(__movsw)
#pragma intrinsic(__movsd)
#endif
#ifdef _M_AMD64
#pragma intrinsic(__stosq)
#pragma intrinsic(__movsq)
#endif
/*** GS segment addressing ***/
#if defined(_M_AMD64)
#pragma intrinsic(__writegsbyte)
#pragma intrinsic(__writegsword)
#pragma intrinsic(__writegsdword)
#pragma intrinsic(__writegsqword)
#pragma intrinsic(__readgsbyte)
#pragma intrinsic(__readgsword)
#pragma intrinsic(__readgsdword)
#pragma intrinsic(__readgsqword)
#pragma intrinsic(__incgsbyte)
#pragma intrinsic(__incgsword)
#pragma intrinsic(__incgsdword)
#pragma intrinsic(__incgsqword)
#pragma intrinsic(__addgsbyte)
#pragma intrinsic(__addgsword)
#pragma intrinsic(__addgsdword)
#pragma intrinsic(__addgsqword)
#endif
/*** FS segment addressing ***/
#if defined(_M_IX86)
#pragma intrinsic(__writefsbyte)
#pragma intrinsic(__writefsword)
#pragma intrinsic(__writefsdword)
#pragma intrinsic(__writefsdword)
#pragma intrinsic(__readfsbyte)
#pragma intrinsic(__readfsword)
#pragma intrinsic(__readfsdword)
#pragma intrinsic(__incfsbyte)
#pragma intrinsic(__incfsword)
#pragma intrinsic(__incfsdword)
#pragma intrinsic(__addfsbyte)
#pragma intrinsic(__addfsword)
#pragma intrinsic(__addfsdword)
#endif
/*** Bit manipulation ***/
#pragma intrinsic(_BitScanForward)
#pragma intrinsic(_BitScanReverse)
#ifdef _WIN64
#pragma intrinsic(_BitScanForward64)
#pragma intrinsic(_BitScanReverse64)
#endif
#pragma intrinsic(_bittest)
#pragma intrinsic(_bittestandcomplement)
#pragma intrinsic(_bittestandreset)
#pragma intrinsic(_bittestandset)
#pragma intrinsic(_rotl8)
#pragma intrinsic(_rotl16)
#pragma intrinsic(_rotl)
#pragma intrinsic(_rotl64)
#pragma intrinsic(_lrotl)
#pragma intrinsic(_rotr8)
#pragma intrinsic(_rotr16)
#pragma intrinsic(_rotr)
#pragma intrinsic(_rotr64)
#pragma intrinsic(_lrotr)
#pragma intrinsic(_byteswap_ushort)
#pragma intrinsic(_byteswap_ulong)
#pragma intrinsic(_byteswap_uint64)
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__ll_lshift)
#pragma intrinsic(__ll_rshift)
#pragma intrinsic(__ull_rshift)
#pragma intrinsic(__lzcnt)
#pragma intrinsic(__lzcnt16)
#pragma intrinsic(__popcnt)
#pragma intrinsic(__popcnt16)
#endif
#ifdef _M_AMD64
#pragma intrinsic(__shiftleft128)
#pragma intrinsic(__shiftright128)
#pragma intrinsic(_bittest64)
#pragma intrinsic(_bittestandcomplement64)
#pragma intrinsic(_bittestandreset64)
#pragma intrinsic(_bittestandset64)
#pragma intrinsic(__lzcnt64)
#pragma intrinsic(__popcnt64)
#elif defined(_M_ARM)
#endif
/*** 64/128-bit math ***/
#pragma intrinsic(_abs64)
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__emul)
#pragma intrinsic(__emulu)
#endif
#ifdef _M_AMD64
#pragma intrinsic(__mulh)
#pragma intrinsic(__umulh)
#pragma intrinsic(_mul128)
#pragma intrinsic(_umul128)
#elif defined(_M_ARM)
#pragma intrinsic(_MulHigh)
#pragma intrinsic(_MulUnsignedHigh)
#endif
/** Floating point stuff **/
#if defined(_M_ARM)
#pragma intrinsic(_isunordered)
#pragma intrinsic(_isunorderedf)
#pragma intrinsic(_CopyDoubleFromInt64)
#pragma intrinsic(_CopyFloatFromInt32)
#pragma intrinsic(_CopyInt32FromFloat)
#pragma intrinsic(_CopyInt64FromDouble)
#endif
/*** Port I/O ***/
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__inbyte)
#pragma intrinsic(__inword)
#pragma intrinsic(__indword)
#pragma intrinsic(__inbytestring)
#pragma intrinsic(__inwordstring)
#pragma intrinsic(__indwordstring)
#pragma intrinsic(__outbyte)
#pragma intrinsic(__outword)
#pragma intrinsic(__outdword)
#pragma intrinsic(__outbytestring)
#pragma intrinsic(__outwordstring)
#pragma intrinsic(__outdwordstring)
#pragma intrinsic(_inp)
#pragma intrinsic(_inpd)
#pragma intrinsic(_inpw)
#pragma intrinsic(inp)
#pragma intrinsic(inpd)
#pragma intrinsic(inpw)
#pragma intrinsic(_outp)
#pragma intrinsic(_outpd)
#pragma intrinsic(_outpw)
#pragma intrinsic(outp)
#pragma intrinsic(outpd)
#pragma intrinsic(outpw)
#endif
/*** System information ***/
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__cpuid)
#pragma intrinsic(__cpuidex)
#pragma intrinsic(__rdtsc)
#pragma intrinsic(__rdtscp)
#pragma intrinsic(__writeeflags)
#pragma intrinsic(__readeflags)
#endif
/*** Interrupts and traps ***/
#pragma intrinsic(__debugbreak)
#pragma intrinsic(_disable)
#pragma intrinsic(_enable)
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__int2c)
#pragma intrinsic(__halt)
#pragma intrinsic(__ud2)
#if (_MSC_VER >= 1700)
#pragma intrinsic(__fastfail)
#else
#if defined(_M_IX86)
__declspec(noreturn) __forceinline
void __fastfail(unsigned int Code)
{
__asm
{
mov ecx, Code
int 29h
}
}
#else
void __fastfail(unsigned int Code);
#endif // defined(_M_IX86)
#endif
#endif
#if defined(_M_ARM)
#endif
/*** Protected memory management ***/
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__writecr0)
#pragma intrinsic(__writecr3)
#pragma intrinsic(__writecr4)
#pragma intrinsic(__writecr8)
#endif
#if defined(_M_IX86)
#pragma intrinsic(__readcr0)
#pragma intrinsic(__readcr2)
#pragma intrinsic(__readcr3)
//#pragma intrinsic(__readcr4)
// HACK: MSVC is broken
unsigned long __cdecl ___readcr4(void);
#define __readcr4 ___readcr4
#pragma intrinsic(__readcr8)
#pragma intrinsic(__readdr)
#pragma intrinsic(__writedr)
// This intrinsic is broken and generates wrong opcodes,
// when optimization is enabled!
#pragma warning(push)
#pragma warning(disable:4711)
void __forceinline __invlpg_fixed(void * Address)
{
_ReadWriteBarrier();
__asm
{
mov eax, Address
invlpg [eax]
}
_ReadWriteBarrier();
}
#pragma warning(pop)
#define __invlpg __invlpg_fixed
#elif defined(_M_AMD64)
#pragma intrinsic(__invlpg)
#pragma intrinsic(__readcr0)
#pragma intrinsic(__readcr2)
#pragma intrinsic(__readcr3)
#pragma intrinsic(__readcr4)
#pragma intrinsic(__readcr8)
#pragma intrinsic(__readdr)
#pragma intrinsic(__writedr)
#elif defined(_M_ARM)
#pragma intrinsic(__prefetch)
#endif
/*** System operations ***/
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__readmsr)
#pragma intrinsic(__writemsr)
#pragma intrinsic(__readpmc)
#pragma intrinsic(__segmentlimit)
#pragma intrinsic(__wbinvd)
#pragma intrinsic(__lidt)
#pragma intrinsic(__sidt)
#if (_MSC_VER >= 1800)
#pragma intrinsic(_sgdt)
#else
#if defined(_M_IX86)
__forceinline
void _sgdt(void *Destination)
{
__asm
{
mov eax, Destination
sgdt [eax]
}
}
#else
void _sgdt(void *Destination);
#endif // defined(_M_IX86)
#endif
#pragma intrinsic(_mm_pause)
#endif
#if defined(_M_ARM)
#pragma intrinsic(_MoveFromCoprocessor)
#pragma intrinsic(_MoveFromCoprocessor2)
#pragma intrinsic(_MoveFromCoprocessor64)
#pragma intrinsic(_MoveToCoprocessor)
#pragma intrinsic(_MoveToCoprocessor2)
#pragma intrinsic(_MoveToCoprocessor64)
#pragma intrinsic(_ReadStatusReg)
#pragma intrinsic(_WriteStatusReg)
#pragma intrinsic(__yield)
#pragma intrinsic(__wfe)
#pragma intrinsic(__wfi)
#pragma intrinsic(__swi)
#pragma intrinsic(__hvc)
#pragma intrinsic(__ldrexd)
#pragma intrinsic(__rdpmccntr64)
#pragma intrinsic(__sev)
#endif
/** Secure virtual machine **/
#if defined(_M_IX86) || defined(_M_AMD64)
#pragma intrinsic(__svm_clgi)
#pragma intrinsic(__svm_invlpga)
#pragma intrinsic(__svm_skinit)
#pragma intrinsic(__svm_stgi)
#pragma intrinsic(__svm_vmload)
#pragma intrinsic(__svm_vmrun)
#pragma intrinsic(__svm_vmsave)
#endif
/** Virtual machine extension **/
#if defined(_M_IX86) || defined(_M_AMD64)
#endif
#if defined(_M_AMD64)
#endif
/** Misc **/
#pragma intrinsic(__nop)
#if (_MSC_VER >= 1700)
#pragma intrinsic(__code_seg)
#endif
#ifdef _M_ARM
#pragma intrinsic(_AddSatInt)
#pragma intrinsic(_DAddSatInt)
#pragma intrinsic(_DSubSatInt)
#pragma intrinsic(_SubSatInt)
#pragma intrinsic(__emit)
#pragma intrinsic(__static_assert)
#endif
#ifdef __cplusplus
}
#endif
/* EOF */

View file

@ -0,0 +1,44 @@
#ifndef _FLOAT_H___
#define _FLOAT_H___
#define FLT_RADIX 2
#define FLT_MANT_DIG 24
#define DBL_MANT_DIG 53
#define LDBL_MANT_DIG DBL_MANT_DIG
#define FLT_DIG 6
#define DBL_DIG 15
#define LDBL_DIG 15
#define FLT_MIN_EXP (-125)
#define DBL_MIN_EXP (-1021)
#define LDBL_MIN_EXP (-1021)
#define FLT_MIN_10_EXP (-37)
#define DBL_MIN_10_EXP (-307)
#define LDBL_MIN_10_EXP (-307)
#define FLT_MAX_EXP 128
#define DBL_MAX_EXP 1024
#define LDBL_MAX_EXP 1024
#define FLT_MAX_10_EXP 38
#define DBL_MAX_10_EXP 308
#define LDBL_MAX_10_EXP 308
#define FLT_MAX 3.402823466e+38F
#define DBL_MAX 1.7976931348623158e+308
#define LDBL_MAX 1.7976931348623158e+308
#define FLT_EPSILON 1.192092896e-07F
#define DBL_EPSILON 2.2204460492503131e-016
#define LDBL_EPSILON 2.2204460492503131e-016
#define FLT_MIN 1.175494351e-38F
#define DBL_MIN 2.2250738585072014e-308
#define LDBL_MIN 2.2250738585072014e-308
#define FLT_ROUNDS 1
#endif

View file

@ -0,0 +1,30 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifdef _WCHAR_T_DEFINED
typedef void (__cdecl *POGOAUTOSWEEPPROCW)(const wchar_t *);
#else
typedef void (__cdecl *POGOAUTOSWEEPPROCW)(const unsigned short *);
#endif
typedef void (__cdecl *POGOAUTOSWEEPPROCA)(const char *);
#ifdef __cplusplus
extern "C"
#else
extern
#endif
POGOAUTOSWEEPPROCW PogoAutoSweepW;
#ifdef __cplusplus
extern "C"
#else
extern
#endif
POGOAUTOSWEEPPROCA PogoAutoSweepA;
#ifdef UNICODE
#define PgoAutoSweep PogoAutoSweepW
#else
#define PgoAutoSweep PogoAutoSweepA
#endif

View file

@ -0,0 +1,88 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_RTCAPI
#define _INC_RTCAPI
#include <crtdefs.h>
#pragma pack(push,_CRT_PACKING)
#define _RTCINTERNAL_DEPRECATED
#ifdef __cplusplus
extern "C" {
#endif
typedef enum _RTC_ErrorNumber {
_RTC_CHKSTK = 0,_RTC_CVRT_LOSS_INFO,_RTC_CORRUPT_STACK,_RTC_UNINIT_LOCAL_USE,_RTC_CORRUPTED_ALLOCA,_RTC_ILLEGAL
} _RTC_ErrorNumber;
#define _RTC_ERRTYPE_IGNORE -1
#define _RTC_ERRTYPE_ASK -2
typedef int (__cdecl *_RTC_error_fn)(int,const char *,int,const char *,const char *,...);
typedef int (__cdecl *_RTC_error_fnW)(int,const wchar_t *,int,const wchar_t *,const wchar_t *,...);
int __cdecl _RTC_NumErrors(void);
const char *__cdecl _RTC_GetErrDesc(_RTC_ErrorNumber _Errnum);
int __cdecl _RTC_SetErrorType(_RTC_ErrorNumber _Errnum,int _ErrType);
_RTC_error_fn __cdecl _RTC_SetErrorFunc(_RTC_error_fn);
_RTC_error_fnW __cdecl _RTC_SetErrorFuncW(_RTC_error_fnW);
void __cdecl _RTC_Initialize(void);
void __cdecl _RTC_Terminate(void);
_RTC_error_fn __cdecl _CRT_RTC_INIT(void *_Res0,void **_Res1,int _Res2,int _Res3,int _Res4);
_RTC_error_fnW __cdecl _CRT_RTC_INITW(void *_Res0,void **_Res1,int _Res2,int _Res3,int _Res4);
typedef struct _RTC_vardesc {
int addr;
int size;
char *name;
} _RTC_vardesc;
typedef struct _RTC_framedesc {
int varCount;
_RTC_vardesc *variables;
} _RTC_framedesc;
#pragma pack(push,1)
typedef struct _RTC_ALLOCA_NODE {
__int32 guard1;
struct _RTC_ALLOCA_NODE *next;
#if (defined(_X86_) && !defined(__x86_64))
__int32 dummypad;
#endif
size_t allocaSize;
#if (defined(_X86_) && !defined(__x86_64))
__int32 dummypad2;
#endif
__int32 guard2[3];
} _RTC_ALLOCA_NODE;
#pragma pack(pop)
char __fastcall _RTC_Check_2_to_1(short _Src);
char __fastcall _RTC_Check_4_to_1(int _Src);
__MINGW_EXTENSION char __fastcall _RTC_Check_8_to_1(__int64 _Src);
short __fastcall _RTC_Check_4_to_2(int _Src);
__MINGW_EXTENSION short __fastcall _RTC_Check_8_to_2(__int64 _Src);
__MINGW_EXTENSION int __fastcall _RTC_Check_8_to_4(__int64 _Src);
#if (defined(_X86_) && !defined(__x86_64))
void __cdecl _RTC_CheckEsp(void);
#endif
void __fastcall _RTC_CheckStackVars(void *_Esp,_RTC_framedesc *_Fd);
void __fastcall _RTC_CheckStackVars2(void *_Esp,_RTC_framedesc *_Fd,_RTC_ALLOCA_NODE *_AllocaList);
void __fastcall _RTC_AllocaHelper(_RTC_ALLOCA_NODE *_PAllocaBase,size_t _CbSize,_RTC_ALLOCA_NODE **_PAllocaInfoList);
void __cdecl _RTC_UninitUse(const char *_Varname);
void __cdecl _RTC_Shutdown(void);
void __cdecl _RTC_InitBase(void);
#ifdef __cplusplus
void *_ReturnAddress(void);
}
#endif
#pragma pack(pop)
#endif

View file

@ -0,0 +1,16 @@
/*
* PROJECT: ReactOS PSDK
* LICENSE: MIT (https://spdx.org/licenses/MIT)
* PURPOSE: Standard Annotation Language (SAL) definitions
* COPYRIGHT: 2021 - Jérôme Gardou
*/
#pragma once
/* Include MS version first */
#include "ms_sal.h"
/* Some overrides with GCC attributes */
#ifdef __GNUC__
#include "gcc_sal.h"
#endif

View file

@ -0,0 +1,222 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_SETJMP
#define _INC_SETJMP
#include <crtdefs.h>
#pragma pack(push,_CRT_PACKING)
#ifdef __cplusplus
extern "C" {
#endif
#if (defined(_X86_) && !defined(__x86_64))
#define _JBLEN 16
#define _JBTYPE int
typedef struct __JUMP_BUFFER {
unsigned long Ebp;
unsigned long Ebx;
unsigned long Edi;
unsigned long Esi;
unsigned long Esp;
unsigned long Eip;
unsigned long Registration;
unsigned long TryLevel;
unsigned long Cookie;
unsigned long UnwindFunc;
unsigned long UnwindData[6];
} _JUMP_BUFFER;
#elif defined(__ia64__)
typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
__MINGW_EXTENSION __int64 LowPart;
__MINGW_EXTENSION __int64 HighPart;
} SETJMP_FLOAT128;
#define _JBLEN 33
typedef SETJMP_FLOAT128 _JBTYPE;
typedef struct __JUMP_BUFFER {
unsigned long iAReserved[6];
unsigned long Registration;
unsigned long TryLevel;
unsigned long Cookie;
unsigned long UnwindFunc;
unsigned long UnwindData[6];
SETJMP_FLOAT128 FltS0;
SETJMP_FLOAT128 FltS1;
SETJMP_FLOAT128 FltS2;
SETJMP_FLOAT128 FltS3;
SETJMP_FLOAT128 FltS4;
SETJMP_FLOAT128 FltS5;
SETJMP_FLOAT128 FltS6;
SETJMP_FLOAT128 FltS7;
SETJMP_FLOAT128 FltS8;
SETJMP_FLOAT128 FltS9;
SETJMP_FLOAT128 FltS10;
SETJMP_FLOAT128 FltS11;
SETJMP_FLOAT128 FltS12;
SETJMP_FLOAT128 FltS13;
SETJMP_FLOAT128 FltS14;
SETJMP_FLOAT128 FltS15;
SETJMP_FLOAT128 FltS16;
SETJMP_FLOAT128 FltS17;
SETJMP_FLOAT128 FltS18;
SETJMP_FLOAT128 FltS19;
__MINGW_EXTENSION __int64 FPSR;
__MINGW_EXTENSION __int64 StIIP;
__MINGW_EXTENSION __int64 BrS0;
__MINGW_EXTENSION __int64 BrS1;
__MINGW_EXTENSION __int64 BrS2;
__MINGW_EXTENSION __int64 BrS3;
__MINGW_EXTENSION __int64 BrS4;
__MINGW_EXTENSION __int64 IntS0;
__MINGW_EXTENSION __int64 IntS1;
__MINGW_EXTENSION __int64 IntS2;
__MINGW_EXTENSION __int64 IntS3;
__MINGW_EXTENSION __int64 RsBSP;
__MINGW_EXTENSION __int64 RsPFS;
__MINGW_EXTENSION __int64 ApUNAT;
__MINGW_EXTENSION __int64 ApLC;
__MINGW_EXTENSION __int64 IntSp;
__MINGW_EXTENSION __int64 IntNats;
__MINGW_EXTENSION __int64 Preds;
} _JUMP_BUFFER;
#elif defined(__x86_64)
typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
__MINGW_EXTENSION unsigned __int64 Part[2];
} SETJMP_FLOAT128;
#define _JBLEN 16
typedef SETJMP_FLOAT128 _JBTYPE;
typedef struct _JUMP_BUFFER {
__MINGW_EXTENSION unsigned __int64 Frame;
__MINGW_EXTENSION unsigned __int64 Rbx;
__MINGW_EXTENSION unsigned __int64 Rsp;
__MINGW_EXTENSION unsigned __int64 Rbp;
__MINGW_EXTENSION unsigned __int64 Rsi;
__MINGW_EXTENSION unsigned __int64 Rdi;
__MINGW_EXTENSION unsigned __int64 R12;
__MINGW_EXTENSION unsigned __int64 R13;
__MINGW_EXTENSION unsigned __int64 R14;
__MINGW_EXTENSION unsigned __int64 R15;
__MINGW_EXTENSION unsigned __int64 Rip;
__MINGW_EXTENSION unsigned __int64 Spare;
SETJMP_FLOAT128 Xmm6;
SETJMP_FLOAT128 Xmm7;
SETJMP_FLOAT128 Xmm8;
SETJMP_FLOAT128 Xmm9;
SETJMP_FLOAT128 Xmm10;
SETJMP_FLOAT128 Xmm11;
SETJMP_FLOAT128 Xmm12;
SETJMP_FLOAT128 Xmm13;
SETJMP_FLOAT128 Xmm14;
SETJMP_FLOAT128 Xmm15;
} _JUMP_BUFFER;
#elif defined(_M_ARM)
#define _JBLEN 28
#define _JBTYPE int
typedef struct _JUMP_BUFFER {
unsigned long Frame;
unsigned long R4;
unsigned long R5;
unsigned long R6;
unsigned long R7;
unsigned long R8;
unsigned long R9;
unsigned long R10;
unsigned long R11;
unsigned long Sp;
unsigned long Pc;
unsigned long Fpscr;
unsigned long long D[8]; // D8-D15 VFP/NEON regs
} _JUMP_BUFFER;
#elif defined(_M_ARM64)
#define _JBLEN 24
#define _JBTYPE unsigned __int64
typedef struct __JUMP_BUFFER {
unsigned __int64 Frame;
unsigned __int64 Reserved;
unsigned __int64 X19;
unsigned __int64 X20;
unsigned __int64 X21;
unsigned __int64 X22;
unsigned __int64 X23;
unsigned __int64 X24;
unsigned __int64 X25;
unsigned __int64 X26;
unsigned __int64 X27;
unsigned __int64 X28;
unsigned __int64 Fp;
unsigned __int64 Lr;
unsigned __int64 Sp;
unsigned long Fpcr;
unsigned long Fpsr;
double D[8];
} _JUMP_BUFFER;
#else
#error Define Setjmp for this architecture!
#endif
#ifndef _JMP_BUF_DEFINED
typedef _JBTYPE jmp_buf[_JBLEN];
#define _JMP_BUF_DEFINED
#endif
#ifdef USE_MINGW_SETJMP_TWO_ARGS
#ifndef _INC_SETJMPEX
#if defined(__x86_64)
# define mingw_getsp() \
({ void* value; __asm__ __volatile__("movq %%rsp, %[value]" : [value] "=r" (value)); value; })
#elif defined(_X86_)
# define mingw_getsp() \
({ void* value; __asm__ __volatile__("movl %%esp, %[value]" : [value] "=r" (value)); value; })
#endif
#define setjmp(BUF) _setjmp((BUF),mingw_getsp())
int __MINGW_NOTHROW __cdecl _setjmp(jmp_buf _Buf,void *_Ctx);
#else /* _INC_SETJMPEX */
#undef setjmp
#define setjmp(BUF) _setjmpex((BUF),mingw_getsp())
#define setjmpex(BUF) _setjmpex((BUF),mingw_getsp())
int __MINGW_NOTHROW __cdecl _setjmpex(jmp_buf _Buf,void *_Ctx);
#endif /* _INC_SETJMPEX */
#else /* !USE_MINGW_SETJMP_TWO_ARGS */
#ifndef _INC_SETJMPEX
#define setjmp _setjmp
#endif
int __MINGW_NOTHROW __cdecl setjmp(jmp_buf _Buf);
#endif /* !USE_MINGW_SETJMP_TWO_ARGS */
__declspec(noreturn) __MINGW_NOTHROW void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
__declspec(noreturn) __MINGW_NOTHROW void __cdecl longjmp(jmp_buf _Buf,int _Value);
#ifdef __cplusplus
}
#endif
#pragma pack(pop)
#endif

View file

@ -0,0 +1,25 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_SETJMPEX
#define _INC_SETJMPEX
#ifndef _WIN32
#error Only Win32 target is supported!
#endif
#if (defined(_X86_) && !defined(__x86_64))
__declspec(noreturn) __MINGW_NOTHROW void __cdecl _longjmpex(jmp_buf _Buf,int _Value);
#define setjmp _setjmp
#define longjmp _longjmpex
#else
#ifdef setjmp
#undef setjmp
#endif
#define setjmp _setjmpex
#endif
#include <setjmp.h>
#endif

View file

@ -0,0 +1,53 @@
/* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you include this header file into source
files compiled by GCC, this header file does not by itself cause
the resulting executable to be covered by the GNU General Public
License. This exception does not however invalidate any other
reasons why the executable file might be covered by the GNU General
Public License. */
/*
* ISO C Standard: 7.15 Variable arguments <stdarg.h>
*/
#pragma once
#ifndef _INC_STDARG
#define _INC_STDARG
#include <crtdefs.h>
#include <vadefs.h>
#ifndef _WIN32
#error Only Win32 target is supported!
#endif
#ifndef va_start
#define va_start __crt_va_start
#endif
#ifndef va_arg
#define va_arg __crt_va_arg
#endif
#ifndef va_end
#define va_end __crt_va_end
#endif
#endif

View file

@ -0,0 +1,51 @@
/*===---- stdbool.h - Standard header for booleans -------------------------===
*
* Copyright (c) 2008 Eli Friedman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*===-----------------------------------------------------------------------===
*/
#ifndef __STDBOOL_H
#define __STDBOOL_H
/* Don't define bool, true, and false in C++, except as a GNU extension. */
#ifndef __cplusplus
#if defined(_MSC_VER) && _MSC_VER <= 1600
#define bool unsigned char
#else
#define bool _Bool
#endif
#define true 1
#define false 0
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
/* Define _Bool as a GNU extension. */
#define _Bool bool
#if __cplusplus < 201103L
/* For C++98, define bool, false, true as a GNU extension. */
#define bool bool
#define false false
#define true true
#endif
#endif
#define __bool_true_false_are_defined 1
#endif /* __STDBOOL_H */

View file

@ -0,0 +1,211 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
/* ISO C9x 7.18 Integer types <stdint.h>
* Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Date: 2000-12-02
*/
#ifndef _STDINT_H
#define _STDINT_H
#include <crtdefs.h>
#define __need_wint_t
#define __need_wchar_t
#include "stddef.h"
/* 7.18.1.1 Exact-width integer types */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned uint32_t;
__MINGW_EXTENSION typedef long long int64_t;
__MINGW_EXTENSION typedef unsigned long long uint64_t;
/* 7.18.1.2 Minimum-width integer types */
typedef signed char int_least8_t;
typedef unsigned char uint_least8_t;
typedef short int_least16_t;
typedef unsigned short uint_least16_t;
typedef int int_least32_t;
typedef unsigned uint_least32_t;
__MINGW_EXTENSION typedef long long int_least64_t;
__MINGW_EXTENSION typedef unsigned long long uint_least64_t;
/* 7.18.1.3 Fastest minimum-width integer types
* Not actually guaranteed to be fastest for all purposes
* Here we use the exact-width types for 8 and 16-bit ints.
*/
typedef char int_fast8_t;
typedef unsigned char uint_fast8_t;
typedef short int_fast16_t;
typedef unsigned short uint_fast16_t;
typedef int int_fast32_t;
typedef unsigned int uint_fast32_t;
__MINGW_EXTENSION typedef long long int_fast64_t;
__MINGW_EXTENSION typedef unsigned long long uint_fast64_t;
/* 7.18.1.5 Greatest-width integer types */
__MINGW_EXTENSION typedef long long intmax_t;
__MINGW_EXTENSION typedef unsigned long long uintmax_t;
/* 7.18.2 Limits of specified-width integer types */
#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
/* 7.18.2.1 Limits of exact-width integer types */
#define INT8_MIN (-128)
#define INT16_MIN (-32768)
#define INT32_MIN (-2147483647 - 1)
#define INT64_MIN (-9223372036854775807LL - 1)
#define INT8_MAX 127
#define INT16_MAX 32767
#define INT32_MAX 2147483647
#define INT64_MAX 9223372036854775807LL
#define UINT8_MAX 0xff /* 255U */
#define UINT16_MAX 0xffff /* 65535U */
#define UINT32_MAX 0xffffffff /* 4294967295U */
#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
/* 7.18.2.2 Limits of minimum-width integer types */
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
/* 7.18.2.3 Limits of fastest minimum-width integer types */
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
/* 7.18.2.4 Limits of integer types capable of holding
object pointers */
#ifdef _WIN64
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
#else
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
#define UINTPTR_MAX UINT32_MAX
#endif
/* 7.18.2.5 Limits of greatest-width integer types */
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
/* 7.18.3 Limits of other integer types */
#ifdef _WIN64
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
#else
#define PTRDIFF_MIN INT32_MIN
#define PTRDIFF_MAX INT32_MAX
#endif
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
#ifndef SIZE_MAX
#ifdef _WIN64
#define SIZE_MAX UINT64_MAX
#else
#define SIZE_MAX UINT32_MAX
#endif
#endif
#ifndef WCHAR_MIN /* also in wchar.h */
#define WCHAR_MIN 0
#endif
#ifndef WCHAR_MAX
#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
#endif
/*
* wint_t is unsigned short for compatibility with MS runtime
*/
#define WINT_MIN 0
#define WINT_MAX ((wint_t)-1) /* UINT16_MAX */
#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
/* 7.18.4 Macros for integer constants */
#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
/* 7.18.4.1 Macros for minimum-width integer constants
Accoding to Douglas Gwyn <gwyn@arl.mil>:
"This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
9899:1999 as initially published, the expansion was required
to be an integer constant of precisely matching type, which
is impossible to accomplish for the shorter types on most
platforms, because C99 provides no standard way to designate
an integer constant with width less than that of type int.
TC1 changed this to require just an integer constant
*expression* with *promoted* type."
The trick used here is from Clive D W Feather.
*/
#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))
#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))
#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))
/* The 'trick' doesn't work in C89 for long long because, without
suffix, (val) will be evaluated as int, not intmax_t */
#define INT64_C(val) val##LL
#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))
#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))
#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))
#define UINT64_C(val) val##ULL
/* 7.18.4.2 Macros for greatest-width integer constants */
#define INTMAX_C(val) val##LL
#define UINTMAX_C(val) val##ULL
#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
#endif

View file

@ -0,0 +1,97 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_VADEFS
#define _INC_VADEFS
#ifndef _WIN32
#error Only Win32 target is supported!
#endif
#include <crtdefs.h>
#undef _CRT_PACKING
#define _CRT_PACKING 8
#pragma pack(push,_CRT_PACKING)
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
#define _ADDRESSOF(v) (&reinterpret_cast<const char &>(v))
#else
#define _ADDRESSOF(v) (&(v))
#endif
#if defined(__ia64__)
#define _VA_ALIGN 8
#define _SLOTSIZEOF(t) ((sizeof(t) + _VA_ALIGN - 1) & ~(_VA_ALIGN - 1))
#define _VA_STRUCT_ALIGN 16
#define _ALIGNOF(ap) ((((ap)+_VA_STRUCT_ALIGN - 1) & ~(_VA_STRUCT_ALIGN -1)) - (ap))
#define _APALIGN(t,ap) (__alignof(t) > 8 ? _ALIGNOF((uintptr_t) ap) : 0)
#else
#define _SLOTSIZEOF(t) (sizeof(t))
#define _APALIGN(t,ap) (__alignof(t))
#endif
#define _INTSIZEOF(n) ((sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1))
#if defined(__GNUC__) || defined(__clang__)
#define __crt_va_start(v,l) __builtin_va_start(v,l)
#define __crt_va_arg(v,l) __builtin_va_arg(v,l)
#define __crt_va_end(v) __builtin_va_end(v)
#define __va_copy(d,s) __builtin_va_copy(d,s)
#elif defined(_MSC_VER)
#if defined(_M_IX86)
#define __crt_va_start(v,l) ((void)((v) = (va_list)_ADDRESSOF(l) + _INTSIZEOF(l)))
#define __crt_va_arg(v,l) (*(l *)(((v) += _INTSIZEOF(l)) - _INTSIZEOF(l)))
#define __crt_va_end(v) ((void)((v) = (va_list)0))
#define __va_copy(d,s) ((void)((d) = (s)))
#elif defined(_M_AMD64)
#define _PTRSIZEOF(n) ((sizeof(n) + sizeof(void*) - 1) & ~(sizeof(void*) - 1))
#define _ISSTRUCT(t) ((sizeof(t) > sizeof(void*)) || (sizeof(t) & (sizeof(t)-1)) != 0)
#define __crt_va_start(v,l) ((void)((v) = (va_list)_ADDRESSOF(l) + _PTRSIZEOF(l)))
#define __crt_va_arg(v,t) (_ISSTRUCT(t) ? \
(**(t**)(((v) += sizeof(void*)) - sizeof(void*))) : \
(*(t*)(((v) += sizeof(void*)) - sizeof(void*))))
#define __crt_va_end(v) ((void)((v) = (va_list)0))
#define __va_copy(d,s) ((void)((d) = (s)))
#elif defined(_M_ARM)
#ifdef __cplusplus
extern void __cdecl __va_start(va_list*, ...);
#define __crt_va_start(ap,v) __va_start(&ap, _ADDRESSOF(v), _SLOTSIZEOF(v), _ADDRESSOF(v))
#else
#define __crt_va_start(ap,v) (ap = (va_list)_ADDRESSOF(v) + _SLOTSIZEOF(v))
#endif
#define __crt_va_arg(ap,t) (*(t*)((ap += _SLOTSIZEOF(t) + _APALIGN(t,ap)) - _SLOTSIZEOF(t)))
#define __crt_va_end(ap) ( ap = (va_list)0 )
#define __va_copy(d,s) ((void)((d) = (s)))
#elif defined(_M_ARM64)
extern void __cdecl __va_start(va_list*, ...);
#define __crt_va_start(ap,v) ((void)(__va_start(&ap, _ADDRESSOF(v), _SLOTSIZEOF(v), __alignof(v), _ADDRESSOF(v))))
#define __crt_va_arg(ap, t) \
((sizeof(t) > (2 * sizeof(__int64))) \
? **(t**)((ap += sizeof(__int64)) - sizeof(__int64)) \
: *(t*)((ap += _SLOTSIZEOF(t) + _APALIGN(t,ap)) - _SLOTSIZEOF(t)))
#define __crt_va_end(ap) ((void)(ap = (va_list)0))
#define __va_copy(d,s) ((void)((d) = (s)))
#else //if defined(_M_IA64) || defined(_M_CEE)
#error Please implement me
#endif
#endif
#if !defined(va_copy) && (!defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L)
#define va_copy(d,s) __va_copy((d),(s))
#endif
#ifdef __cplusplus
}
#endif
#pragma pack(pop)
#endif

View file

@ -0,0 +1,12 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _VARARGS_H
#define _VARARGS_H
#error "GCC no longer implements <varargs.h>."
#error "Revise your code to use <stdarg.h>."
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,52 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _YMATH
#define _YMATH
#include <yvals.h>
_C_STD_BEGIN
_C_LIB_DECL
#pragma pack(push,_CRT_PACKING)
#define _DENORM (-2)
#define _FINITE (-1)
#define _INFCODE 1
#define _NANCODE 2
#define _FE_DIVBYZERO 0x04
#define _FE_INEXACT 0x20
#define _FE_INVALID 0x01
#define _FE_OVERFLOW 0x08
#define _FE_UNDERFLOW 0x10
typedef union {
unsigned short _Word[8];
float _Float;
double _Double;
long double _Long_double;
} _Dconst;
void __cdecl _Feraise(int);
_CRTIMP double __cdecl _Cosh(double,double);
_CRTIMP short __cdecl _Dtest(double *);
_CRTIMP short __cdecl _Exp(double *,double,short);
_CRTIMP double __cdecl _Sinh(double,double);
extern _CRTIMP _Dconst _Denorm,_Hugeval,_Inf,_Nan,_Snan;
_CRTIMP float __cdecl _FCosh(float,float);
_CRTIMP short __cdecl _FDtest(float *);
_CRTIMP short __cdecl _FExp(float *,float,short);
_CRTIMP float __cdecl _FSinh(float,float);
extern _CRTIMP _Dconst _FDenorm,_FInf,_FNan,_FSnan;
_CRTIMP long double __cdecl _LCosh(long double,long double);
_CRTIMP short __cdecl _LDtest(long double *);
_CRTIMP short __cdecl _LExp(long double *,long double,short);
_CRTIMP long double __cdecl _LSinh(long double,long double);
extern _CRTIMP _Dconst _LDenorm,_LInf,_LNan,_LSnan;
_END_C_LIB_DECL
_C_STD_END
#pragma pack(pop)
#endif