Commit 4eede138 authored by Ghislain MARY's avatar Ghislain MARY

Do not redefine close when building with Visual Studio.

parent 4bb4bf7a
...@@ -155,7 +155,6 @@ unsigned long __ortp_thread_self(void); ...@@ -155,7 +155,6 @@ unsigned long __ortp_thread_self(void);
#endif #endif
#define strtok_r strtok_s #define strtok_r strtok_s
#define close _close
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
typedef __int64 int64_t; typedef __int64 int64_t;
......
...@@ -251,7 +251,7 @@ static ortp_socket_t create_and_bind(const char *addr, int *port, int *sock_fami ...@@ -251,7 +251,7 @@ static ortp_socket_t create_and_bind(const char *addr, int *port, int *sock_fami
err = bind(sock, res->ai_addr, (int)res->ai_addrlen); err = bind(sock, res->ai_addr, (int)res->ai_addrlen);
if (err != 0){ if (err != 0){
ortp_error ("Fail to bind rtp socket to (addr=%s port=%i) : %s.", addr, *port, getSocketError()); ortp_error ("Fail to bind rtp socket to (addr=%s port=%i) : %s.", addr, *port, getSocketError());
close_socket (sock); close_socket(sock);
sock=-1; sock=-1;
continue; continue;
} }
...@@ -282,13 +282,13 @@ static ortp_socket_t create_and_bind(const char *addr, int *port, int *sock_fami ...@@ -282,13 +282,13 @@ static ortp_socket_t create_and_bind(const char *addr, int *port, int *sock_fami
err=getsockname(sock,(struct sockaddr*)&saddr,&slen); err=getsockname(sock,(struct sockaddr*)&saddr,&slen);
if (err==-1){ if (err==-1){
ortp_error("getsockname(): %s",getSocketError()); ortp_error("getsockname(): %s",getSocketError());
close((int)sock); close_socket(sock);
return (ortp_socket_t)-1; return (ortp_socket_t)-1;
} }
err=getnameinfo((struct sockaddr*)&saddr, slen, NULL, 0, num, sizeof(num), NI_NUMERICHOST | NI_NUMERICSERV); err=getnameinfo((struct sockaddr*)&saddr, slen, NULL, 0, num, sizeof(num), NI_NUMERICHOST | NI_NUMERICSERV);
if (err!=0){ if (err!=0){
ortp_error("getnameinfo(): %s",gai_strerror(err)); ortp_error("getnameinfo(): %s",gai_strerror(err));
close((int)sock); close_socket(sock);
return (ortp_socket_t)-1; return (ortp_socket_t)-1;
} }
*port=atoi(num); *port=atoi(num);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment