mirror of https://github.com/YosysHQ/icestorm.git
Fix piping on windows
On windows stdin and stdout have to be set to binary as otherwise windows treats it as text and converts occurences of CRLF to LF
This commit is contained in:
parent
792cef084a
commit
26a40d0e11
|
|
@ -35,6 +35,11 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h> /* _setmode() */
|
||||
#include <fcntl.h> /* _O_BINARY */
|
||||
#endif
|
||||
|
||||
#include "mpsse.h"
|
||||
|
||||
static bool verbose = false;
|
||||
|
|
@ -523,6 +528,11 @@ int main(int argc, char **argv)
|
|||
const char *devstr = NULL;
|
||||
int ifnum = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
_setmode(_fileno(stdin), _O_BINARY);
|
||||
_setmode(_fileno(stdout), _O_BINARY);
|
||||
#endif
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"help", no_argument, NULL, -2},
|
||||
{NULL, 0, NULL, 0}
|
||||
|
|
|
|||
Loading…
Reference in New Issue