mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gst/rtsp/rtspconnection.c: Use better G_OS_* macros. Fixes #345301 some more.
Original commit message from CVS: * gst/rtsp/rtspconnection.c: (inet_aton), (rtsp_connection_send), (rtsp_connection_close), (rtsp_connection_free): Use better G_OS_* macros. Fixes #345301 some more.
This commit is contained in:
parent
490ac45de2
commit
b24f97c695
2 changed files with 24 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-06-20 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* gst/rtsp/rtspconnection.c: (inet_aton), (rtsp_connection_send),
|
||||||
|
(rtsp_connection_close), (rtsp_connection_free):
|
||||||
|
Use better G_OS_* macros. Fixes #345301 some more.
|
||||||
|
|
||||||
2006-06-20 Wim Taymans <wim@fluendo.com>
|
2006-06-20 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
Patch by: Brian Cameron <brian dot cameron at sun dot com>
|
Patch by: Brian Cameron <brian dot cameron at sun dot com>
|
||||||
|
|
|
@ -23,18 +23,23 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
/* we include this here to get the G_OS_* defines */
|
||||||
#include <winsock2.h>
|
#include <glib.h>
|
||||||
#else
|
|
||||||
|
#ifdef G_OS_UNIX
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "rtspconnection.h"
|
#include "rtspconnection.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef G_OS_WIN32
|
||||||
/* note that inet_aton is deprecated on unix because
|
/* note that inet_aton is deprecated on unix because
|
||||||
* inet_addr returns -1 (INADDR_NONE) for the valid 255.255.255.255
|
* inet_addr returns -1 (INADDR_NONE) for the valid 255.255.255.255
|
||||||
* address. */
|
* address. */
|
||||||
|
@ -150,7 +155,7 @@ rtsp_connection_send (RTSPConnection * conn, RTSPMessage * message)
|
||||||
if (conn == NULL || message == NULL)
|
if (conn == NULL || message == NULL)
|
||||||
return RTSP_EINVAL;
|
return RTSP_EINVAL;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef G_OS_WIN32
|
||||||
WSADATA w;
|
WSADATA w;
|
||||||
int error = WSAStartup (0x0202, &w);
|
int error = WSAStartup (0x0202, &w);
|
||||||
|
|
||||||
|
@ -215,7 +220,7 @@ rtsp_connection_send (RTSPConnection * conn, RTSPMessage * message)
|
||||||
|
|
||||||
return RTSP_OK;
|
return RTSP_OK;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef G_OS_WIN32
|
||||||
startup_error:
|
startup_error:
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (self, "Error %d on WSAStartup", error);
|
GST_DEBUG_OBJECT (self, "Error %d on WSAStartup", error);
|
||||||
|
@ -580,12 +585,14 @@ rtsp_connection_close (RTSPConnection * conn)
|
||||||
|
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return RTSP_EINVAL;
|
return RTSP_EINVAL;
|
||||||
#ifdef WIN32
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
res = socketclose (conn->fd);
|
res = socketclose (conn->fd);
|
||||||
WSACleanup ();
|
WSACleanup ();
|
||||||
#else
|
#else
|
||||||
res = close (conn->fd);
|
res = close (conn->fd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
conn->fd = -1;
|
conn->fd = -1;
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
goto sys_error;
|
goto sys_error;
|
||||||
|
@ -604,6 +611,10 @@ rtsp_connection_free (RTSPConnection * conn)
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return RTSP_EINVAL;
|
return RTSP_EINVAL;
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
WSACleanup ();
|
||||||
|
#endif
|
||||||
|
|
||||||
g_free (conn);
|
g_free (conn);
|
||||||
|
|
||||||
return RTSP_OK;
|
return RTSP_OK;
|
||||||
|
|
Loading…
Reference in a new issue