Re: [PATCH] fix building for Windows

LIU Hao <[email protected]>
Newsgroups gmane.editors.nano.devel
Message-ID <[email protected]>
在 3/1/22 18:08, Benno Schulenberg 写道:
> 
> Op 26-02-2022 om 08:15 schreef Mike Frysinger:
>> Fix building with x86_64-w64-mingw32 to cross-compile native Windows
>> programs.  Need to:
>> * add checks for missing functions
>> * don't use signals that are unavailable on the platform
>> * avoid useless non-Linux sys/ioctl.h include
>> * use putenv instead of setenv as the latter is unavailable
>> ---

I am glad to see that there are finally efforts to add Windows support. Although this patch may make 
nano compile for *-w64-mingw32 targets, it is not complete yet [1]:

1) The MSVCRT `open()` function opens files in text by default and may
    result in `"\r\r\n"` if nano is told to save text in DOS format. The
    `_O_BINARY` flag has to specified.

2) The Gnulib `glob()` function does not recognize backslashes as path
    separators. It is suggested that users use forwardslashes in config
    files, but replacing them inside nano should be preferred.

3) The path for the active console device is `"CONIN$"` instead of
    `"/dev/tty"`.

4) Bracketed-paste mode should be disabled for native Windows.


But after all, thanks for your work!



[1] https://github.com/lhmouse/nano-win/commit/f0a8e7931f4f80d24c8c7e8732ed692b461dd2bf



-- 
Best regards,
LIU Hao
OpenPGP_signature (application/pgp-signature, 840 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.