aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c15
-rw-r--r--src/w32proc.c16
2 files changed, 19 insertions, 12 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index abfa315e2a9..499450f4c92 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7799,6 +7799,11 @@ The following %-sequences are provided:
7799 7799
7800 7800
7801#ifdef WINDOWSNT 7801#ifdef WINDOWSNT
7802typedef BOOL (WINAPI *GetDiskFreeSpaceExW_Proc)
7803 (LPCWSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);
7804typedef BOOL (WINAPI *GetDiskFreeSpaceExA_Proc)
7805 (LPCSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);
7806
7802DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0, 7807DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0,
7803 doc: /* Return storage information about the file system FILENAME is on. 7808 doc: /* Return storage information about the file system FILENAME is on.
7804Value is a list of floats (TOTAL FREE AVAIL), where TOTAL is the total 7809Value is a list of floats (TOTAL FREE AVAIL), where TOTAL is the total
@@ -7822,12 +7827,10 @@ If the underlying system call fails, value is nil. */)
7822 added rather late on. */ 7827 added rather late on. */
7823 { 7828 {
7824 HMODULE hKernel = GetModuleHandle ("kernel32"); 7829 HMODULE hKernel = GetModuleHandle ("kernel32");
7825 BOOL (WINAPI *pfn_GetDiskFreeSpaceExW) 7830 GetDiskFreeSpaceExW_Proc pfn_GetDiskFreeSpaceExW =
7826 (wchar_t *, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER) 7831 (GetDiskFreeSpaceExW_Proc) GetProcAddress (hKernel, "GetDiskFreeSpaceExW");
7827 = GetProcAddress (hKernel, "GetDiskFreeSpaceExW"); 7832 GetDiskFreeSpaceExA_Proc pfn_GetDiskFreeSpaceExA =
7828 BOOL (WINAPI *pfn_GetDiskFreeSpaceExA) 7833 (GetDiskFreeSpaceExA_Proc) GetProcAddress (hKernel, "GetDiskFreeSpaceExA");
7829 (char *, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER)
7830 = GetProcAddress (hKernel, "GetDiskFreeSpaceExA");
7831 bool have_pfn_GetDiskFreeSpaceEx = 7834 bool have_pfn_GetDiskFreeSpaceEx =
7832 ((w32_unicode_filenames && pfn_GetDiskFreeSpaceExW) 7835 ((w32_unicode_filenames && pfn_GetDiskFreeSpaceExW)
7833 || (!w32_unicode_filenames && pfn_GetDiskFreeSpaceExA)); 7836 || (!w32_unicode_filenames && pfn_GetDiskFreeSpaceExA));
diff --git a/src/w32proc.c b/src/w32proc.c
index ca4322b69d1..66a9761ad13 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -3327,16 +3327,16 @@ yield nil. */)
3327 (Lisp_Object cp) 3327 (Lisp_Object cp)
3328{ 3328{
3329 CHARSETINFO info; 3329 CHARSETINFO info;
3330 DWORD dwcp; 3330 DWORD_PTR dwcp;
3331 3331
3332 CHECK_NUMBER (cp); 3332 CHECK_NUMBER (cp);
3333 3333
3334 if (!IsValidCodePage (XINT (cp))) 3334 if (!IsValidCodePage (XINT (cp)))
3335 return Qnil; 3335 return Qnil;
3336 3336
3337 /* Going through a temporary DWORD variable avoids compiler warning 3337 /* Going through a temporary DWORD_PTR variable avoids compiler warning
3338 about cast to pointer from integer of different size, when 3338 about cast to pointer from integer of different size, when
3339 building --with-wide-int. */ 3339 building --with-wide-int or building for 64bit. */
3340 dwcp = XINT (cp); 3340 dwcp = XINT (cp);
3341 if (TranslateCharsetInfo ((DWORD *) dwcp, &info, TCI_SRCCODEPAGE)) 3341 if (TranslateCharsetInfo ((DWORD *) dwcp, &info, TCI_SRCCODEPAGE))
3342 return make_number (info.ciCharset); 3342 return make_number (info.ciCharset);
@@ -3499,6 +3499,9 @@ get_lcid (const char *locale_name)
3499# define LINGUISTIC_IGNORECASE 0x00000010 3499# define LINGUISTIC_IGNORECASE 0x00000010
3500#endif 3500#endif
3501 3501
3502typedef int (WINAPI *CompareStringW_Proc)
3503 (LCID, DWORD, LPCWSTR, int, LPCWSTR, int);
3504
3502int 3505int
3503w32_compare_strings (const char *s1, const char *s2, char *locname, 3506w32_compare_strings (const char *s1, const char *s2, char *locname,
3504 int ignore_case) 3507 int ignore_case)
@@ -3507,7 +3510,7 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
3507 wchar_t *string1_w, *string2_w; 3510 wchar_t *string1_w, *string2_w;
3508 int val, needed; 3511 int val, needed;
3509 extern BOOL g_b_init_compare_string_w; 3512 extern BOOL g_b_init_compare_string_w;
3510 static int (WINAPI *pCompareStringW)(LCID, DWORD, LPCWSTR, int, LPCWSTR, int); 3513 static CompareStringW_Proc pCompareStringW;
3511 DWORD flags = 0; 3514 DWORD flags = 0;
3512 3515
3513 USE_SAFE_ALLOCA; 3516 USE_SAFE_ALLOCA;
@@ -3523,8 +3526,9 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
3523 { 3526 {
3524 if (os_subtype == OS_9X) 3527 if (os_subtype == OS_9X)
3525 { 3528 {
3526 pCompareStringW = GetProcAddress (LoadLibrary ("Unicows.dll"), 3529 pCompareStringW =
3527 "CompareStringW"); 3530 (CompareStringW_Proc) GetProcAddress (LoadLibrary ("Unicows.dll"),
3531 "CompareStringW");
3528 if (!pCompareStringW) 3532 if (!pCompareStringW)
3529 { 3533 {
3530 errno = EINVAL; 3534 errno = EINVAL;