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.
Unified · Split
| @@ -1,5 +1,9 @@ | ||
| 1 | 1 | #include <stdio.h> |
| 2 | 2 | |
| 3 | +#if defined(_WIN32) | |
| 4 | +#include <fcntl.h> | |
| 5 | +#endif | |
| 6 | + | |
| 3 | 7 | /* Define architecture */ |
| 4 | 8 | #if defined(__i386__) || defined _M_IX86 |
| 5 | 9 | # define TRIPLET_ARCH "i386" |
| @@ -49,6 +53,9 @@ int _CRT_glob = 0; · 43 unmodified lines | ||
| 49 | 53 | |
| 50 | 54 | int 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 | 59 | switch(argc == 2 ? argv[1][0] : 0) { |
| 53 | 60 | case 'b': |
| 54 | 61 | { |