+2020-05-27 Bruno Haible <bruno@clisp.org>
+
+ Don't assume that UNICODE is not defined.
+ Some Windows types, such as TCHAR, LPTSTR, LPCTSTR, are defined
+ differently if the application defines the macro UNICODE.
+ Reported by Steve Lhomme <robux4@ycbcr.xyz> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00184.html>.
+ * lib/link.c (CreateHardLinkFuncType): Use LPCSTR, not LPCTSTR.
+ * lib/localename.c (enum_locales_fn): Use LPSTR, not LPTSTR.
+ * lib/stat-w32.c (GetFinalPathNameByHandleFuncType): Likewise.
+
2020-05-27 Bruno Haible <bruno@clisp.org>
Improve pattern for defining _WIN32_WINNT.
(void *) GetProcAddress
/* CreateHardLink was introduced only in Windows 2000. */
-typedef BOOL (WINAPI * CreateHardLinkFuncType) (LPCTSTR lpFileName,
- LPCTSTR lpExistingFileName,
+typedef BOOL (WINAPI * CreateHardLinkFuncType) (LPCSTR lpFileName,
+ LPCSTR lpExistingFileName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes);
static CreateHardLinkFuncType CreateHardLinkFunc = NULL;
static BOOL initialized = FALSE;
/* Callback function for EnumLocales. */
static BOOL CALLBACK
-enum_locales_fn (LPTSTR locale_num_str)
+enum_locales_fn (LPSTR locale_num_str)
{
char *endp;
char locval[2 * LOCALE_NAME_MAX_LENGTH + 1 + 1];
#endif
/* GetFinalPathNameByHandle was introduced only in Windows Vista. */
typedef DWORD (WINAPI * GetFinalPathNameByHandleFuncType) (HANDLE hFile,
- LPTSTR lpFilePath,
+ LPSTR lpFilePath,
DWORD lenFilePath,
DWORD dwFlags);
static GetFinalPathNameByHandleFuncType GetFinalPathNameByHandleFunc = NULL;