diff options
| author | unknown <diego.nehab@gmail.com> | 2013-05-27 20:30:06 +0800 |
|---|---|---|
| committer | unknown <diego.nehab@gmail.com> | 2013-05-27 20:30:06 +0800 |
| commit | 26704061a4e28eff573f02297e6da045d166afa4 (patch) | |
| tree | 7ac69229fc585e03a887a94a7d4793576245b0c5 /src | |
| parent | fbe184f28af85cda61394790e8114c6143057364 (diff) | |
| download | luasocket-26704061a4e28eff573f02297e6da045d166afa4.tar.gz luasocket-26704061a4e28eff573f02297e6da045d166afa4.tar.bz2 luasocket-26704061a4e28eff573f02297e6da045d166afa4.zip | |
Fix Visual Studio 2012 projects
Diffstat (limited to 'src')
| -rw-r--r-- | src/inet.c | 4 | ||||
| -rw-r--r-- | src/inet.h | 7 | ||||
| -rw-r--r-- | src/makefile | 39 |
3 files changed, 26 insertions, 24 deletions
| @@ -502,7 +502,7 @@ const char *inet_trybind(p_socket ps, const char *address, const char *serv, | |||
| 502 | * Some systems do not provide this so that we provide our own. It's not | 502 | * Some systems do not provide this so that we provide our own. It's not |
| 503 | * marvelously fast, but it works just fine. | 503 | * marvelously fast, but it works just fine. |
| 504 | \*-------------------------------------------------------------------------*/ | 504 | \*-------------------------------------------------------------------------*/ |
| 505 | #ifdef INET_ATON | 505 | #ifdef LUASOCKET_INET_ATON |
| 506 | int inet_aton(const char *cp, struct in_addr *inp) | 506 | int inet_aton(const char *cp, struct in_addr *inp) |
| 507 | { | 507 | { |
| 508 | unsigned int a = 0, b = 0, c = 0, d = 0; | 508 | unsigned int a = 0, b = 0, c = 0, d = 0; |
| @@ -529,7 +529,7 @@ int inet_aton(const char *cp, struct in_addr *inp) | |||
| 529 | * http://mingw-users.1079350.n2.nabble.com/IPv6-getaddrinfo-amp-inet-ntop-td5891996.html | 529 | * http://mingw-users.1079350.n2.nabble.com/IPv6-getaddrinfo-amp-inet-ntop-td5891996.html |
| 530 | \*-------------------------------------------------------------------------*/ | 530 | \*-------------------------------------------------------------------------*/ |
| 531 | 531 | ||
| 532 | #ifdef INET_PTON | 532 | #ifdef LUASOCKET_INET_PTON |
| 533 | const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) | 533 | const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) |
| 534 | { | 534 | { |
| 535 | if (af == AF_INET) { | 535 | if (af == AF_INET) { |
| @@ -19,8 +19,7 @@ | |||
| 19 | #include "timeout.h" | 19 | #include "timeout.h" |
| 20 | 20 | ||
| 21 | #ifdef _WIN32 | 21 | #ifdef _WIN32 |
| 22 | #define INET_ATON | 22 | #define LUASOCKET_INET_ATON |
| 23 | #define INET_PTON | ||
| 24 | #endif | 23 | #endif |
| 25 | 24 | ||
| 26 | int inet_open(lua_State *L); | 25 | int inet_open(lua_State *L); |
| @@ -39,11 +38,11 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family); | |||
| 39 | int inet_optfamily(lua_State* L, int narg, const char* def); | 38 | int inet_optfamily(lua_State* L, int narg, const char* def); |
| 40 | int inet_optsocktype(lua_State* L, int narg, const char* def); | 39 | int inet_optsocktype(lua_State* L, int narg, const char* def); |
| 41 | 40 | ||
| 42 | #ifdef INET_ATON | 41 | #ifdef LUASOCKET_INET_ATON |
| 43 | int inet_aton(const char *cp, struct in_addr *inp); | 42 | int inet_aton(const char *cp, struct in_addr *inp); |
| 44 | #endif | 43 | #endif |
| 45 | 44 | ||
| 46 | #ifdef INET_PTON | 45 | #ifdef LUASOCKET_INET_PTON |
| 47 | const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt); | 46 | const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt); |
| 48 | int inet_pton(int af, const char *src, void *dst); | 47 | int inet_pton(int af, const char *src, void *dst); |
| 49 | #endif | 48 | #endif |
diff --git a/src/makefile b/src/makefile index fbb26a0..c44f4ef 100644 --- a/src/makefile +++ b/src/makefile | |||
| @@ -63,12 +63,13 @@ LDIR_mingw?=lua/$(LUAV)/lua | |||
| 63 | # LUAINC_win32: | 63 | # LUAINC_win32: |
| 64 | # LUALIB_win32: | 64 | # LUALIB_win32: |
| 65 | # where lua headers and libraries are found for win32 builds | 65 | # where lua headers and libraries are found for win32 builds |
| 66 | LUAINC_win32?="../../lua-5.1.3/src" | 66 | LUAINC_win32_base?= |
| 67 | LUALIB_win32?=/LIBPATH:"../../lua-5.1.3" lua$(LUAV).lib | 67 | LUAINC_win32?=$(LUAINC_win32_base)/lua/$(LUAV) |
| 68 | 68 | PLATFORM_win32?=Release | |
| 69 | LUAPREFIX_win32?= | 69 | LUAPREFIX_win32?= |
| 70 | CDIR_win32?=lua/$(LUAV) | 70 | CDIR_win32?=lua/$(LUAV)/$(PLATFORM_win32) |
| 71 | LDIR_win32?=lua/$(LUAV)/lua | 71 | LDIR_win32?=lua/$(LUAV)/$(PLATFORM_win32)/lua |
| 72 | LUALIB_win32?=$(LUAPREFIX_win32)/lua/$(LUAV)/$(PLATFORM_win32) | ||
| 72 | 73 | ||
| 73 | # prefix: /usr/local /usr /opt/local /sw | 74 | # prefix: /usr/local /usr /opt/local /sw |
| 74 | # the top of the default install tree | 75 | # the top of the default install tree |
| @@ -154,8 +155,8 @@ SOCKET_linux=usocket.o | |||
| 154 | SO_mingw=dll | 155 | SO_mingw=dll |
| 155 | O_mingw=o | 156 | O_mingw=o |
| 156 | CC_mingw=gcc | 157 | CC_mingw=gcc |
| 157 | DEF_mingw= -DLUASOCKET_$(DEBUG) -DLUA_COMPAT_MODULE -DWINVER=0x0501 \ | 158 | DEF_mingw= -DLUASOCKET_INET_PTON -DLUASOCKET_$(DEBUG) -DLUA_COMPAT_MODULE \ |
| 158 | -DLUASOCKET_API='__declspec(dllexport)' \ | 159 | -DWINVER=0x0501 -DLUASOCKET_API='__declspec(dllexport)' \ |
| 159 | -DMIME_API='__declspec(dllexport)' | 160 | -DMIME_API='__declspec(dllexport)' |
| 160 | CFLAGS_mingw= -I$(LUAINC) $(DEF) -pedantic -Wall -O2 -fno-common \ | 161 | CFLAGS_mingw= -I$(LUAINC) $(DEF) -pedantic -Wall -O2 -fno-common \ |
| 161 | -fvisibility=hidden | 162 | -fvisibility=hidden |
| @@ -170,23 +171,25 @@ SOCKET_mingw=wsocket.o | |||
| 170 | SO_win32=dll | 171 | SO_win32=dll |
| 171 | O_win32=obj | 172 | O_win32=obj |
| 172 | CC_win32=cl | 173 | CC_win32=cl |
| 173 | DEF_win32= /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" \ | 174 | DEF_win32= //D "WIN32" //D "NDEBUG" //D "_WINDOWS" //D "_USRDLL" \ |
| 174 | /D "LUASOCKET_API=__declspec(dllexport)" /D "_CRT_SECURE_NO_WARNINGS" \ | 175 | //D "LUASOCKET_API=__declspec(dllexport)" //D "_CRT_SECURE_NO_WARNINGS" \ |
| 175 | /D "_WINDLL" /D "LUA_COMPAT_MODULE" /D "MIME_API=__declspec(dllexport)" \ | 176 | //D "_WINDLL" //D "LUA_COMPAT_MODULE" \ |
| 176 | /D "LUASOCKET_$(DEBUG)" | 177 | //D "MIME_API=__declspec(dllexport)" \ |
| 177 | CFLAGS_win32=/I "$(LUAINC)" $(DEF) /O2 /Ot /MD /W3 /nologo | 178 | //D "LUASOCKET_$(DEBUG)" |
| 178 | LDFLAGS_win32= /nologo /link /NOLOGO /DLL /INCREMENTAL:NO \ | 179 | CFLAGS_win32=//I "$(LUAINC)" $(DEF) //O2 //Ot //MD //W3 //nologo |
| 179 | /MANIFEST /MANIFESTFILE:"intermediate.manifest" \ | 180 | LDFLAGS_win32= //nologo //link //NOLOGO //DLL //INCREMENTAL:NO \ |
| 180 | /MANIFESTUAC:"level='asInvoker' uiAccess='false'" \ | 181 | //MANIFEST //MANIFESTFILE:"intermediate.manifest" \ |
| 181 | /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /DYNAMICBASE:NO \ | 182 | //MANIFESTUAC:"level='asInvoker' uiAccess='false'" \ |
| 182 | /MACHINE:X86 $(LUALIB) ws2_32.lib /OUT: | 183 | //SUBSYSTEM:WINDOWS //OPT:REF //OPT:ICF //DYNAMICBASE:NO \ |
| 184 | //MACHINE:X86 /LIBPATH:"$(shell cmd //c echo $(LUALIB))" lua$(subst .,,$(LUAV)).lib \ | ||
| 185 | wsock32.lib ws2_32.lib //OUT: | ||
| 183 | LD_win32=cl | 186 | LD_win32=cl |
| 184 | SOCKET_win32=wsocket.obj | 187 | SOCKET_win32=wsocket.obj |
| 185 | 188 | ||
| 186 | .SUFFIXES: .obj | 189 | .SUFFIXES: .obj |
| 187 | 190 | ||
| 188 | .c.obj: | 191 | .c.obj: |
| 189 | $(CC) $(CFLAGS) /Fo"$@" /c $< | 192 | $(CC) $(CFLAGS) //Fo"$@" //c $< |
| 190 | 193 | ||
| 191 | #------ | 194 | #------ |
| 192 | # Output file names | 195 | # Output file names |
