add missing files
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 31 Dec 2008 16:35:20 +0000 (16:35 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 31 Dec 2008 16:35:20 +0000 (16:35 +0000)
svn path=/branches/ros-amd64-bringup/; revision=38493

reactos/include/crt/crtdbg.h [new file with mode: 0644]
reactos/include/crt/crtdefs.h [new file with mode: 0644]
reactos/include/crt/libgen.h [new file with mode: 0644]
reactos/include/crt/stdarg.h [new file with mode: 0644]
reactos/include/crt/stddef.h [new file with mode: 0644]
reactos/include/crt/vadefs.h [new file with mode: 0644]

diff --git a/reactos/include/crt/crtdbg.h b/reactos/include/crt/crtdbg.h
new file mode 100644 (file)
index 0000000..f5d58fe
--- /dev/null
@@ -0,0 +1,212 @@
+/**
+ * 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>
+
+#ifndef _INC_CRTDBG
+#define _INC_CRTDBG
+
+#pragma pack(push,_CRT_PACKING)
+
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  typedef void *_HFILE;
+
+#define _CRT_WARN 0
+#define _CRT_ERROR 1
+#define _CRT_ASSERT 2
+#define _CRT_ERRCNT 3
+
+#define _CRTDBG_MODE_FILE 0x1
+#define _CRTDBG_MODE_DEBUG 0x2
+#define _CRTDBG_MODE_WNDW 0x4
+#define _CRTDBG_REPORT_MODE -1
+
+#define _CRTDBG_INVALID_HFILE ((_HFILE)-1)
+#define _CRTDBG_HFILE_ERROR ((_HFILE)-2)
+#define _CRTDBG_FILE_STDOUT ((_HFILE)-4)
+#define _CRTDBG_FILE_STDERR ((_HFILE)-5)
+#define _CRTDBG_REPORT_FILE ((_HFILE)-6)
+
+  typedef int (__cdecl *_CRT_REPORT_HOOK)(int,char *,int *);
+  typedef int (__cdecl *_CRT_REPORT_HOOKW)(int,wchar_t *,int *);
+
+#define _CRT_RPTHOOK_INSTALL 0
+#define _CRT_RPTHOOK_REMOVE 1
+
+#define _HOOK_ALLOC 1
+#define _HOOK_REALLOC 2
+#define _HOOK_FREE 3
+
+  typedef int (__cdecl *_CRT_ALLOC_HOOK)(int,void *,size_t,int,long,const unsigned char *,int);
+
+#define _CRTDBG_ALLOC_MEM_DF 0x01
+#define _CRTDBG_DELAY_FREE_MEM_DF 0x02
+#define _CRTDBG_CHECK_ALWAYS_DF 0x04
+#define _CRTDBG_RESERVED_DF 0x08
+#define _CRTDBG_CHECK_CRT_DF 0x10
+#define _CRTDBG_LEAK_CHECK_DF 0x20
+
+#define _CRTDBG_CHECK_EVERY_16_DF 0x00100000
+#define _CRTDBG_CHECK_EVERY_128_DF 0x00800000
+#define _CRTDBG_CHECK_EVERY_1024_DF 0x04000000
+
+#define _CRTDBG_CHECK_DEFAULT_DF 0
+
+#define _CRTDBG_REPORT_FLAG -1
+
+#define _BLOCK_TYPE(block) (block & 0xFFFF)
+#define _BLOCK_SUBTYPE(block) (block >> 16 & 0xFFFF)
+
+#define _FREE_BLOCK 0
+#define _NORMAL_BLOCK 1
+#define _CRT_BLOCK 2
+#define _IGNORE_BLOCK 3
+#define _CLIENT_BLOCK 4
+#define _MAX_BLOCKS 5
+
+  typedef void (__cdecl *_CRT_DUMP_CLIENT)(void *,size_t);
+
+  struct _CrtMemBlockHeader;
+
+  typedef struct _CrtMemState {
+    struct _CrtMemBlockHeader *pBlockHeader;
+    size_t lCounts[_MAX_BLOCKS];
+    size_t lSizes[_MAX_BLOCKS];
+    size_t lHighWaterCount;
+    size_t lTotalCount;
+  } _CrtMemState;
+
+#ifndef _STATIC_ASSERT
+#define _STATIC_ASSERT(expr) typedef char __static_assert_t[(expr)?1:-1]
+#endif
+
+#ifndef _ASSERT
+#define _ASSERT(expr) ((void)0)
+#endif
+
+#ifndef _ASSERTE
+#define _ASSERTE(expr) ((void)0)
+#endif
+
+#ifndef _ASSERT_EXPR
+#define _ASSERT_EXPR(expr,expr_str) ((void)0)
+#endif
+
+#ifndef _ASSERT_BASE
+#define _ASSERT_BASE _ASSERT_EXPR
+#endif
+
+#define _RPT0(rptno,msg)
+#define _RPTW0(rptno,msg)
+
+#define _RPT1(rptno,msg,arg1)
+#define _RPTW1(rptno,msg,arg1)
+#define _RPT2(rptno,msg,arg1,arg2)
+#define _RPTW2(rptno,msg,arg1,arg2)
+#define _RPT3(rptno,msg,arg1,arg2,arg3)
+#define _RPTW3(rptno,msg,arg1,arg2,arg3)
+#define _RPT4(rptno,msg,arg1,arg2,arg3,arg4)
+#define _RPTW4(rptno,msg,arg1,arg2,arg3,arg4)
+#define _RPTF0(rptno,msg)
+#define _RPTFW0(rptno,msg)
+#define _RPTF1(rptno,msg,arg1)
+#define _RPTFW1(rptno,msg,arg1)
+#define _RPTF2(rptno,msg,arg1,arg2)
+#define _RPTFW2(rptno,msg,arg1,arg2)
+#define _RPTF3(rptno,msg,arg1,arg2,arg3)
+#define _RPTFW3(rptno,msg,arg1,arg2,arg3)
+#define _RPTF4(rptno,msg,arg1,arg2,arg3,arg4)
+#define _RPTFW4(rptno,msg,arg1,arg2,arg3,arg4)
+
+#define _malloc_dbg(s,t,f,l) malloc(s)
+#define _calloc_dbg(c,s,t,f,l) calloc(c,s)
+#define _realloc_dbg(p,s,t,f,l) realloc(p,s)
+#define _recalloc_dbg(p,c,s,t,f,l) _recalloc(p,c,s)
+#define _expand_dbg(p,s,t,f,l) _expand(p,s)
+#define _free_dbg(p,t) free(p)
+#define _msize_dbg(p,t) _msize(p)
+
+#define _aligned_malloc_dbg(s,a,f,l) _aligned_malloc(s,a)
+#define _aligned_realloc_dbg(p,s,a,f,l) _aligned_realloc(p,s,a)
+#define _aligned_recalloc_dbg(p,c,s,a,f,l) _aligned_realloc(p,c,s,a)
+#define _aligned_free_dbg(p) _aligned_free(p)
+#define _aligned_offset_malloc_dbg(s,a,o,f,l) _aligned_offset_malloc(s,a,o)
+#define _aligned_offset_realloc_dbg(p,s,a,o,f,l) _aligned_offset_realloc(p,s,a,o)
+#define _aligned_offset_recalloc_dbg(p,c,s,a,o,f,l) _aligned_offset_recalloc(p,c,s,a,o)
+
+#define _malloca_dbg(s,t,f,l) _malloca(s)
+#define _freea_dbg(p,t) _freea(p)
+
+#define _strdup_dbg(s,t,f,l) _strdup(s)
+#define _wcsdup_dbg(s,t,f,l) _wcsdup(s)
+#define _mbsdup_dbg(s,t,f,l) _mbsdup(s)
+#define _tempnam_dbg(s1,s2,t,f,l) _tempnam(s1,s2)
+#define _wtempnam_dbg(s1,s2,t,f,l) _wtempnam(s1,s2)
+#define _fullpath_dbg(s1,s2,le,t,f,l) _fullpath(s1,s2,le)
+#define _wfullpath_dbg(s1,s2,le,t,f,l) _wfullpath(s1,s2,le)
+#define _getcwd_dbg(s,le,t,f,l) _getcwd(s,le)
+#define _wgetcwd_dbg(s,le,t,f,l) _wgetcwd(s,le)
+#define _getdcwd_dbg(d,s,le,t,f,l) _getdcwd(d,s,le)
+#define _wgetdcwd_dbg(d,s,le,t,f,l) _wgetdcwd(d,s,le)
+#define _getdcwd_lk_dbg(d,s,le,t,f,l) _getdcwd_nolock(d,s,le)
+#define _wgetdcwd_lk_dbg(d,s,le,t,f,l) _wgetdcwd_nolock(d,s,le)
+
+#define _CrtSetReportHook(f) ((_CRT_REPORT_HOOK)0)
+#define _CrtGetReportHook() ((_CRT_REPORT_HOOK)0)
+#define _CrtSetReportHook2(t,f) ((int)0)
+#define _CrtSetReportHookW2(t,f) ((int)0)
+#define _CrtSetReportMode(t,f) ((int)0)
+#define _CrtSetReportFile(t,f) ((_HFILE)0)
+
+#define _CrtDbgBreak() ((void)0)
+
+#define _CrtSetBreakAlloc(a) ((long)0)
+#define _CrtSetAllocHook(f) ((_CRT_ALLOC_HOOK)0)
+#define _CrtGetAllocHook() ((_CRT_ALLOC_HOOK)0)
+#define _CrtCheckMemory() ((int)1)
+#define _CrtSetDbgFlag(f) ((int)0)
+#define _CrtDoForAllClientObjects(f,c) ((void)0)
+#define _CrtIsValidPointer(p,n,r) ((int)1)
+#define _CrtIsValidHeapPointer(p) ((int)1)
+#define _CrtIsMemoryBlock(p,t,r,f,l) ((int)1)
+#define _CrtReportBlockType(p) ((int)-1)
+#define _CrtSetDumpClient(f) ((_CRT_DUMP_CLIENT)0)
+#define _CrtGetDumpClient() ((_CRT_DUMP_CLIENT)0)
+#define _CrtMemCheckpoint(s) ((void)0)
+#define _CrtMemDifference(s1,s2,s3) ((int)0)
+#define _CrtMemDumpAllObjectsSince(s) ((void)0)
+#define _CrtMemDumpStatistics(s) ((void)0)
+#define _CrtDumpMemoryLeaks() ((int)0)
+#define _CrtSetDebugFillThreshold(t) ((size_t)0)
+#define _CrtSetCheckCount(f) ((int)0)
+#define _CrtGetCheckCount() ((int)0)
+
+#ifdef __cplusplus
+}
+
+  void *__cdecl operator new[](size_t _Size);
+  inline void *__cdecl operator new(size_t _Size,int,const char *,int) { return ::operator new(_Size); }
+  inline void *__cdecl operator new[](size_t _Size,int,const char *,int) { return ::operator new[](_Size); }
+  void __cdecl operator delete[](void *);
+  inline void __cdecl operator delete(void *_P,int,const char *,int) { ::operator delete(_P); }
+  inline void __cdecl operator delete[](void *_P,int,const char *,int) { ::operator delete[](_P); }
+#endif
+
+#pragma pack(pop)
+
+#include <sec_api/crtdbg_s.h>
+
+#endif
diff --git a/reactos/include/crt/crtdefs.h b/reactos/include/crt/crtdefs.h
new file mode 100644 (file)
index 0000000..ceb864f
--- /dev/null
@@ -0,0 +1,6 @@
+/**
+ * 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>
diff --git a/reactos/include/crt/libgen.h b/reactos/include/crt/libgen.h
new file mode 100644 (file)
index 0000000..db89e1e
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef _LIBGEN_H_
+/* 
+ * libgen.h
+ *
+ * $Id: libgen.h,v 1.2 2007/06/23 07:34:15 dannysmith Exp $
+ *
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is a part of the mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within the package.
+ *
+ * Functions for splitting pathnames into dirname and basename components.
+ *
+ */
+#define _LIBGEN_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern __cdecl __MINGW_NOTHROW char *basename (char *);
+extern __cdecl __MINGW_NOTHROW char *dirname  (char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LIBGEN_H_: end of file */
+
diff --git a/reactos/include/crt/stdarg.h b/reactos/include/crt/stdarg.h
new file mode 100644 (file)
index 0000000..4e6490b
--- /dev/null
@@ -0,0 +1,153 @@
+/* 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>
+ */
+
+#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.  */
+
+#ifndef __GNUC_VA_LIST
+#define __GNUC_VA_LIST
+typedef __builtin_va_list __gnuc_va_list;
+#endif
+
+/* Define the standard macros for the user,
+   if this invocation was from the user program.  */
+#ifdef _STDARG_H
+
+#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)
+
+/* 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
+
+#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 */
+
+/* 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__
+#endif
+
+#endif /* not _VA_LIST_, except on certain systems */
+
+#endif /* not __svr4__ */
+
+#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
+#ifndef va_arg
+#define va_arg _crt_va_arg
+#endif
+#ifndef va_end
+#define va_end _crt_va_end
+#endif
+
+#endif
diff --git a/reactos/include/crt/stddef.h b/reactos/include/crt/stddef.h
new file mode 100644 (file)
index 0000000..162a3ba
--- /dev/null
@@ -0,0 +1,398 @@
+/**
+ * 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>
+
+#ifndef _INC_STDDEF
+#define _INC_STDDEF
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _CRT_ERRNO_DEFINED
+#define _CRT_ERRNO_DEFINED
+  _CRTIMP extern int *__cdecl _errno(void);
+#define errno (*_errno())
+  errno_t __cdecl _set_errno(int _Value);
+  errno_t __cdecl _get_errno(int *_Value);
+#endif
+
+  _CRTIMP extern unsigned long __cdecl __threadid(void);
+#define _threadid (__threadid())
+  _CRTIMP extern uintptr_t __cdecl __threadhandle(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/*
+ * ISO C Standard:  7.17  Common definitions  <stddef.h>
+ */
+#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
+     && !defined(__STDDEF_H__)) \
+    || defined(__need_wchar_t) || defined(__need_size_t) \
+    || defined(__need_ptrdiff_t) || defined(__need_NULL) \
+    || defined(__need_wint_t)
+
+/* Any one of these symbols __need_* means that GNU libc
+   wants us just to define one data type.  So don't define
+   the symbols that indicate this file's entire job has been done.  */
+#if (!defined(__need_wchar_t) && !defined(__need_size_t)       \
+     && !defined(__need_ptrdiff_t) && !defined(__need_NULL)    \
+     && !defined(__need_wint_t))
+#define _STDDEF_H
+#define _STDDEF_H_
+/* snaroff@next.com says the NeXT needs this.  */
+#define _ANSI_STDDEF_H
+/* Irix 5.1 needs this.  */
+#define __STDDEF_H__
+#endif
+
+#ifndef __sys_stdtypes_h
+/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
+   defined if the corresponding type is *not* defined.
+   FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
+#define _SIZE_T
+#endif
+#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
+#define _PTRDIFF_T
+#endif
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+   instead of _WCHAR_T_. */
+#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
+#ifndef _BSD_WCHAR_T_
+#define _WCHAR_T
+#endif
+#endif
+/* Undef _FOO_T_ if we are supposed to define foo_t.  */
+#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#if defined (__need_size_t) || defined (_STDDEF_H_)
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#if defined (__need_wchar_t) || defined (_STDDEF_H_)
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */
+
+/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
+   Just ignore it.  */
+#if defined (__sequent__) && defined (_PTRDIFF_T_)
+#undef _PTRDIFF_T_
+#endif
+
+/* On VxWorks, <type/vxTypesBase.h> may have defined macros like
+   _TYPE_size_t which will typedef size_t.  fixincludes patched the
+   vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
+   not defined, and so that defining this macro defines _GCC_SIZE_T.
+   If we find that the macros are still defined at this point, we must
+   invoke them so that the type is defined as expected.  */
+#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
+_TYPE_ptrdiff_t;
+#undef _TYPE_ptrdiff_t
+#endif
+#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
+_TYPE_size_t;
+#undef _TYPE_size_t
+#endif
+#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
+_TYPE_wchar_t;
+#undef _TYPE_wchar_t
+#endif
+
+/* In case nobody has defined these types, but we aren't running under
+   GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
+   __WCHAR_TYPE__ have reasonable values.  This can happen if the
+   parts of GCC is compiled by an older compiler, that actually
+   include gstddef.h, such as collect2.  */
+
+/* Signed type of difference of two pointers.  */
+
+/* Define this type if we are doing the whole job,
+   or if we want this type in particular.  */
+#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
+#ifndef _PTRDIFF_T     /* in case <sys/types.h> has defined it. */
+#ifndef _T_PTRDIFF_
+#ifndef _T_PTRDIFF
+#ifndef __PTRDIFF_T
+#ifndef _PTRDIFF_T_
+#ifndef _BSD_PTRDIFF_T_
+#ifndef ___int_ptrdiff_t_h
+#ifndef _GCC_PTRDIFF_T
+#define _PTRDIFF_T
+#define _T_PTRDIFF_
+#define _T_PTRDIFF
+#define __PTRDIFF_T
+#define _PTRDIFF_T_
+#define _BSD_PTRDIFF_T_
+#define ___int_ptrdiff_t_h
+#define _GCC_PTRDIFF_T
+#ifndef __PTRDIFF_TYPE__
+# ifdef _WIN64
+  #define __PTRDIFF_TYPE__ long long int
+# else
+# #define __PTRDIFF_TYPE__ long int
+# endif  
+#endif
+#ifndef _PTRDIFF_T_DEFINED
+#define _PTRDIFF_T_DEFINED
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#endif
+#endif /* _GCC_PTRDIFF_T */
+#endif /* ___int_ptrdiff_t_h */
+#endif /* _BSD_PTRDIFF_T_ */
+#endif /* _PTRDIFF_T_ */
+#endif /* __PTRDIFF_T */
+#endif /* _T_PTRDIFF */
+#endif /* _T_PTRDIFF_ */
+#endif /* _PTRDIFF_T */
+
+/* If this symbol has done its job, get rid of it.  */
+#undef __need_ptrdiff_t
+
+#endif /* _STDDEF_H or __need_ptrdiff_t.  */
+
+/* Unsigned type of `sizeof' something.  */
+
+/* Define this type if we are doing the whole job,
+   or if we want this type in particular.  */
+#if defined (_STDDEF_H) || defined (__need_size_t)
+#ifndef __size_t__     /* BeOS */
+#ifndef __SIZE_T__     /* Cray Unicos/Mk */
+#ifndef _SIZE_T        /* in case <sys/types.h> has defined it. */
+#ifndef _SYS_SIZE_T_H
+#ifndef _T_SIZE_
+#ifndef _T_SIZE
+#ifndef __SIZE_T
+#ifndef _SIZE_T_
+#ifndef _BSD_SIZE_T_
+#ifndef _SIZE_T_DEFINED_
+#ifndef _SIZE_T_DEFINED
+#ifndef _BSD_SIZE_T_DEFINED_   /* Darwin */
+#ifndef _SIZE_T_DECLARED       /* FreeBSD 5 */
+#ifndef ___int_size_t_h
+#ifndef _GCC_SIZE_T
+#ifndef _SIZET_
+#ifndef __size_t
+#define __size_t__     /* BeOS */
+#define __SIZE_T__     /* Cray Unicos/Mk */
+#define _SIZE_T
+#define _SYS_SIZE_T_H
+#define _T_SIZE_
+#define _T_SIZE
+#define __SIZE_T
+#define _SIZE_T_
+#define _BSD_SIZE_T_
+#define _SIZE_T_DEFINED_
+#define _SIZE_T_DEFINED
+#define _BSD_SIZE_T_DEFINED_   /* Darwin */
+#define _SIZE_T_DECLARED       /* FreeBSD 5 */
+#define ___int_size_t_h
+#define _GCC_SIZE_T
+#define _SIZET_
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+/* __size_t is a typedef on FreeBSD 5!, must not trash it. */
+#else
+#define __size_t
+#endif
+#ifndef __SIZE_TYPE__
+# ifdef _WIN64
+#  define __SIZE_TYPE__ long long unsigned int
+# else
+#  define __SIZE_TYPE__ long unsigned int
+# endif
+#endif
+#if !(defined (__GNUG__) && defined (size_t))
+typedef __SIZE_TYPE__ size_t;
+#ifdef __BEOS__
+typedef long ssize_t;
+#endif /* __BEOS__ */
+#endif /* !(defined (__GNUG__) && defined (size_t)) */
+#endif /* __size_t */
+#endif /* _SIZET_ */
+#endif /* _GCC_SIZE_T */
+#endif /* ___int_size_t_h */
+#endif /* _SIZE_T_DECLARED */
+#endif /* _BSD_SIZE_T_DEFINED_ */
+#endif /* _SIZE_T_DEFINED */
+#endif /* _SIZE_T_DEFINED_ */
+#endif /* _BSD_SIZE_T_ */
+#endif /* _SIZE_T_ */
+#endif /* __SIZE_T */
+#endif /* _T_SIZE */
+#endif /* _T_SIZE_ */
+#endif /* _SYS_SIZE_T_H */
+#endif /* _SIZE_T */
+#endif /* __SIZE_T__ */
+#endif /* __size_t__ */
+#undef __need_size_t
+#endif /* _STDDEF_H or __need_size_t.  */
+
+
+/* Wide character type.
+   Locale-writers should change this as necessary to
+   be big enough to hold unique values not between 0 and 127,
+   and not (wchar_t) -1, for each defined multibyte character.  */
+
+/* Define this type if we are doing the whole job,
+   or if we want this type in particular.  */
+#if defined (_STDDEF_H) || defined (__need_wchar_t)
+#ifndef __wchar_t__    /* BeOS */
+#ifndef __WCHAR_T__    /* Cray Unicos/Mk */
+#ifndef _WCHAR_T
+#ifndef _T_WCHAR_
+#ifndef _T_WCHAR
+#ifndef __WCHAR_T
+#ifndef _WCHAR_T_
+#ifndef _BSD_WCHAR_T_
+#ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
+#ifndef _BSD_RUNE_T_DEFINED_   /* Darwin */
+#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
+#ifndef _WCHAR_T_DEFINED_
+#ifndef _WCHAR_T_DEFINED
+#ifndef _WCHAR_T_H
+#ifndef ___int_wchar_t_h
+#ifndef __INT_WCHAR_T_H
+#ifndef _GCC_WCHAR_T
+#define __wchar_t__    /* BeOS */
+#define __WCHAR_T__    /* Cray Unicos/Mk */
+#define _WCHAR_T
+#define _T_WCHAR_
+#define _T_WCHAR
+#define __WCHAR_T
+#define _WCHAR_T_
+#define _BSD_WCHAR_T_
+#define _WCHAR_T_DEFINED_
+#define _WCHAR_T_DEFINED
+#define _WCHAR_T_H
+#define ___int_wchar_t_h
+#define __INT_WCHAR_T_H
+#define _GCC_WCHAR_T
+#define _WCHAR_T_DECLARED
+
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+   instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+   symbols in the _FOO_T_ family, stays defined even after its
+   corresponding type is defined).  If we define wchar_t, then we
+   must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
+   we undef _WCHAR_T_, then we must also define rune_t, since 
+   headers like runetype.h assume that if machine/ansi.h is included,
+   and _BSD_WCHAR_T_ is not defined, then rune_t is available.
+   machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
+   the same type." */
+#ifdef _BSD_WCHAR_T_
+#undef _BSD_WCHAR_T_
+#ifdef _BSD_RUNE_T_
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+typedef _BSD_RUNE_T_ rune_t;
+#define _BSD_WCHAR_T_DEFINED_
+#define _BSD_RUNE_T_DEFINED_   /* Darwin */
+#if defined (__FreeBSD__) && (__FreeBSD__ < 5)
+/* Why is this file so hard to maintain properly?  In contrast to
+   the comment above regarding BSD/386 1.1, on FreeBSD for as long
+   as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
+   redundant typedefs will occur when stdlib.h is included after this file. */
+#undef _BSD_RUNE_T_
+#endif
+#endif
+#endif
+#endif
+
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ unsigned short
+#endif
+#ifndef __cplusplus
+typedef __WCHAR_TYPE__ wchar_t;
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif /* _WCHAR_T_DECLARED */
+#endif /* _BSD_RUNE_T_DEFINED_ */
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif /* __WCHAR_T__ */
+#endif /* __wchar_t__ */
+#undef __need_wchar_t
+#endif /* _STDDEF_H or __need_wchar_t.  */
+
+/*  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
+    are already defined.  */
+/*  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.  */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+/*  The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
+    are probably typos and should be removed before 2.8 is released.  */
+#ifdef _GCC_PTRDIFF_T_
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T_
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T_
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+/*  The following ones are the real ones.  */
+#ifdef _GCC_PTRDIFF_T
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */
+
+#endif /* __sys_stdtypes_h */
+
+/* A null pointer constant.  */
+
+#if defined (_STDDEF_H) || defined (__need_NULL)
+#undef NULL            /* in case <stdio.h> has defined it. */
+#ifdef __GNUG__
+#define NULL __null
+#else   /* G++ */
+#ifndef __cplusplus
+#define NULL ((void *)0)
+#else   /* C++ */
+#define NULL 0
+#endif  /* C++ */
+#endif  /* G++ */
+#endif /* NULL not defined and <stddef.h> or need NULL.  */
+#undef __need_NULL
+
+#ifndef offsetof
+
+/* Offset of member MEMBER in a struct of type TYPE. */
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+
+#endif /* !offsetof */
+
+#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
+         || __need_XXX was not defined before */
diff --git a/reactos/include/crt/vadefs.h b/reactos/include/crt/vadefs.h
new file mode 100644 (file)
index 0000000..eae1a2e
--- /dev/null
@@ -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.
+ */
+#ifndef _INC_VADEFS
+#define _INC_VADEFS
+
+#ifndef _WIN32
+#error Only Win32 target is supported!
+#endif
+
+#include <_mingw.h>
+
+#undef _CRT_PACKING
+#define _CRT_PACKING 8
+#pragma pack(push,_CRT_PACKING)
+
+#ifdef __cplusplus
+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
+  typedef unsigned __int64 uintptr_t;
+#endif
+#else
+  typedef unsigned long uintptr_t;
+#endif
+#endif
+#endif
+
+#ifndef __GNUC_VA_LIST
+#define __GNUC_VA_LIST
+  typedef __builtin_va_list __gnuc_va_list;
+#endif
+
+#ifndef _VA_LIST_DEFINED
+#define _VA_LIST_DEFINED
+  typedef __gnuc_va_list va_list;
+#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
+
+#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)
+
+#define _INTSIZEOF(n) ((sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1))
+
+#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)
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack(pop)
+#endif