From 3317754e3e5b1d2c4041fd178d593050462de0b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Wed, 31 Oct 2007 22:01:03 +0000 Subject: [PATCH] Fix a couple of missing includes for MSVC2005 and a C99 issue. Also, starting with 2.14.0, GLib won't provide a pipe(... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Original commit message from CVS: Patch by: Ole André Vadla Ravnås * gst/gsttrace.c: * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_new): * libs/gst/net/gstnettimepacket.c: (gst_net_time_packet_send): * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_new): Fix a couple of missing includes for MSVC2005 and a C99 issue. Also, starting with 2.14.0, GLib won't provide a pipe() macro any longer, so use _pipe() directly (#492077). * win32/common/dirent.c: (_treaddir): Add a couple of casts to make it build without warnings with MSVC. * win32/common/libgstreamer.def: Add some more symbols that need to be exported. --- ChangeLog | 18 ++++++++++++++++++ gst/gsttrace.c | 4 ++++ libs/gst/net/gstnetclientclock.c | 12 +++++++++--- libs/gst/net/gstnettimepacket.c | 6 +++--- libs/gst/net/gstnettimeprovider.c | 9 ++++++++- win32/common/dirent.c | 4 ++-- win32/common/libgstreamer.def | 3 +++ 7 files changed, 47 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ef23331d8..ff31434806 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2007-10-31 Tim-Philipp Müller + + Patch by: Ole André Vadla Ravnås + + * gst/gsttrace.c: + * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_new): + * libs/gst/net/gstnettimepacket.c: (gst_net_time_packet_send): + * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_new): + Fix a couple of missing includes for MSVC2005 and a C99 issue. Also, + starting with 2.14.0, GLib won't provide a pipe() macro any longer, + so use _pipe() directly (#492077). + + * win32/common/dirent.c: (_treaddir): + Add a couple of casts to make it build without warnings with MSVC. + + * win32/common/libgstreamer.def: + Add some more symbols that need to be exported. + 2007-10-31 Tim-Philipp Müller * tests/examples/metadata/read-metadata.c: (message_loop): diff --git a/gst/gsttrace.c b/gst/gsttrace.c index cdf3442553..709800e5d2 100644 --- a/gst/gsttrace.c +++ b/gst/gsttrace.c @@ -56,6 +56,10 @@ #include #include +#if defined (_MSC_VER) && _MSC_VER >= 1400 +# include +#endif + #include "gst_private.h" #include "gstinfo.h" diff --git a/libs/gst/net/gstnetclientclock.c b/libs/gst/net/gstnetclientclock.c index 895175b5f5..687dc48fb2 100644 --- a/libs/gst/net/gstnetclientclock.c +++ b/libs/gst/net/gstnetclientclock.c @@ -50,11 +50,17 @@ #include "config.h" #endif -#include - #include "gstnettimepacket.h" #include "gstnetclientclock.h" +#ifdef HAVE_UNISTD_H +#include +#endif + +#if defined (_MSC_VER) && _MSC_VER >= 1400 +#include +#endif + GST_DEBUG_CATEGORY_STATIC (ncc_debug); #define GST_CAT_DEFAULT (ncc_debug) @@ -610,7 +616,7 @@ gst_net_client_clock_new (gchar * name, const gchar * remote_address, #ifdef G_OS_WIN32 GST_DEBUG_OBJECT (ret, "creating pipe"); - if ((iret = pipe (CONTROL_SOCKETS (ret))) < 0) + if ((iret = _pipe (CONTROL_SOCKETS (ret), 4096, _O_BINARY)) < 0) goto no_socket_pair; #else GST_DEBUG_OBJECT (ret, "creating socket pair"); diff --git a/libs/gst/net/gstnettimepacket.c b/libs/gst/net/gstnettimepacket.c index 6893f08221..a87d54489d 100644 --- a/libs/gst/net/gstnettimepacket.c +++ b/libs/gst/net/gstnettimepacket.c @@ -188,6 +188,7 @@ gst_net_time_packet_send (const GstNetTimePacket * packet, gint fd, fcntl (fd, F_SETFL, fdflags | O_NONBLOCK); #elif defined G_OS_WIN32 flags = 1; + send_flags = 0; #else send_flags = MSG_DONTWAIT; #endif @@ -196,11 +197,10 @@ gst_net_time_packet_send (const GstNetTimePacket * packet, gint fd, #ifdef G_OS_WIN32 ioctlsocket (fd, FIONBIO, &flags); /* Set nonblocking mode */ - ret = sendto (fd, buffer, GST_NET_TIME_PACKET_SIZE, NULL, addr, len); -#else - ret = sendto (fd, buffer, GST_NET_TIME_PACKET_SIZE, send_flags, addr, len); #endif + ret = sendto (fd, buffer, GST_NET_TIME_PACKET_SIZE, send_flags, addr, len); + #ifdef __CYGWIN__ fcntl (fd, F_SETFL, fdflags); #endif diff --git a/libs/gst/net/gstnettimeprovider.c b/libs/gst/net/gstnettimeprovider.c index e7ca61ccdc..3d93441f76 100644 --- a/libs/gst/net/gstnettimeprovider.c +++ b/libs/gst/net/gstnettimeprovider.c @@ -44,7 +44,14 @@ #include +#ifdef HAVE_UNISTD_H #include +#endif + +#if defined (_MSC_VER) && _MSC_VER >= 1400 +#include +#endif + #ifndef G_OS_WIN32 #include #endif @@ -522,7 +529,7 @@ gst_net_time_provider_new (GstClock * clock, const gchar * address, gint port) #ifdef G_OS_WIN32 GST_DEBUG_OBJECT (ret, "creating pipe"); - if ((iret = pipe (CONTROL_SOCKETS (ret))) < 0) + if ((iret = _pipe (CONTROL_SOCKETS (ret), 4096, _O_BINARY)) < 0) goto no_socket_pair; #else GST_DEBUG_OBJECT (ret, "creating socket pair"); diff --git a/win32/common/dirent.c b/win32/common/dirent.c index 093ab1cde0..85be9cb6a2 100644 --- a/win32/common/dirent.c +++ b/win32/common/dirent.c @@ -285,7 +285,7 @@ _treaddir (_TDIR * dirp) /* Start the search */ - dirp->dd_handle = _tfindfirst (dirp->dd_name, &(dirp->dd_dta)); + dirp->dd_handle = (long) _tfindfirst (dirp->dd_name, &(dirp->dd_dta)); if (dirp->dd_handle == -1) { @@ -353,7 +353,7 @@ _treaddir (_TDIR * dirp) * file name. */ - dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dta.name); + dirp->dd_dir.d_namlen = (unsigned short) _tcslen (dirp->dd_dta.name); _tcscpy (dirp->dd_dir.d_name, dirp->dd_dta.name); diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index cad739b31b..5cbb987299 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -103,6 +103,7 @@ EXPORTS GST_CAT_CALL_TRACE DATA GST_CAT_CAPS DATA GST_CAT_CLOCK DATA + GST_CAT_DEFAULT DATA GST_CAT_ELEMENT_PADS DATA GST_CAT_ERROR_SYSTEM DATA GST_CAT_EVENT DATA @@ -349,6 +350,8 @@ EXPORTS gst_message_new_element gst_message_new_eos gst_message_new_error + gst_message_new_info + gst_message_new_latency gst_message_new_new_clock gst_message_new_segment_done gst_message_new_segment_start -- 2.34.1