History

configure: conftest win32: don't translate LF to CRLF

This removes a spurious \r at $gcc_{major,minor} in configure on cygwin. Details: The EOL output of conftest.exe for windows was \r\n . Now it's only \n . The output of conftest is used with sh command substitutions which trim trailing newlines, but not all windows shells consider \r\n as newline. E.g. msys2 and busybox (for windows) were designed for tight integration with windows apps and their shells do trim \r\n, but cygwin sh is closer to POSIX and trims only \n - leaving \r at the string.

Avi Halachmi (:avih) committed 7 years ago

Commit a7eef331 parent 84779b21 file · +7 −0Browse files

Unified · Split

conftest.c+7−0
@@ -1,5 +1,9 @@
11 #include <stdio.h>
22
3+#if defined(_WIN32)
4+#include <fcntl.h>
5+#endif
6+
37 /* Define architecture */
48 #if defined(__i386__) || defined _M_IX86
59 # define TRIPLET_ARCH "i386"
@@ -49,6 +53,9 @@ int _CRT_glob = 0; · 43 unmodified lines
4953
5054 int main(int argc, char *argv[])
5155 {
56+#if defined(_WIN32)
57+ _setmode(_fileno(stdout), _O_BINARY); /* don't translate \n to \r\n */
58+#endif
5259 switch(argc == 2 ? argv[1][0] : 0) {
5360 case 'b':
5461 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t