dpull / skynet-mingw

对skynet无任何改动的windows版
http://blog.dpull.com/post/2015-11-08-skynet_mingw
MIT License
306 stars 127 forks source link

windows 下编译 错误, 自动编译平台上也是这个错误,帮忙看一下呢,谢谢 #22

Closed cuitking closed 3 years ago

cuitking commented 3 years ago

make gcc -std=gnu99 -g -O2 -Wall -Iplatform -I3rd/lua --shared platform/platform.c platform/epoll.c platform/socket_poll.c platform/socket_extend.c -lws2_32 -lwsock32 -o platform.dll -DDONOT_USE_IO_EXTEND -DFD_SETSIZE=1024 gcc -std=gnu99 -includeplatform.h -g -O2 -Wall -Iplatform -I3rd/lua --shared -o skynet.dll skynet-src/skynet_handle.c skynet-src/skynet_module.c skynet-src/skynet_mq.c skynet-src/skynet_server.c skynet-src/skynet_start.c skynet-src/skynet_timer.c skynet-src/skynet_error.c skynet-src/skynet_harbor.c skynet-src/skynet_env.c skynet-src/skynet_monitor.c skynet-src/skynet_socket.c skynet-src/socket_server.c skynet-src/malloc_hook.c skynet-src/skynet_daemon.c skynet-src/skynet_log.c -Iskynet-src -llua54 -lplatform -lpthread -lws2_32 -L. -DNOUSE_JEMALLOC -DFD_SETSIZE=4096 skynet-src/skynet_start.c: In function 'thread_timer': skynet-src/skynet_start.c:137:3: warning: 'usleep' is deprecated [-Wdeprecated-declarations] usleep(2500); ^~ In file included from platform/platform.h:5:0, from :0: d:\mingw\include\unistd.h:104:5: note: declared here int usleep( useconds_t period ){ return __mingw_sleep( 0, 1000 * period ); } ^~ skynet-src/socket_server.c: In function 'enable_write': skynet-src/socket_server.c:541:10: warning: implicit declaration of function 'sp_enable' [-Wimplicit-function-declaration] return sp_enable(ss->event_fd, s->fd, s, s->reading, enable); ^~~~~ skynet-src/socket_server.c: In function 'close_write': skynet-src/socket_server.c:697:19: error: 'SHUT_WR' undeclared (first use in this function) shutdown(s->fd, SHUT_WR); ^~~ skynet-src/socket_server.c:697:19: note: each undeclared identifier is reported only once for each function it appears in make: *** [skynet.dll] Error 1

cuitking commented 3 years ago

在 platform/sys/socket.h 中添加如下代码:

ifndef SHUT_WR

define SHUT_WR SD_SEND

endif

ifndef SHUT_RDWR

define SHUT_RDWR SD_BOTH

endif

dpull commented 3 years ago

多谢 你pr下 还是我自己改?

cuitking commented 3 years ago

现在不方便pr,你自己改下吧

dpull commented 3 years ago

OK 多谢提供改法