#endif
#endif
+#undef _CRT_PACKING
+#define _CRT_PACKING 8
+#pragma pack(push,_CRT_PACKING)
+
/* Disable non-ANSI C definitions if compiling with __STDC__ */
//HACK: Disabled
//#if __STDC__
/** Properties ***************************************************************/
-#undef _CRT_PACKING
-#define _CRT_PACKING 8
-#pragma pack(push,_CRT_PACKING)
-
#ifndef _CRT_STRINGIZE
#define __CRT_STRINGIZE(_Value) #_Value
#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
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;
#endif
/*** memcopy must be memmove ***/
+void* memmove(void*, const void*, size_t);
__INTRIN_INLINE void* memcpy(void* dest, const void* source, size_t num)
{
return memmove(dest, source, num);
* ISO C Standard: 7.15 Variable arguments <stdarg.h>
*/
+#pragma once
+
#ifndef _INC_STDARG
#define _INC_STDARG
-#ifndef _WIN32
-#error Only Win32 target is supported!
-#endif
-
-#ifndef _STDARG_H
-#ifndef _ANSI_STDARG_H_
-#ifndef __need___va_list
-#define _STDARG_H
-#define _ANSI_STDARG_H_
-#endif /* not __need___va_list */
-#undef __need___va_list
-
-/* Define __gnuc_va_list. */
-
-#ifdef __GNUC__
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef __builtin_va_list __gnuc_va_list;
-#endif
-#endif
-/* Define the standard macros for the user,
- if this invocation was from the user program. */
-#ifdef _STDARG_H
-
-#ifdef __GNUC__
-#define va_start(v,l) __builtin_va_start(v,l)
-#define va_end(v) __builtin_va_end(v)
-#define va_arg(v,l) __builtin_va_arg(v,l)
-#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L
-#define va_copy(d,s) __builtin_va_copy(d,s)
-#endif
-#define __va_copy(d,s) __builtin_va_copy(d,s)
-#endif
-
-/* Define va_list, if desired, from __gnuc_va_list. */
-/* We deliberately do not define va_list when called from
- stdio.h, because ANSI C says that stdio.h is not supposed to define
- va_list. stdio.h needs to have access to that data type,
- but must not use that name. It should use the name __gnuc_va_list,
- which is safe because it is reserved for the implementation. */
-
-#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
-#undef _VA_LIST
-#endif
-
-#ifdef _BSD_VA_LIST
-#undef _BSD_VA_LIST
-#endif
-
-#ifdef __GNUC__
-#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
-/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
- so we must avoid testing it and setting it here.
- SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
- have no conflict with that. */
-#ifndef _VA_LIST_
-#define _VA_LIST_
-#ifdef __i860__
-#ifndef _VA_LIST
-#define _VA_LIST va_list
-#endif
-#endif /* __i860__ */
-typedef __gnuc_va_list va_list;
-#ifdef _SCO_DS
-#define __VA_LIST
-#endif
-#endif /* _VA_LIST_ */
-#else /* not __svr4__ || _SCO_DS */
+#include <crtdefs.h>
+#include <vadefs.h>
-/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
- But on BSD NET2 we must not test or define or undef it.
- (Note that the comments in NET 2's ansi.h
- are incorrect for _VA_LIST_--see stdio.h!) */
-#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
-/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
-#ifndef _VA_LIST_DEFINED
-/* The macro _VA_LIST is used in SCO Unix 3.2. */
-#ifndef _VA_LIST
-/* The macro _VA_LIST_T_H is used in the Bull dpx2 */
-#ifndef _VA_LIST_T_H
-/* The macro __va_list__ is used by BeOS. */
-#ifndef __va_list__
-typedef __gnuc_va_list va_list;
-#endif /* not __va_list__ */
-#endif /* not _VA_LIST_T_H */
-#endif /* not _VA_LIST */
-#endif /* not _VA_LIST_DEFINED */
-#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
-#define _VA_LIST_
-#endif
-#ifndef _VA_LIST
-#define _VA_LIST
-#endif
-#ifndef _VA_LIST_DEFINED
-#define _VA_LIST_DEFINED
-#endif
-#ifndef _VA_LIST_T_H
-#define _VA_LIST_T_H
-#endif
-#ifndef __va_list__
-#define __va_list__
+#ifndef _WIN32
+#error Only Win32 target is supported!
#endif
-#endif /* not _VA_LIST_, except on certain systems */
-
-#endif /* not __svr4__ */
-
-#endif /* __GNUC__ */
-#endif /* _STDARG_H */
-
-#endif /* not _ANSI_STDARG_H_ */
-#endif /* not _STDARG_H */
-
-#include <vadefs.h>
-
#ifndef va_start
#define va_start _crt_va_start
#endif
extern "C" {
#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 long uintptr_t;
-#endif
-#endif
-#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 char * va_list;
-#endif
-#endif
-
#ifdef __cplusplus
#define _ADDRESSOF(v) (&reinterpret_cast<const char &>(v))
#else
# endif
#endif
+#ifndef STDMETHODCALLTYPE
#define STDMETHODCALLTYPE __stdcall
#define STDMETHODVCALLTYPE __cdecl
#define STDAPICALLTYPE __stdcall
#define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
#define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
+#endif /* !STDMETHODCALLTYPE */
#if defined(__cplusplus) && !defined(CINTERFACE)
# define interface struct
#ifndef GUID_DEFINED
#define GUID_DEFINED
+
typedef struct _GUID
{
#ifdef _MSC_VER
} GUID;
#endif
+#ifndef FAR
+#define FAR
+#endif
+
#ifndef DECLSPEC_SELECTANY
#define DECLSPEC_SELECTANY __declspec(selectany)
#endif
#define REFFMTID const FMTID* __MIDL_CONST
#endif /* !defined(__cplusplus) && !defined(CINTERFACE) */
+#if !defined(__midl) && !defined(__WIDL__)
+#include <string.h>
#if defined(__cplusplus) && !defined(CINTERFACE)
__inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
#define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
#endif /* defined(__cplusplus) && !defined(CINTERFACE) */
+#endif /* __midl && __WIDL__ */
#if defined(__cplusplus) && !defined(CINTERFACE)
#include <string.h>
#include <specstrings.h>
#include <kernelspecs.h>
-// FIXME: Shouldn't be included!
-#include <stdarg.h>
-#include <string.h>
-
#ifdef __cplusplus
extern "C" {
#endif
/* Default to strict */
#ifndef NO_STRICT
#ifndef STRICT
-//#define STRICT 1 // FIXME: disabled for now
+#define STRICT 1
#endif
#endif
#define CRITICAL
#endif
-// FIXME: deprecated
-#ifndef FAR
-#define FAR
-#endif
-
/* Constant modifier */
#ifndef CONST
#define CONST const
#define ANYSIZE_ARRAY 1
#endif
-#ifdef __cplusplus
-#define EXTERN_C extern "C"
-#else
-#define EXTERN_C extern
-#endif
-
/* Helper macro to enable gcc's extension. */
#ifndef __GNU_EXTENSION
#ifdef __GNUC__
#define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(ULONG)
#endif
+#ifdef __cplusplus
+#define EXTERN_C extern "C"
+#else
+#define EXTERN_C extern
+#endif
+
/* Calling Conventions */
#if defined(_MANAGED)
#define FASTCALL __stdcall
#define NTAPI __stdcall
+#ifndef STDMETHODCALLTYPE
+#define STDMETHODCALLTYPE __stdcall
+#define STDMETHODVCALLTYPE __cdecl
+#define STDAPICALLTYPE __stdcall
+#define STDAPIVCALLTYPE __cdecl
+#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
+#define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
+#define STDMETHODIMP HRESULT STDMETHODCALLTYPE
+#define STDMETHODIMP_(t) t STDMETHODCALLTYPE
+#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
+#define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
+#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
+#define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
+#endif /* !STDMETHODCALLTYPE */
+
+#define STDOVERRIDEMETHODIMP __override STDMETHODIMP
+#define STDOVERRIDEMETHODIMP_(t) __override STDMETHODIMP_(t)
+#define IFACEMETHODIMP __override STDMETHODIMP
+#define IFACEMETHODIMP_(t) __override STDMETHODIMP_(t)
+#define STDOVERRIDEMETHODIMPV __override STDMETHODIMPV
+#define STDOVERRIDEMETHODIMPV_(t) __override STDMETHODIMPV_(t)
+#define IFACEMETHODIMPV __override STDMETHODIMPV
+#define IFACEMETHODIMPV_(t) __override STDMETHODIMPV_(t)
+
/* Import and Export Specifiers */