[0.4.7][XDK][PSDK][WINE] Unify ARRAY_SIZE definition for Wine modules. CORE-15127
authorJoachim Henze <Joachim.Henze@reactos.org>
Mon, 14 Mar 2022 08:50:32 +0000 (09:50 +0100)
committerJoachim Henze <Joachim.Henze@reactos.org>
Mon, 14 Mar 2022 08:51:00 +0000 (09:51 +0100)
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

dll/directx/wine/d3dx9_36/d3dx9_36_private.h
dll/win32/msi/tokenize.c
dll/win32/xmllite/writer.c
sdk/include/xdk/winnt_old.h

index 72b1c9d..c5b089f 100644 (file)
@@ -48,8 +48,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
 
 #define ULONG64_MAX (~(ULONG64)0)
 
 
 #define ULONG64_MAX (~(ULONG64)0)
 
-#define ARRAY_SIZE(array) (sizeof(array)/sizeof(*array))
-
 struct vec4
 {
     float x, y, z, w;
 struct vec4
 {
     float x, y, z, w;
index 52dd3df..2c23071 100644 (file)
@@ -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'};
 
 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
 /*
 ** These are the keywords
 ** They MUST be in alphabetical order
index c4570a5..95f352b 100644 (file)
@@ -27,8 +27,6 @@
 /* not defined in public headers */
 DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a);
 
 /* 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[] = {'?','>'};
 static const WCHAR closeelementW[] = {'<','/'};
 static const WCHAR closetagW[] = {' ','/','>'};
 static const WCHAR closepiW[] = {'?','>'};
index f994f6b..254883e 100644 (file)
@@ -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) */
 
 } 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
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif