Fix Visual Studio 2012 projects
This commit is contained in:
parent
fbe184f28a
commit
26704061a4
10 changed files with 316 additions and 56 deletions
|
@ -502,7 +502,7 @@ const char *inet_trybind(p_socket ps, const char *address, const char *serv,
|
|||
* Some systems do not provide this so that we provide our own. It's not
|
||||
* marvelously fast, but it works just fine.
|
||||
\*-------------------------------------------------------------------------*/
|
||||
#ifdef INET_ATON
|
||||
#ifdef LUASOCKET_INET_ATON
|
||||
int inet_aton(const char *cp, struct in_addr *inp)
|
||||
{
|
||||
unsigned int a = 0, b = 0, c = 0, d = 0;
|
||||
|
@ -529,7 +529,7 @@ int inet_aton(const char *cp, struct in_addr *inp)
|
|||
* http://mingw-users.1079350.n2.nabble.com/IPv6-getaddrinfo-amp-inet-ntop-td5891996.html
|
||||
\*-------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef INET_PTON
|
||||
#ifdef LUASOCKET_INET_PTON
|
||||
const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt)
|
||||
{
|
||||
if (af == AF_INET) {
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
#include "timeout.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define INET_ATON
|
||||
#define INET_PTON
|
||||
#define LUASOCKET_INET_ATON
|
||||
#endif
|
||||
|
||||
int inet_open(lua_State *L);
|
||||
|
@ -39,11 +38,11 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family);
|
|||
int inet_optfamily(lua_State* L, int narg, const char* def);
|
||||
int inet_optsocktype(lua_State* L, int narg, const char* def);
|
||||
|
||||
#ifdef INET_ATON
|
||||
#ifdef LUASOCKET_INET_ATON
|
||||
int inet_aton(const char *cp, struct in_addr *inp);
|
||||
#endif
|
||||
|
||||
#ifdef INET_PTON
|
||||
#ifdef LUASOCKET_INET_PTON
|
||||
const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt);
|
||||
int inet_pton(int af, const char *src, void *dst);
|
||||
#endif
|
||||
|
|
39
src/makefile
39
src/makefile
|
@ -63,12 +63,13 @@ LDIR_mingw?=lua/$(LUAV)/lua
|
|||
# LUAINC_win32:
|
||||
# LUALIB_win32:
|
||||
# where lua headers and libraries are found for win32 builds
|
||||
LUAINC_win32?="../../lua-5.1.3/src"
|
||||
LUALIB_win32?=/LIBPATH:"../../lua-5.1.3" lua$(LUAV).lib
|
||||
|
||||
LUAINC_win32_base?=
|
||||
LUAINC_win32?=$(LUAINC_win32_base)/lua/$(LUAV)
|
||||
PLATFORM_win32?=Release
|
||||
LUAPREFIX_win32?=
|
||||
CDIR_win32?=lua/$(LUAV)
|
||||
LDIR_win32?=lua/$(LUAV)/lua
|
||||
CDIR_win32?=lua/$(LUAV)/$(PLATFORM_win32)
|
||||
LDIR_win32?=lua/$(LUAV)/$(PLATFORM_win32)/lua
|
||||
LUALIB_win32?=$(LUAPREFIX_win32)/lua/$(LUAV)/$(PLATFORM_win32)
|
||||
|
||||
# prefix: /usr/local /usr /opt/local /sw
|
||||
# the top of the default install tree
|
||||
|
@ -154,8 +155,8 @@ SOCKET_linux=usocket.o
|
|||
SO_mingw=dll
|
||||
O_mingw=o
|
||||
CC_mingw=gcc
|
||||
DEF_mingw= -DLUASOCKET_$(DEBUG) -DLUA_COMPAT_MODULE -DWINVER=0x0501 \
|
||||
-DLUASOCKET_API='__declspec(dllexport)' \
|
||||
DEF_mingw= -DLUASOCKET_INET_PTON -DLUASOCKET_$(DEBUG) -DLUA_COMPAT_MODULE \
|
||||
-DWINVER=0x0501 -DLUASOCKET_API='__declspec(dllexport)' \
|
||||
-DMIME_API='__declspec(dllexport)'
|
||||
CFLAGS_mingw= -I$(LUAINC) $(DEF) -pedantic -Wall -O2 -fno-common \
|
||||
-fvisibility=hidden
|
||||
|
@ -170,23 +171,25 @@ SOCKET_mingw=wsocket.o
|
|||
SO_win32=dll
|
||||
O_win32=obj
|
||||
CC_win32=cl
|
||||
DEF_win32= /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" \
|
||||
/D "LUASOCKET_API=__declspec(dllexport)" /D "_CRT_SECURE_NO_WARNINGS" \
|
||||
/D "_WINDLL" /D "LUA_COMPAT_MODULE" /D "MIME_API=__declspec(dllexport)" \
|
||||
/D "LUASOCKET_$(DEBUG)"
|
||||
CFLAGS_win32=/I "$(LUAINC)" $(DEF) /O2 /Ot /MD /W3 /nologo
|
||||
LDFLAGS_win32= /nologo /link /NOLOGO /DLL /INCREMENTAL:NO \
|
||||
/MANIFEST /MANIFESTFILE:"intermediate.manifest" \
|
||||
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" \
|
||||
/SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /DYNAMICBASE:NO \
|
||||
/MACHINE:X86 $(LUALIB) ws2_32.lib /OUT:
|
||||
DEF_win32= //D "WIN32" //D "NDEBUG" //D "_WINDOWS" //D "_USRDLL" \
|
||||
//D "LUASOCKET_API=__declspec(dllexport)" //D "_CRT_SECURE_NO_WARNINGS" \
|
||||
//D "_WINDLL" //D "LUA_COMPAT_MODULE" \
|
||||
//D "MIME_API=__declspec(dllexport)" \
|
||||
//D "LUASOCKET_$(DEBUG)"
|
||||
CFLAGS_win32=//I "$(LUAINC)" $(DEF) //O2 //Ot //MD //W3 //nologo
|
||||
LDFLAGS_win32= //nologo //link //NOLOGO //DLL //INCREMENTAL:NO \
|
||||
//MANIFEST //MANIFESTFILE:"intermediate.manifest" \
|
||||
//MANIFESTUAC:"level='asInvoker' uiAccess='false'" \
|
||||
//SUBSYSTEM:WINDOWS //OPT:REF //OPT:ICF //DYNAMICBASE:NO \
|
||||
//MACHINE:X86 /LIBPATH:"$(shell cmd //c echo $(LUALIB))" lua$(subst .,,$(LUAV)).lib \
|
||||
wsock32.lib ws2_32.lib //OUT:
|
||||
LD_win32=cl
|
||||
SOCKET_win32=wsocket.obj
|
||||
|
||||
.SUFFIXES: .obj
|
||||
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) /Fo"$@" /c $<
|
||||
$(CC) $(CFLAGS) //Fo"$@" //c $<
|
||||
|
||||
#------
|
||||
# Output file names
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue