summaryrefslogtreecommitdiffstats
path: root/elf.c
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2019-11-08 22:05:27 +0100
committerJiri Gaisler <jiri@gaisler.se>2019-11-09 11:14:15 +0100
commit7a6e198454d04ac6bf5f2009b4f693696c27e5c1 (patch)
tree291c9f146e49f7b2efcf939b780d3314e9310888 /elf.c
parentRemove unused variable xcpu (diff)
downloadsis-7a6e198454d04ac6bf5f2009b4f693696c27e5c1.tar.bz2
Support building on MinGW-W64/MSYS22.19
* Depends on MinGW64-readline to build
Diffstat (limited to 'elf.c')
-rw-r--r--elf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/elf.c b/elf.c
index f0240dc..96db266 100644
--- a/elf.c
+++ b/elf.c
@@ -21,7 +21,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef WIN32
+#include <winsock.h>
+#else
#include <netinet/in.h>
+#endif
#include <elf.h>
#include <ctype.h>
#include "sis.h"
@@ -222,7 +226,7 @@ elf_load (char *fname, int load)
FILE *fp;
int res;
- if ((fp = fopen (fname, "r")) == NULL)
+ if ((fp = fopen (fname, "rb")) == NULL)
{
printf ("file not found\n");
return (-1);