https://git.reactos.org/?p=reactos.git;a=commitdiff;h=82faa151e52e235dc0beb…
commit 82faa151e52e235dc0bebea2ecd49ef6b46847ad
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sun Sep 30 23:57:08 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Sep 30 23:57:08 2018 +0100
[XDK][PSDK][WINE] Unify ARRAY_SIZE definition for Wine modules. CORE-15127
---
dll/directx/wine/d3d9/d3d9_private.h | 2 --
dll/directx/wine/d3dx9_36/d3dx9_private.h | 2 --
dll/directx/wine/ddraw/ddraw_private.h | 2 --
dll/win32/avifil32/avifile_private.h | 2 --
dll/win32/comctl32/comctl32.h | 2 --
dll/win32/comdlg32/cdlg.h | 2 --
dll/win32/gdiplus/gdiplus_private.h | 2 --
dll/win32/msi/tokenize.c | 2 --
dll/win32/msxml3/msxml_private.h | 2 --
dll/win32/scrrun/scrrun_private.h | 2 --
dll/win32/wshom.ocx/wshom_private.h | 2 --
dll/win32/xmllite/xmllite_private.h | 2 --
sdk/include/xdk/winnt_old.h | 4 ++++
13 files changed, 4 insertions(+), 24 deletions(-)
diff --git a/dll/directx/wine/d3d9/d3d9_private.h b/dll/directx/wine/d3d9/d3d9_private.h
index c50aabf593..408661306a 100644
--- a/dll/directx/wine/d3d9/d3d9_private.h
+++ b/dll/directx/wine/d3d9/d3d9_private.h
@@ -47,8 +47,6 @@
#define D3D9_TEXTURE_MIPMAP_DIRTY 0x1
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
extern const struct wined3d_parent_ops d3d9_null_wined3d_parent_ops DECLSPEC_HIDDEN;
HRESULT vdecl_convert_fvf(DWORD FVF, D3DVERTEXELEMENT9 **ppVertexElements)
DECLSPEC_HIDDEN;
diff --git a/dll/directx/wine/d3dx9_36/d3dx9_private.h
b/dll/directx/wine/d3dx9_36/d3dx9_private.h
index f5b2b4109c..7a4d882a8b 100644
--- a/dll/directx/wine/d3dx9_36/d3dx9_private.h
+++ b/dll/directx/wine/d3dx9_36/d3dx9_private.h
@@ -32,8 +32,6 @@
#define ULONG64_MAX (~(ULONG64)0)
-#define ARRAY_SIZE(array) (sizeof(array)/sizeof(*array))
-
struct vec4
{
float x, y, z, w;
diff --git a/dll/directx/wine/ddraw/ddraw_private.h
b/dll/directx/wine/ddraw/ddraw_private.h
index 9757008e92..1bba80cf26 100644
--- a/dll/directx/wine/ddraw/ddraw_private.h
+++ b/dll/directx/wine/ddraw/ddraw_private.h
@@ -39,8 +39,6 @@
#include "wine/list.h"
#include "wine/wined3d.h"
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
extern const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops DECLSPEC_HIDDEN;
extern DWORD force_refresh_rate DECLSPEC_HIDDEN;
diff --git a/dll/win32/avifil32/avifile_private.h b/dll/win32/avifil32/avifile_private.h
index 83e87ea989..4bf11f42a8 100644
--- a/dll/win32/avifil32/avifile_private.h
+++ b/dll/win32/avifil32/avifile_private.h
@@ -22,8 +22,6 @@
#include <windef.h>
#include <winuser.h>
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
#ifndef MAX_AVISTREAMS
#define MAX_AVISTREAMS 8
#endif
diff --git a/dll/win32/comctl32/comctl32.h b/dll/win32/comctl32/comctl32.h
index c529a96bb1..ee47772658 100644
--- a/dll/win32/comctl32/comctl32.h
+++ b/dll/win32/comctl32/comctl32.h
@@ -38,8 +38,6 @@
extern HMODULE COMCTL32_hModule DECLSPEC_HIDDEN;
extern HBRUSH COMCTL32_hPattern55AABrush DECLSPEC_HIDDEN;
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
/* Property sheet / Wizard */
#define IDD_PROPSHEET 1006
#define IDD_WIZARD 1020
diff --git a/dll/win32/comdlg32/cdlg.h b/dll/win32/comdlg32/cdlg.h
index eebf1a9b2b..28bb7e7526 100644
--- a/dll/win32/comdlg32/cdlg.h
+++ b/dll/win32/comdlg32/cdlg.h
@@ -23,8 +23,6 @@
#include "dlgs.h"
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
/* Common dialogs implementation globals */
#define COMDLG32_Atom MAKEINTATOM(0xa000) /* MS uses this one to identify props */
diff --git a/dll/win32/gdiplus/gdiplus_private.h b/dll/win32/gdiplus/gdiplus_private.h
index 25b269ba35..b2e4f1e93f 100644
--- a/dll/win32/gdiplus/gdiplus_private.h
+++ b/dll/win32/gdiplus/gdiplus_private.h
@@ -35,8 +35,6 @@
#include "gdiplus.h"
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
#define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER)
#define MAX_ARC_PTS (13)
#define MAX_DASHLEN (16) /* this is a limitation of gdi */
diff --git a/dll/win32/msi/tokenize.c b/dll/win32/msi/tokenize.c
index 1656fd8c3d..d1c2da9743 100644
--- a/dll/win32/msi/tokenize.c
+++ b/dll/win32/msi/tokenize.c
@@ -77,8 +77,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/msxml3/msxml_private.h b/dll/win32/msxml3/msxml_private.h
index d7039275ce..94ef66b23d 100644
--- a/dll/win32/msxml3/msxml_private.h
+++ b/dll/win32/msxml3/msxml_private.h
@@ -31,8 +31,6 @@
# error You must include config.h to use this header
#endif
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
typedef enum {
MSXML_DEFAULT = 0,
MSXML2 = 20,
diff --git a/dll/win32/scrrun/scrrun_private.h b/dll/win32/scrrun/scrrun_private.h
index d9ff2416a5..5083d30a8e 100644
--- a/dll/win32/scrrun/scrrun_private.h
+++ b/dll/win32/scrrun/scrrun_private.h
@@ -18,8 +18,6 @@
#ifndef _SCRRUN_PRIVATE_H_
#define _SCRRUN_PRIVATE_H_
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
extern HRESULT WINAPI FileSystem_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**)
DECLSPEC_HIDDEN;
extern HRESULT WINAPI Dictionary_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**)
DECLSPEC_HIDDEN;
diff --git a/dll/win32/wshom.ocx/wshom_private.h b/dll/win32/wshom.ocx/wshom_private.h
index a3fa3b0f88..951599fbdb 100644
--- a/dll/win32/wshom.ocx/wshom_private.h
+++ b/dll/win32/wshom.ocx/wshom_private.h
@@ -27,8 +27,6 @@
#include "ole2.h"
#include "olectl.h"
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
/* typelibs */
typedef enum tid_t {
NULL_tid,
diff --git a/dll/win32/xmllite/xmllite_private.h b/dll/win32/xmllite/xmllite_private.h
index 381dec496c..7884e27453 100644
--- a/dll/win32/xmllite/xmllite_private.h
+++ b/dll/win32/xmllite/xmllite_private.h
@@ -23,8 +23,6 @@
#include "wine/heap.h"
-#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
-
static inline void *m_alloc(IMalloc *imalloc, size_t len)
{
if (imalloc)
diff --git a/sdk/include/xdk/winnt_old.h b/sdk/include/xdk/winnt_old.h
index 59076df80d..07c811837f 100644
--- a/sdk/include/xdk/winnt_old.h
+++ b/sdk/include/xdk/winnt_old.h
@@ -4308,6 +4308,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