From 4bacb3f24e3919d93330e82e25a1ba88a2aabd59 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Fri, 11 Mar 2011 18:22:23 +0100 Subject: [PATCH] wininet: Avoid a conflict with the sun macro when compiling on Solaris. --- dlls/wininet/http.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index a0574bf77db..5ae3e4d592c 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3582,21 +3582,18 @@ static void HTTP_InsertCookies(http_request_t *request) static WORD HTTP_ParseDay(LPCWSTR day) { - static const WCHAR sun[] = { 's','u','n',0 }; - static const WCHAR mon[] = { 'm','o','n',0 }; - static const WCHAR tue[] = { 't','u','e',0 }; - static const WCHAR wed[] = { 'w','e','d',0 }; - static const WCHAR thu[] = { 't','h','u',0 }; - static const WCHAR fri[] = { 'f','r','i',0 }; - static const WCHAR sat[] = { 's','a','t',0 }; + static const WCHAR days[7][4] = {{ 's','u','n',0 }, + { 'm','o','n',0 }, + { 't','u','e',0 }, + { 'w','e','d',0 }, + { 't','h','u',0 }, + { 'f','r','i',0 }, + { 's','a','t',0 }}; + int i; + for (i = 0; i < sizeof(days)/sizeof(*days); i++) + if (!strcmpiW(day, days[i])) + return i; - if (!strcmpiW(day, sun)) return 0; - if (!strcmpiW(day, mon)) return 1; - if (!strcmpiW(day, tue)) return 2; - if (!strcmpiW(day, wed)) return 3; - if (!strcmpiW(day, thu)) return 4; - if (!strcmpiW(day, fri)) return 5; - if (!strcmpiW(day, sat)) return 6; /* Invalid */ return 7; }