Skip to content

Commit e0b5034

Browse files
summerinsectsminggo
authored andcommitted
Update CCConsole.cpp (#18649)
1 parent e88a05e commit e0b5034

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cocos/base/CCConsole.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,11 @@ bool Console::listenOnTCP(int port)
530530
#endif
531531

532532
if ( (n = getaddrinfo(nullptr, serv, &hints, &res)) != 0) {
533-
fprintf(stderr,"net_listen error for %s: %s", serv, gai_strerror(n));
533+
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
534+
fprintf(stderr, "net_listen error for %s: %s", serv, gai_strerrorA(n));
535+
#else
536+
fprintf(stderr, "net_listen error for %s: %s", serv, gai_strerror(n));
537+
#endif
534538
return false;
535539
}
536540

0 commit comments

Comments
 (0)