comparison src/syswindows.h @ 4867:7822019c5d98

Revert cast in check_writable() and fix up macros to use const.
author Vin Shelton <acs@xemacs.org>
date Sun, 17 Jan 2010 22:08:56 -0500
parents e1d8b6b0c589
children 99f2102552d7 8b63e21b0436
comparison
equal deleted inserted replaced
4865:6c0bb4d2c23a 4867:7822019c5d98
975 EXTERNAL_TO_C_STRING (ttlff_utf8_path, out, Qutf_8); \ 975 EXTERNAL_TO_C_STRING (ttlff_utf8_path, out, Qutf_8); \
976 } while (0) 976 } while (0)
977 #else /* not HAVE_CYGWIN_CONV_PATH */ 977 #else /* not HAVE_CYGWIN_CONV_PATH */
978 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ 978 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \
979 do { \ 979 do { \
980 Ibyte *lfftt; \ 980 const Ibyte *lfftt; \
981 \ 981 \
982 LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (path, lfftt); \ 982 LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (path, lfftt); \
983 PATHNAME_CONVERT_OUT_TSTR (lfftt, out); \ 983 PATHNAME_CONVERT_OUT_TSTR (lfftt, out); \
984 } while (0) 984 } while (0)
985 #define TSTR_TO_LOCAL_FILE_FORMAT(path, out) \ 985 #define TSTR_TO_LOCAL_FILE_FORMAT(path, out) \
986 do { \ 986 do { \
987 Ibyte *ttlff; \ 987 const Ibyte *ttlff; \
988 \ 988 \
989 TSTR_TO_C_STRING (path, ttlff); \ 989 TSTR_TO_C_STRING (path, ttlff); \
990 INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT (ttlff, out); \ 990 INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT (ttlff, out); \
991 } while (0) 991 } while (0)
992 #endif /* (not) HAVE_CYGWIN_CONV_PATH */ 992 #endif /* (not) HAVE_CYGWIN_CONV_PATH */
1010 format should avoid this by using LISP_LOCAL_FILE_FORMAT_TO_TSTR(). 1010 format should avoid this by using LISP_LOCAL_FILE_FORMAT_TO_TSTR().
1011 Same thing applies going the other direction. */ 1011 Same thing applies going the other direction. */
1012 #define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout) \ 1012 #define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout) \
1013 do \ 1013 do \
1014 { \ 1014 { \
1015 Extbyte *lfftiwp; \ 1015 const Extbyte *lfftiwp; \
1016 \ 1016 \
1017 LOCAL_FILE_FORMAT_TO_TSTR (path, lfftiwp); \ 1017 LOCAL_FILE_FORMAT_TO_TSTR (path, lfftiwp); \
1018 TSTR_TO_C_STRING (lfftiwp, pathout); \ 1018 TSTR_TO_C_STRING (lfftiwp, pathout); \
1019 } \ 1019 } \
1020 while (0) 1020 while (0)
1021 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \ 1021 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \
1022 do { \ 1022 do { \
1023 Extbyte *iwtlffp; \ 1023 const Extbyte *iwtlffp; \
1024 C_STRING_TO_TSTR (path, iwtlffp); \ 1024 C_STRING_TO_TSTR (path, iwtlffp); \
1025 TSTR_TO_LOCAL_FILE_FORMAT (iwtlffp, pathout); \ 1025 TSTR_TO_LOCAL_FILE_FORMAT (iwtlffp, pathout); \
1026 } while (0) 1026 } while (0)
1027 #elif defined (CYGWIN) 1027 #elif defined (CYGWIN)
1028 #define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout) \ 1028 #define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout) \
1032 with external-format data. But in point of fact, the Cygwin \ 1032 with external-format data. But in point of fact, the Cygwin \
1033 conversion functions are *NOT* localized, and will fail if they \ 1033 conversion functions are *NOT* localized, and will fail if they \
1034 get 7-bit ISO2022-encoded data. We know that our internal format \ 1034 get 7-bit ISO2022-encoded data. We know that our internal format \
1035 is ASCII-compatible, and so these functions will work fine with \ 1035 is ASCII-compatible, and so these functions will work fine with \
1036 this data. */ \ 1036 this data. */ \
1037 Ibyte *lfftiwp = (path); \ 1037 const Ibyte *lfftiwp = (path); \
1038 if (isalpha (lfftiwp[0]) && (IS_DEVICE_SEP (lfftiwp[1]))) \ 1038 if (isalpha (lfftiwp[0]) && (IS_DEVICE_SEP (lfftiwp[1]))) \
1039 pathout = lfftiwp; \ 1039 pathout = lfftiwp; \
1040 else \ 1040 else \
1041 { \ 1041 { \
1042 int lfftiw2 = \ 1042 int lfftiw2 = \
1045 cygwin_posix_to_win32_path_list ((char *) lfftiwp, (char *) pathout); \ 1045 cygwin_posix_to_win32_path_list ((char *) lfftiwp, (char *) pathout); \
1046 } \ 1046 } \
1047 } while (0) 1047 } while (0)
1048 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \ 1048 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \
1049 do { \ 1049 do { \
1050 Ibyte *wtlff1 = (path); \ 1050 const Ibyte *wtlff1 = (path); \
1051 int wtlff2 = \ 1051 int wtlff2 = \
1052 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \ 1052 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \
1053 Ibyte *wtlff3 = alloca_ibytes (wtlff2); \ 1053 Ibyte *wtlff3 = alloca_ibytes (wtlff2); \
1054 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \ 1054 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \
1055 (pathout) = wtlff3; \ 1055 (pathout) = wtlff3; \