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 +#elif defined(__dietlibc__) #include #else #include @@ -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 #include #include +#include +#include #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" {