summaryrefslogtreecommitdiffstats
path: root/gst/udp
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2008-07-23 22:01:20 +0000
committerMichael Smith <msmith@xiph.org>2008-07-23 22:01:20 +0000
commit90fdf92640f4f1e091590718cace3c87718f745e (patch)
tree26a2cc96d0cc1a2a6ea458e0e78a4dc44d55252a /gst/udp
parentda2d6b62e9a289de0d11283b740d314fa09a6d4f (diff)
gst/goom/: Fix build with MSVC: include glib.h to define inline appropriately, use header guards where needed.
Original commit message from CVS: * gst/goom/convolve_fx.c: * gst/goom/filters.c: * gst/goom/goom_config.h: * gst/goom/goom_core.c: * gst/goom/goom_tools.h: Fix build with MSVC: include glib.h to define inline appropriately, use header guards where needed. * gst/udp/gstudpnetutils.c: * gst/udp/gstudpsrc.c: Fix build with MSVC: use WSA* constants/functions where appropriate, use g_snprintf rather than snprintf. Fixes #544433.
Diffstat (limited to 'gst/udp')
-rw-r--r--gst/udp/gstudpnetutils.c14
-rw-r--r--gst/udp/gstudpsrc.c4
2 files changed, 17 insertions, 1 deletions
diff --git a/gst/udp/gstudpnetutils.c b/gst/udp/gstudpnetutils.c
index 9aa7fdd6..b3fa8870 100644
--- a/gst/udp/gstudpnetutils.c
+++ b/gst/udp/gstudpnetutils.c
@@ -69,7 +69,7 @@ gst_udp_get_addr (const char *hostname, int port, struct sockaddr_storage *addr)
memset (&hints, 0, sizeof (hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
- snprintf (service, sizeof (service) - 1, "%d", port);
+ g_snprintf (service, sizeof (service) - 1, "%d", port);
service[sizeof (service) - 1] = '\0';
if ((ret = getaddrinfo (hostname, (port == -1) ? NULL : service, &hints,
@@ -176,7 +176,11 @@ gst_udp_join_group (int sockfd, struct sockaddr_storage *addr)
break;
}
default:
+#ifdef G_OS_WIN32
+ WSASetLastError (WSAEAFNOSUPPORT);
+#else
errno = EAFNOSUPPORT;
+#endif
}
return ret;
}
@@ -219,7 +223,11 @@ gst_udp_leave_group (int sockfd, struct sockaddr_storage *addr)
break;
default:
+#ifdef G_OS_WIN32
+ WSASetLastError (WSAEAFNOSUPPORT);
+#else
errno = EAFNOSUPPORT;
+#endif
}
return ret;
@@ -248,7 +256,11 @@ gst_udp_is_multicast (struct sockaddr_storage *addr)
break;
default:
+#ifdef G_OS_WIN32
+ WSASetLastError (WSAEAFNOSUPPORT);
+#else
errno = EAFNOSUPPORT;
+#endif
}
return ret;
diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c
index 31e5e30d..586f1d83 100644
--- a/gst/udp/gstudpsrc.c
+++ b/gst/udp/gstudpsrc.c
@@ -518,7 +518,11 @@ no_select:
}
break;
default:
+#ifdef G_OS_WIN32
+ WSASetLastError (WSAEAFNOSUPPORT);
+#else
errno = EAFNOSUPPORT;
+#endif
goto receive_error;
}
GST_LOG_OBJECT (udpsrc, "read %d bytes", (int) readsize);