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 @@
1#include <stdio.h>1#include <stdio.h>
2 2
3#if defined(_WIN32)
4#include <fcntl.h>
5#endif
6
3/* Define architecture */7/* Define architecture */
4#if defined(__i386__) || defined _M_IX868#if defined(__i386__) || defined _M_IX86
5# define TRIPLET_ARCH "i386"9# define TRIPLET_ARCH "i386"
@@ -49,6 +53,9 @@ int _CRT_glob = 0; · 43 unmodified lines
49 53
50int main(int argc, char *argv[])54int main(int argc, char *argv[])
51{55{
56#if defined(_WIN32)
57 _setmode(_fileno(stdout), _O_BINARY); /* don't translate \n to \r\n */
58#endif
52 switch(argc == 2 ? argv[1][0] : 0) {59 switch(argc == 2 ? argv[1][0] : 0) {
53 case 'b':60 case 'b':
54 {61 {

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