add #ifdef WIN / #idndef WIN around some lua socket files, for easier visual studio compatibility
This commit is contained in:
parent
73fe68a3eb
commit
a4e75d587f
@ -267,12 +267,7 @@ sources+=Glob("src/gui/*/*.cpp")
|
|||||||
sources+=Glob("src/simulation/elements/*.cpp")
|
sources+=Glob("src/simulation/elements/*.cpp")
|
||||||
sources+=Glob("src/simulation/tools/*.cpp")
|
sources+=Glob("src/simulation/tools/*.cpp")
|
||||||
sources+=Glob("src/client/requestbroker/*.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"]
|
sources+=Glob("src/socket/*.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"]
|
|
||||||
|
|
||||||
#for source in sources:
|
#for source in sources:
|
||||||
# print str(source)
|
# print str(source)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifndef WIN
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
* Unix domain socket
|
* Unix domain socket
|
||||||
* LuaSocket toolkit
|
* LuaSocket toolkit
|
||||||
@ -354,3 +355,4 @@ static int global_create(lua_State *L) {
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifndef WIN
|
||||||
#ifndef UNIX_H
|
#ifndef UNIX_H
|
||||||
#define UNIX_H
|
#define UNIX_H
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
@ -26,3 +27,4 @@ typedef t_unix *p_unix;
|
|||||||
int luaopen_socket_unix(lua_State *L);
|
int luaopen_socket_unix(lua_State *L);
|
||||||
|
|
||||||
#endif /* UNIX_H */
|
#endif /* UNIX_H */
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifndef WIN
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
* Socket compatibilization module for Unix
|
* Socket compatibilization module for Unix
|
||||||
* LuaSocket toolkit
|
* LuaSocket toolkit
|
||||||
@ -368,3 +369,4 @@ const char *socket_ioerror(p_socket ps, int err) {
|
|||||||
(void) ps;
|
(void) ps;
|
||||||
return socket_strerror(err);
|
return socket_strerror(err);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifndef WIN
|
||||||
#ifndef USOCKET_H
|
#ifndef USOCKET_H
|
||||||
#define USOCKET_H
|
#define USOCKET_H
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
@ -38,3 +39,4 @@ typedef t_socket *p_socket;
|
|||||||
#define SOCKET_INVALID (-1)
|
#define SOCKET_INVALID (-1)
|
||||||
|
|
||||||
#endif /* USOCKET_H */
|
#endif /* USOCKET_H */
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef WIN
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
* Socket compatibilization module for Win32
|
* Socket compatibilization module for Win32
|
||||||
* LuaSocket toolkit
|
* LuaSocket toolkit
|
||||||
@ -399,3 +400,4 @@ static const char *wstrerror(int err) {
|
|||||||
default: return "Unknown error";
|
default: return "Unknown error";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#ifdef WIN
|
||||||
#ifndef WSOCKET_H
|
#ifndef WSOCKET_H
|
||||||
#define WSOCKET_H
|
#define WSOCKET_H
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
@ -19,3 +20,4 @@ typedef t_socket *p_socket;
|
|||||||
#define SOCKET_INVALID (INVALID_SOCKET)
|
#define SOCKET_INVALID (INVALID_SOCKET)
|
||||||
|
|
||||||
#endif /* WSOCKET_H */
|
#endif /* WSOCKET_H */
|
||||||
|
#endif
|
||||||
|
Reference in New Issue
Block a user