add #ifdef WIN / #idndef WIN around some lua socket files, for easier visual studio compatibility

This commit is contained in:
jacob1 2013-05-04 19:19:23 -04:00
parent 73fe68a3eb
commit a4e75d587f
7 changed files with 13 additions and 6 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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