Hi Gabriel, On 5/23/22 17:22, Gabriel Ivăncescu wrote:
Instead of hardcoding each event, since there will be plenty more.
What's an example of those missing ones?
Signed-off-by: Gabriel Ivăncescu<gabrielopcode(a)gmail.com> --- dlls/mshtml/xmlhttprequest.c | 47 +++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index b9f6f1f..baef36e 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -94,12 +94,23 @@ static HRESULT return_nscstr(nsresult nsres, nsACString *nscstr, BSTR *p) return S_OK; }
+#define EVENTS_LIST \ + X(readystatechange) \ + X(load) + +#undef X +#define X(event) EVENT_##event, +enum { EVENTS_LIST }; +#undef X +#define X(event) L"" #event, +static const WCHAR *events[] = { EVENTS_LIST }; +#undef X
You could avoid all those preprocessor directives by simply using an array of structs. Jacek