projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* sim/ucsim/mkecho: inserted #!/bin/sh for Cygwin, so that it's executable
[fw/sdcc]
/
src
/
asm.c
diff --git
a/src/asm.c
b/src/asm.c
index 70dbacd922b2d1a192fcfdfd930c0e0b13e4ab29..b22d352e269232a584926633aa9f1c73e3133afe 100644
(file)
--- a/
src/asm.c
+++ b/
src/asm.c
@@
-9,9
+9,12
@@
#include "common.h"
#include "asm.h"
#include "common.h"
#include "asm.h"
-#if !defined(__BORLANDC__) && !defined(_MSC_VER)
-// for pipe and close
-#include <unistd.h>
+#if defined __MINGW32__
+ // for O_BINARY in _pipe()
+# include <fcntl.h>
+#elif !defined(__BORLANDC__) && !defined(_MSC_VER)
+ // for pipe and close
+# include <unistd.h>
#endif
/* A 'token' is like !blah or %24f and is under the programmers
#endif
/* A 'token' is like !blah or %24f and is under the programmers
@@
-220,7
+223,11
@@
char *printILine (iCode *ic) {
FILE *pipeStream;
iCodeTable *icTab=getTableEntry(ic->op);
FILE *pipeStream;
iCodeTable *icTab=getTableEntry(ic->op);
+#if defined __MINGW32__
+ assert(_pipe(filedes, 256, O_BINARY)!=-1); // forget it
+#else
assert(pipe(filedes)!=-1); // forget it
assert(pipe(filedes)!=-1); // forget it
+#endif
// stuff the pipe with the readable icode
pipeStream=fdopen(filedes[1],"w");
// stuff the pipe with the readable icode
pipeStream=fdopen(filedes[1],"w");