Mercurial > vim
comparison src/os_mswin.c @ 16606:7e733046db1d v8.1.1306
patch 8.1.1306: Borland support is outdated and doesn't work
commit https://github.com/vim/vim/commit/eae1b91fea74842000fc055afc74fe2e7934c6ee
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 9 15:12:55 2019 +0200
patch 8.1.1306: Borland support is outdated and doesn't work
Problem: Borland support is outdated and doesn't work.
Solution: Remove Borland support, there are other (free) compilers
available. (Thomas Dziedzic, Ken Takata, closes #4364)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 09 May 2019 15:15:07 +0200 |
parents | 7ae2396cef62 |
children | ef00b6bc186b |
comparison
equal
deleted
inserted
replaced
16605:50115650f6c7 | 16606:7e733046db1d |
---|---|
170 char temp [3] = "-:"; | 170 char temp [3] = "-:"; |
171 temp[0] = drive + 'A' - 1; | 171 temp[0] = drive + 'A' - 1; |
172 return !SetCurrentDirectory(temp); | 172 return !SetCurrentDirectory(temp); |
173 } | 173 } |
174 # endif | 174 # endif |
175 #else | |
176 # ifdef __BORLANDC__ | |
177 /* being a more ANSI compliant compiler, BorlandC doesn't define _stricoll: | |
178 * but it does in BC 5.02! */ | |
179 # if __BORLANDC__ < 0x502 | |
180 int _stricoll(char *a, char *b) | |
181 { | |
182 # if 1 | |
183 // this is fast but not correct: | |
184 return stricmp(a, b); | |
185 # else | |
186 // the ANSI-ish correct way is to use strxfrm(): | |
187 char a_buff[512], b_buff[512]; // file names, so this is enough on Win32 | |
188 strxfrm(a_buff, a, 512); | |
189 strxfrm(b_buff, b, 512); | |
190 return strcoll(a_buff, b_buff); | |
191 # endif | |
192 } | |
193 # endif | |
194 # endif | |
195 #endif | 175 #endif |
196 | 176 |
197 | 177 |
198 #ifndef PROTO | 178 #ifndef PROTO |
199 /* | 179 /* |
372 char_u *buf, | 352 char_u *buf, |
373 int len, | 353 int len, |
374 int force UNUSED) | 354 int force UNUSED) |
375 { | 355 { |
376 int nResult = FAIL; | 356 int nResult = FAIL; |
377 | 357 WCHAR *wname; |
378 #ifdef __BORLANDC__ | 358 WCHAR wbuf[MAX_PATH]; |
379 if (*fname == NUL) /* Borland behaves badly here - make it consistent */ | 359 char_u *cname = NULL; |
380 nResult = mch_dirname(buf, len); | 360 |
381 else | 361 wname = enc_to_utf16(fname, NULL); |
382 #endif | 362 if (wname != NULL && _wfullpath(wbuf, wname, MAX_PATH) != NULL) |
383 { | 363 { |
384 WCHAR *wname; | 364 cname = utf16_to_enc((short_u *)wbuf, NULL); |
385 WCHAR wbuf[MAX_PATH]; | 365 if (cname != NULL) |
386 char_u *cname = NULL; | |
387 | |
388 wname = enc_to_utf16(fname, NULL); | |
389 if (wname != NULL && _wfullpath(wbuf, wname, MAX_PATH) != NULL) | |
390 { | 366 { |
391 cname = utf16_to_enc((short_u *)wbuf, NULL); | 367 vim_strncpy(buf, cname, len - 1); |
392 if (cname != NULL) | 368 nResult = OK; |
393 { | |
394 vim_strncpy(buf, cname, len - 1); | |
395 nResult = OK; | |
396 } | |
397 } | 369 } |
398 vim_free(wname); | 370 } |
399 vim_free(cname); | 371 vim_free(wname); |
400 } | 372 vim_free(cname); |
401 | 373 |
402 #ifdef USE_FNAME_CASE | 374 #ifdef USE_FNAME_CASE |
403 fname_case(buf, len); | 375 fname_case(buf, len); |
404 #else | 376 #else |
405 slash_adjust(buf); | 377 slash_adjust(buf); |
2042 | 2014 |
2043 /* | 2015 /* |
2044 * Clean up on exit. This destroys the hidden message window. | 2016 * Clean up on exit. This destroys the hidden message window. |
2045 */ | 2017 */ |
2046 static void | 2018 static void |
2047 #ifdef __BORLANDC__ | |
2048 _RTLENTRYF | |
2049 #endif | |
2050 CleanUpMessaging(void) | 2019 CleanUpMessaging(void) |
2051 { | 2020 { |
2052 if (message_window != 0) | 2021 if (message_window != 0) |
2053 { | 2022 { |
2054 DestroyWindow(message_window); | 2023 DestroyWindow(message_window); |