Author: tkreuzer Date: Sun Jun 1 21:47:51 2014 New Revision: 63530
URL: http://svn.reactos.org/svn/reactos?rev=63530&view=rev Log: [INCLUDE] - Move definition of va_list to crtdefs.h - Remove useless definitions from vadefs.h - Cleanup the mess in stdarg.h - Add memmove prototype to intrin_x86.h, since it's used there - basetyps.h: guard STDMETHODCALLTYPE & friends from redefinition - guiddef.h: define FAR, include string.h - ntdef.h: don't include stdarg.h and string anymore, enable STRICT, remove FAR, add STDMETHODCALLTYPE & friends
Modified: trunk/reactos/include/crt/crtdefs.h trunk/reactos/include/crt/mingw32/intrin_x86.h trunk/reactos/include/crt/stdarg.h trunk/reactos/include/crt/vadefs.h trunk/reactos/include/psdk/basetyps.h trunk/reactos/include/psdk/guiddef.h trunk/reactos/include/psdk/ntdef.h
Modified: trunk/reactos/include/crt/crtdefs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=6... ============================================================================== --- trunk/reactos/include/crt/crtdefs.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/crtdefs.h [iso-8859-1] Sun Jun 1 21:47:51 2014 @@ -20,6 +20,10 @@ #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__ @@ -28,10 +32,6 @@
/** Properties ***************************************************************/ - -#undef _CRT_PACKING -#define _CRT_PACKING 8 -#pragma pack(push,_CRT_PACKING)
#ifndef _CRT_STRINGIZE #define __CRT_STRINGIZE(_Value) #_Value @@ -325,6 +325,22 @@ #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
Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin_... ============================================================================== --- trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Sun Jun 1 21:47:51 2014 @@ -70,6 +70,7 @@ #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);
Modified: trunk/reactos/include/crt/stdarg.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/stdarg.h?rev=63... ============================================================================== --- trunk/reactos/include/crt/stdarg.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/stdarg.h [iso-8859-1] Sun Jun 1 21:47:51 2014 @@ -28,123 +28,17 @@ * 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 _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 */ - -/* 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 /* __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
Modified: trunk/reactos/include/crt/vadefs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/vadefs.h?rev=63... ============================================================================== --- trunk/reactos/include/crt/vadefs.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/vadefs.h [iso-8859-1] Sun Jun 1 21:47:51 2014 @@ -18,39 +18,6 @@
#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 - __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
Modified: trunk/reactos/include/psdk/basetyps.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/basetyps.h?rev... ============================================================================== --- trunk/reactos/include/psdk/basetyps.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/basetyps.h [iso-8859-1] Sun Jun 1 21:47:51 2014 @@ -33,6 +33,7 @@ # endif #endif
+#ifndef STDMETHODCALLTYPE #define STDMETHODCALLTYPE __stdcall #define STDMETHODVCALLTYPE __cdecl #define STDAPICALLTYPE __stdcall @@ -45,6 +46,7 @@ #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
Modified: trunk/reactos/include/psdk/guiddef.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/guiddef.h?rev=... ============================================================================== --- trunk/reactos/include/psdk/guiddef.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/guiddef.h [iso-8859-1] Sun Jun 1 21:47:51 2014 @@ -18,6 +18,7 @@
#ifndef GUID_DEFINED #define GUID_DEFINED + typedef struct _GUID { #ifdef _MSC_VER @@ -29,6 +30,10 @@ unsigned short Data3; unsigned char Data4[ 8 ]; } GUID; +#endif + +#ifndef FAR +#define FAR #endif
#ifndef DECLSPEC_SELECTANY @@ -109,6 +114,8 @@ #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) @@ -131,6 +138,7 @@ #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>
Modified: trunk/reactos/include/psdk/ntdef.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdef.h?rev=63... ============================================================================== --- trunk/reactos/include/psdk/ntdef.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntdef.h [iso-8859-1] Sun Jun 1 21:47:51 2014 @@ -31,10 +31,6 @@ #include <specstrings.h> #include <kernelspecs.h>
-// FIXME: Shouldn't be included! -#include <stdarg.h> -#include <string.h> - #ifdef __cplusplus extern "C" { #endif @@ -42,7 +38,7 @@ /* Default to strict */ #ifndef NO_STRICT #ifndef STRICT -//#define STRICT 1 // FIXME: disabled for now +#define STRICT 1 #endif #endif
@@ -66,11 +62,6 @@
#ifndef CRITICAL #define CRITICAL -#endif - -// FIXME: deprecated -#ifndef FAR -#define FAR #endif
/* Constant modifier */ @@ -96,12 +87,6 @@ /* Defines the "size" of an any-size array */ #ifndef ANYSIZE_ARRAY #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. */ @@ -232,6 +217,12 @@ #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 @@ -242,6 +233,30 @@ #endif
#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 */