From: Joachim Henze Date: Mon, 14 Mar 2022 08:50:32 +0000 (+0100) Subject: [0.4.7][XDK][PSDK][WINE] Unify ARRAY_SIZE definition for Wine modules. CORE-15127 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=df2ae760d194b1e94d0ae67513720a6038155502 [0.4.7][XDK][PSDK][WINE] Unify ARRAY_SIZE definition for Wine modules. CORE-15127 I need this for the following commits to be able to fix more compiler warnings without having to introduce additional diff for better code from newer branches, that also uses this macro. The older the branch, the less of duplication we have for this macro. picked from 0.4.11-dev-258-g 82faa151e52e235dc0bebea2ecd49ef6b46847ad --- diff --git a/dll/directx/wine/d3dx9_36/d3dx9_36_private.h b/dll/directx/wine/d3dx9_36/d3dx9_36_private.h index 72b1c9d38df..c5b089fdc61 100644 --- a/dll/directx/wine/d3dx9_36/d3dx9_36_private.h +++ b/dll/directx/wine/d3dx9_36/d3dx9_36_private.h @@ -48,8 +48,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); #define ULONG64_MAX (~(ULONG64)0) -#define ARRAY_SIZE(array) (sizeof(array)/sizeof(*array)) - struct vec4 { float x, y, z, w; diff --git a/dll/win32/msi/tokenize.c b/dll/win32/msi/tokenize.c index 52dd3dffde1..2c2307151de 100644 --- a/dll/win32/msi/tokenize.c +++ b/dll/win32/msi/tokenize.c @@ -70,8 +70,6 @@ static const WCHAR updateW[] = {'U','P','D','A','T','E'}; static const WCHAR valuesW[] = {'V','A','L','U','E','S'}; static const WCHAR whereW[] = {'W','H','E','R','E'}; -#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0])) - /* ** These are the keywords ** They MUST be in alphabetical order diff --git a/dll/win32/xmllite/writer.c b/dll/win32/xmllite/writer.c index c4570a5801b..95f352b59ec 100644 --- a/dll/win32/xmllite/writer.c +++ b/dll/win32/xmllite/writer.c @@ -27,8 +27,6 @@ /* not defined in public headers */ DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a); -#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0])) - static const WCHAR closeelementW[] = {'<','/'}; static const WCHAR closetagW[] = {' ','/','>'}; static const WCHAR closepiW[] = {'?','>'}; diff --git a/sdk/include/xdk/winnt_old.h b/sdk/include/xdk/winnt_old.h index f994f6bc6ac..254883e33f3 100644 --- a/sdk/include/xdk/winnt_old.h +++ b/sdk/include/xdk/winnt_old.h @@ -4227,6 +4227,10 @@ typedef struct _TP_CALLBACK_ENVIRON_V1 { } TP_CALLBACK_ENVIRON_V1, TP_CALLBACK_ENVIRON, *PTP_CALLBACK_ENVIRON; #endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN7) */ +#ifdef __WINESRC__ +# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif + #ifdef _MSC_VER #pragma warning(pop) #endif