diff --git a/SConscript b/SConscript index 693a03662..da4d53e64 100755 --- a/SConscript +++ b/SConscript @@ -267,12 +267,7 @@ sources+=Glob("src/gui/*/*.cpp") sources+=Glob("src/simulation/elements/*.cpp") sources+=Glob("src/simulation/tools/*.cpp") sources+=Glob("src/client/requestbroker/*.cpp") -sources+=["src/socket/auxiliar.c","src/socket/buffer.c","src/socket/except.c","src/socket/inet.c","src/socket/io.c","src/socket/luasocket.c","src/socket/options.c","src/socket/select.c","src/socket/tcp.c","src/socket/timeout.c","src/socket/udp.c"] -# looks better than lambdaing files out later -if(GetOption('win')): - sources+=["src/socket/wsocket.c"] -else: - sources+=["src/socket/usocket.c","src/socket/unix.c"] +sources+=Glob("src/socket/*.c") #for source in sources: # print str(source) diff --git a/src/socket/unix.c b/src/socket/unix.c index 158d319a5..048630f19 100644 --- a/src/socket/unix.c +++ b/src/socket/unix.c @@ -1,3 +1,4 @@ +#ifndef WIN /*=========================================================================*\ * Unix domain socket * LuaSocket toolkit @@ -354,3 +355,4 @@ static int global_create(lua_State *L) { return 2; } } +#endif diff --git a/src/socket/unix.h b/src/socket/unix.h index 32b7380ff..f3b543e06 100644 --- a/src/socket/unix.h +++ b/src/socket/unix.h @@ -1,3 +1,4 @@ +#ifndef WIN #ifndef UNIX_H #define UNIX_H /*=========================================================================*\ @@ -26,3 +27,4 @@ typedef t_unix *p_unix; int luaopen_socket_unix(lua_State *L); #endif /* UNIX_H */ +#endif diff --git a/src/socket/usocket.c b/src/socket/usocket.c index 70c6e1e39..f206cad6b 100644 --- a/src/socket/usocket.c +++ b/src/socket/usocket.c @@ -1,3 +1,4 @@ +#ifndef WIN /*=========================================================================*\ * Socket compatibilization module for Unix * LuaSocket toolkit @@ -368,3 +369,4 @@ const char *socket_ioerror(p_socket ps, int err) { (void) ps; return socket_strerror(err); } +#endif diff --git a/src/socket/usocket.h b/src/socket/usocket.h index f2a89aa0d..918c6643b 100644 --- a/src/socket/usocket.h +++ b/src/socket/usocket.h @@ -1,3 +1,4 @@ +#ifndef WIN #ifndef USOCKET_H #define USOCKET_H /*=========================================================================*\ @@ -38,3 +39,4 @@ typedef t_socket *p_socket; #define SOCKET_INVALID (-1) #endif /* USOCKET_H */ +#endif diff --git a/src/socket/wsocket.c b/src/socket/wsocket.c index 602256518..037f43a37 100644 --- a/src/socket/wsocket.c +++ b/src/socket/wsocket.c @@ -1,3 +1,4 @@ +#ifdef WIN /*=========================================================================*\ * Socket compatibilization module for Win32 * LuaSocket toolkit @@ -399,3 +400,4 @@ static const char *wstrerror(int err) { default: return "Unknown error"; } } +#endif diff --git a/src/socket/wsocket.h b/src/socket/wsocket.h index b53668368..963742fe7 100644 --- a/src/socket/wsocket.h +++ b/src/socket/wsocket.h @@ -1,3 +1,4 @@ +#ifdef WIN #ifndef WSOCKET_H #define WSOCKET_H /*=========================================================================*\ @@ -19,3 +20,4 @@ typedef t_socket *p_socket; #define SOCKET_INVALID (INVALID_SOCKET) #endif /* WSOCKET_H */ +#endif