DWORD dwVal = 0;
szBuff[0] = '\0';
- GetLocaleInfoW(lcid, dwFlags, szBuff, sizeof(szBuff) / sizeof(WCHAR));
+ GetLocaleInfoW(lcid, dwFlags, szBuff, ARRAY_SIZE(szBuff));
if (szBuff[0] && szBuff[1] == ';' && szBuff[2] != '0')
dwVal = (szBuff[0] - '0') * 10 + (szBuff[2] - '0');
DWORD dwLen;
szBuff[0] = '\0';
- GetLocaleInfoW(lcid, dwFlags, szBuff, sizeof(szBuff) / sizeof(WCHAR));
+ GetLocaleInfoW(lcid, dwFlags, szBuff, ARRAY_SIZE(szBuff));
dwLen = strlenW(szBuff) + 1;
str = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
if (str)
GET_LOCALE_STRING(new_node->cyfmt.lpCurrencySymbol, LOCALE_SCURRENCY);
/* Date/Time Format info, negative character, etc */
- for (i = 0; i < sizeof(NLS_LocaleIndices)/sizeof(NLS_LocaleIndices[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(NLS_LocaleIndices); i++)
{
GET_LOCALE_STRING(new_node->lppszStrings[i], NLS_LocaleIndices[i]);
}
/* We raced and lost: The node was already added by another thread.
* node points to the currently cached node, so free new_node.
*/
- for (i = 0; i < sizeof(NLS_LocaleIndices)/sizeof(NLS_LocaleIndices[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(NLS_LocaleIndices); i++)
HeapFree(GetProcessHeap(), 0, new_node->lppszStrings[i]);
HeapFree(GetProcessHeap(), 0, new_node->fmt.lpDecimalSep);
HeapFree(GetProcessHeap(), 0, new_node->fmt.lpThousandSep);
{
static const WCHAR fmtW[] = {'%','.','*','d',0};
/* We have a numeric value to add */
- snprintfW(buff, sizeof(buff)/sizeof(WCHAR), fmtW, count, dwVal);
+ snprintfW(buff, ARRAY_SIZE(buff), fmtW, count, dwVal);
}
dwLen = szAdd ? strlenW(szAdd) : 0;
}
if (lpFormat)
- MultiByteToWideChar(cp, 0, lpFormat, -1, szFormat, sizeof(szFormat)/sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, lpFormat, -1, szFormat, ARRAY_SIZE(szFormat));
- if (cchOut > (int)(sizeof(szOut)/sizeof(WCHAR)))
- cchOut = sizeof(szOut)/sizeof(WCHAR);
+ if (cchOut > (int) ARRAY_SIZE(szOut))
+ cchOut = ARRAY_SIZE(szOut);
szOut[0] = '\0';
lpFormat, lpDateStr, cchOut);
}
-#ifndef __REACTOS__
+#if _WIN32_WINNT >= 0x600
/******************************************************************************
* GetDateFormatEx [KERNEL32.@]
*
flags | DATE_DATEVARSONLY, date, format,
outbuf, bufsize);
}
-#endif /* !__REACTOS__ */
+#endif /* _WIN32_WINNT >= 0x600 */
/******************************************************************************
* GetDateFormatW [KERNEL32.@]
lpFormat, lpTimeStr, cchOut);
}
-#ifndef __REACTOS__
+#if _WIN32_WINNT >= 0x600
/******************************************************************************
* GetTimeFormatEx [KERNEL32.@]
*
flags | TIME_TIMEVARSONLY, time, format,
outbuf, bufsize);
}
-#endif /* !__REACTOS__ */
+#endif /* _WIN32_WINNT >= 0x600 */
/******************************************************************************
* GetTimeFormatW [KERNEL32.@]
pfmt = &fmt;
if (lpFormat->lpDecimalSep)
{
- MultiByteToWideChar(cp, 0, lpFormat->lpDecimalSep, -1, szDec, sizeof(szDec)/sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, lpFormat->lpDecimalSep, -1, szDec, ARRAY_SIZE(szDec));
fmt.lpDecimalSep = szDec;
}
if (lpFormat->lpThousandSep)
{
- MultiByteToWideChar(cp, 0, lpFormat->lpThousandSep, -1, szGrp, sizeof(szGrp)/sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, lpFormat->lpThousandSep, -1, szGrp, ARRAY_SIZE(szGrp));
fmt.lpThousandSep = szGrp;
}
}
if (lpszValue)
- MultiByteToWideChar(cp, 0, lpszValue, -1, szIn, sizeof(szIn)/sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, lpszValue, -1, szIn, ARRAY_SIZE(szIn));
- if (cchOut > (int)(sizeof(szOut)/sizeof(WCHAR)))
- cchOut = sizeof(szOut)/sizeof(WCHAR);
+ if (cchOut > (int) ARRAY_SIZE(szOut))
+ cchOut = ARRAY_SIZE(szOut);
szOut[0] = '\0';
LPCWSTR lpszValue, const NUMBERFMTW *lpFormat,
LPWSTR lpNumberStr, int cchOut)
{
- WCHAR szBuff[128], *szOut = szBuff + sizeof(szBuff) / sizeof(WCHAR) - 1;
+ WCHAR szBuff[128], *szOut = szBuff + ARRAY_SIZE(szBuff) - 1;
WCHAR szNegBuff[8];
const WCHAR *lpszNeg = NULL, *lpszNegStart, *szSrc;
DWORD dwState = 0, dwDecimals = 0, dwGroupCount = 0, dwCurrentGroupCount = 0;
else
{
GetLocaleInfoW(lcid, LOCALE_SNEGATIVESIGN|(dwFlags & LOCALE_NOUSEROVERRIDE),
- szNegBuff, sizeof(szNegBuff)/sizeof(WCHAR));
+ szNegBuff, ARRAY_SIZE(szNegBuff));
lpszNegStart = lpszNeg = szNegBuff;
}
lpszNeg = lpszNeg + strlenW(lpszNeg) - 1;
return 0;
}
-#ifndef __REACTOS__
+#if _WIN32_WINNT >= 0x600
/**************************************************************************
* GetNumberFormatEx (KERNEL32.@)
*/
return GetNumberFormatW(lcid, flags, value, format, number, numout);
}
-#endif /* !__REACTOS__ */
+#endif /* _WIN32_WINNT >= 0x600 */
/**************************************************************************
* GetCurrencyFormatA (KERNEL32.@)
pfmt = &fmt;
if (lpFormat->lpDecimalSep)
{
- MultiByteToWideChar(cp, 0, lpFormat->lpDecimalSep, -1, szDec, sizeof(szDec)/sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, lpFormat->lpDecimalSep, -1, szDec, ARRAY_SIZE(szDec));
fmt.lpDecimalSep = szDec;
}
if (lpFormat->lpThousandSep)
{
- MultiByteToWideChar(cp, 0, lpFormat->lpThousandSep, -1, szGrp, sizeof(szGrp)/sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, lpFormat->lpThousandSep, -1, szGrp, ARRAY_SIZE(szGrp));
fmt.lpThousandSep = szGrp;
}
if (lpFormat->lpCurrencySymbol)
{
- MultiByteToWideChar(cp, 0, lpFormat->lpCurrencySymbol, -1, szCy, sizeof(szCy)/sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, lpFormat->lpCurrencySymbol, -1, szCy, ARRAY_SIZE(szCy));
fmt.lpCurrencySymbol = szCy;
}
}
if (lpszValue)
- MultiByteToWideChar(cp, 0, lpszValue, -1, szIn, sizeof(szIn)/sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, lpszValue, -1, szIn, ARRAY_SIZE(szIn));
- if (cchOut > (int)(sizeof(szOut)/sizeof(WCHAR)))
- cchOut = sizeof(szOut)/sizeof(WCHAR);
+ if (cchOut > (int) ARRAY_SIZE(szOut))
+ cchOut = ARRAY_SIZE(szOut);
szOut[0] = '\0';
CF_CY_LEFT|CF_CY_SPACE, /* $ 1.1 */
CF_CY_RIGHT|CF_CY_SPACE, /* 1.1 $ */
};
- WCHAR szBuff[128], *szOut = szBuff + sizeof(szBuff) / sizeof(WCHAR) - 1;
+ WCHAR szBuff[128], *szOut = szBuff + ARRAY_SIZE(szBuff) - 1;
WCHAR szNegBuff[8];
const WCHAR *lpszNeg = NULL, *lpszNegStart, *szSrc, *lpszCy, *lpszCyStart;
DWORD dwState = 0, dwDecimals = 0, dwGroupCount = 0, dwCurrentGroupCount = 0, dwFmt;
else
{
GetLocaleInfoW(lcid, LOCALE_SNEGATIVESIGN|(dwFlags & LOCALE_NOUSEROVERRIDE),
- szNegBuff, sizeof(szNegBuff)/sizeof(WCHAR));
+ szNegBuff, ARRAY_SIZE(szNegBuff));
lpszNegStart = lpszNeg = szNegBuff;
}
dwFlags &= (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP);
return 0;
}
+#if _WIN32_WINNT >= 0x600
+/***********************************************************************
+ * GetCurrencyFormatEx (KERNEL32.@)
+ */
+int WINAPI GetCurrencyFormatEx(LPCWSTR localename, DWORD flags, LPCWSTR value,
+ const CURRENCYFMTW *format, LPWSTR str, int len)
+{
+ TRACE("(%s,0x%08x,%s,%p,%p,%d)\n", debugstr_w(localename), flags,
+ debugstr_w(value), format, str, len);
+
+ return GetCurrencyFormatW( LocaleNameToLCID(localename, 0), flags, value, format, str, len);
+}
+#endif
+
+
/* FIXME: Everything below here needs to move somewhere else along with the
* other EnumXXX functions, when a method for storing resources for
* alternate calendars is determined.
lctype |= ctxt->flags & LOCALE_USE_CP_ACP;
if (ctxt->unicode)
- ret = GetLocaleInfoW(ctxt->lcid, lctype, bufW, sizeof(bufW)/sizeof(bufW[0]));
+ ret = GetLocaleInfoW(ctxt->lcid, lctype, bufW, ARRAY_SIZE(bufW));
else
- ret = GetLocaleInfoA(ctxt->lcid, lctype, bufA, sizeof(bufA)/sizeof(bufA[0]));
+ ret = GetLocaleInfoA(ctxt->lcid, lctype, bufA, ARRAY_SIZE(bufA));
if (ret)
{
return NLS_EnumDateFormats(&ctxt);
}
-#ifndef __REACTOS__
+#if _WIN32_WINNT >= 0x600
/**************************************************************************
* EnumDateFormatsExEx (KERNEL32.@)
*/
return NLS_EnumDateFormats(&ctxt);
}
-#endif /* !__REACTOS__ */
+#endif /* _WIN32_WINNT >= 0x600 */
struct enumtimeformats_context {
enum enum_callback_type type; /* callback kind */
lctype |= ctxt->flags & LOCALE_USE_CP_ACP;
if (ctxt->unicode)
- ret = GetLocaleInfoW(ctxt->lcid, lctype, bufW, sizeof(bufW)/sizeof(bufW[0]));
+ ret = GetLocaleInfoW(ctxt->lcid, lctype, bufW, ARRAY_SIZE(bufW));
else
- ret = GetLocaleInfoA(ctxt->lcid, lctype, bufA, sizeof(bufA)/sizeof(bufA[0]));
+ ret = GetLocaleInfoA(ctxt->lcid, lctype, bufA, ARRAY_SIZE(bufA));
if (ret)
{
return NLS_EnumTimeFormats(&ctxt);
}
-#ifndef __REACTOS__
+#if _WIN32_WINNT >= 0x600
/**************************************************************************
* EnumTimeFormatsEx (KERNEL32.@)
*/
return NLS_EnumTimeFormats(&ctxt);
}
-#endif /* !__REACTOS__ */
+#endif /* _WIN32_WINNT >= 0x600 */
struct enumcalendar_context {
enum enum_callback_type type; /* callback kind */
return NLS_EnumCalendarInfo(&ctxt);
}
-#ifndef __REACTOS__
+#if _WIN32_WINNT >= 0x600
/******************************************************************************
* EnumCalendarInfoExEx [KERNEL32.@]
*/
ctxt.unicode = TRUE;
return NLS_EnumCalendarInfo(&ctxt);
}
-#endif /* !__REACTOS__ */
+#endif /* _WIN32_WINNT >= 0x600 */
/*********************************************************************
* GetCalendarInfoA (KERNEL32.@)
return 0;
}
+#if _WIN32_WINNT >= 0x600
+/*********************************************************************
+ * GetCalendarInfoEx (KERNEL32.@)
+ */
+int WINAPI GetCalendarInfoEx(LPCWSTR locale, CALID calendar, LPCWSTR lpReserved, CALTYPE caltype,
+ LPWSTR data, int len, DWORD *value)
+{
+ static int once;
+
+ LCID lcid = LocaleNameToLCID(locale, 0);
+ if (!once++)
+ FIXME("(%s, %d, %p, 0x%08x, %p, %d, %p): semi-stub\n", debugstr_w(locale), calendar, lpReserved, caltype,
+ data, len, value);
+ return GetCalendarInfoW(lcid, calendar, caltype, data, len, value);
+}
+#endif
+
/*********************************************************************
* SetCalendarInfoA (KERNEL32.@)
*