summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix von Leitner <felix-libowfat@fefe.de>2019-02-21 12:24:05 +0000
committerFelix von Leitner <felix-libowfat@fefe.de>2019-02-21 12:24:05 +0000
commit43983c9b5299fac5001eaa10e13f6f3b8cfa82fa (patch)
tree94cbbf518bae01708709b79fbe69996e24a8a1e6
parent0a753734d341646ac5c64531e9b4d34d7bca1ff3 (diff)
downloadlibowfat-43983c9b5299fac5001eaa10e13f6f3b8cfa82fa.tar.gz
libowfat-43983c9b5299fac5001eaa10e13f6f3b8cfa82fa.zip
BSD build fix (hopefully)
move more #include to <libowfat/...>
-rw-r--r--GNUmakefile5
-rw-r--r--io.h6
-rw-r--r--io/iom_init.c2
-rw-r--r--io_internal.h6
-rw-r--r--iob.h4
5 files changed, 15 insertions, 8 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 3f3193d..8c600d1 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -18,6 +18,9 @@ all: headers ent $(LIBS) libowfat.a libsocket t
pic pie:
$(MAKE) CC="gcc -fPIC" LDFLAGS="-fpie"
+picx32 piex32:
+ $(MAKE) CC="gcc -mx32 -fPIC" LDFLAGS="-fpie"
+
CROSS=
#CROSS=i686-mingw-
CC?=gcc
@@ -192,7 +195,7 @@ t.o: t.c fmt.h scan.h str.h uint16.h uint32.h stralloc.h socket.h \
havesigio.h CAS.h
t: t.o libowfat.a libsocket
- $(DIET) $(CCC) -g -o $@ t.o libowfat.a `cat libsocket` -lpthread
+ $(DIET) $(CCC) -g -o $@ t.o libowfat.a `cat libsocket` -lpthread $(LDFLAGS)
.PHONY: all clean tar install rename
clean:
diff --git a/io.h b/io.h
index 14b96f4..02b2dc7 100644
--- a/io.h
+++ b/io.h
@@ -144,7 +144,9 @@ int64 io_mmapwritefile(int64 out,int64 in,uint64 off,uint64 bytes,io_write_callb
* aid in debugging the state machine if a descriptor loops or so */
unsigned int io_debugstring(int64 s,char* buf,unsigned int bufsize);
-#ifdef __dietlibc__
+#ifdef __MINGW32__
+#include <mcfgthread/c11thread.h>
+#elif defined(__dietlibc__)
#include <threads.h>
#else
#include <pthread.h>
@@ -159,7 +161,7 @@ typedef struct iomux {
struct {
int fd, events;
} q[SLOTS];
-#ifdef __dietlibc__
+#if defined(__MINGW32__) || defined(__dietlibc__)
mtx_t mtx;
cnd_t sem;
#else
diff --git a/io/iom_init.c b/io/iom_init.c
index 769af8b..0904901 100644
--- a/io/iom_init.c
+++ b/io/iom_init.c
@@ -6,6 +6,8 @@
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
#endif
int iom_init(iomux_t* c) {
diff --git a/io_internal.h b/io_internal.h
index 6d37c11..8b8c922 100644
--- a/io_internal.h
+++ b/io_internal.h
@@ -2,9 +2,9 @@
#define my_extern extern
#endif
-#include "io.h"
-#include "array.h"
-#include "iarray.h"
+#include "libowfat/io.h"
+#include "libowfat/array.h"
+#include "libowfat/iarray.h"
#ifdef __MINGW32__
#include "socket.h"
my_extern HANDLE io_comport;
diff --git a/iob.h b/iob.h
index 0d7014b..2dcff21 100644
--- a/iob.h
+++ b/iob.h
@@ -13,8 +13,8 @@
* frames as possible. On Linux it will also use the TCP_CORK socket
* option. */
-#include "io.h"
-#include "array.h"
+#include "libowfat/io.h"
+#include "libowfat/array.h"
#ifdef __cplusplus
extern "C" {