[MPlayer-dev-eng] [PATCH] network support for cygwin
Joey Parrish
joey at yunamusic.com
Tue Aug 6 06:28:26 CEST 2002
On Mon, Aug 05, 2002 at 11:19:25PM -0500, Joey Parrish wrote:
> Hello,
>
> Attached below is a patch that will allow mplayer to fall back
> on inet_aton() when inet_pton() is not present. If neither is
> available, then streaming is disabled as before. This will
> allow cygwin to have streaming video support. I don't know
> what other systems will benefit from this.
>
> Arg, I see I'm a bit late for pre6. Oh well. Maybe it
> will teach me to wake up earlier. :)
Speaking of early, I completely forgot to attach the patch.
Oi, somebody please wake me up.
--Joey
--
"Yes." -- John F. Kennedy
-------------- next part --------------
--- configure Mon Aug 5 13:14:16 2002
+++ configure Mon Aug 5 13:48:20 2002
@@ -1518,6 +1518,7 @@
fi
+_use_aton=no
echocheck "inet_pton()"
cat > $TMPC << EOF
#include <sys/types.h>
@@ -1534,10 +1535,35 @@
_ld_sock="$_ld_sock -lresolv"
echores "yes (using $_ld_sock)"
else
- echores "no (=> streaming support disabled)"
- _streaming=no
+ echores "no (=> i'll try inet_aton next)"
+
+ echocheck "inet_aton()"
+ cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+int main(void) { (void) inet_aton(0, 0); return 0; }
+EOF
+ _use_aton=yes
+ if cc_check $_ld_sock ; then
+ # NOTE: Linux has libresolv but does not need it
+ :
+ echores "yes (using $_ld_sock)"
+ elif cc_check $_ld_sock -lresolv ; then
+ # NOTE: needed for SunOS at least
+ _ld_sock="$_ld_sock -lresolv"
+ echores "yes (using $_ld_sock)"
+ else
+ _use_aton=no
+ _streaming=no
+ echores "no (=> streaming support disabled)"
+ fi
fi
+_def_use_aton='#undef USE_ATON'
+if test "$_use_aton" != no; then
+ _def_use_aton='#define USE_ATON 1'
+fi
echocheck "inttypes.h (required)"
cat > $TMPC << EOF
@@ -4523,6 +4549,9 @@
/* enable streaming */
$_def_streaming
+
+/* define this to use inet_aton instead of inet_pton */
+$_def_use_aton
/* enables / disables cdparanoia support */
$_def_cdparanoia
--- libmpdemux/network.h Thu Jul 4 21:35:19 2002
+++ libmpdemux/network.h Mon Aug 5 13:50:03 2002
@@ -52,4 +52,8 @@
int http_send_request(URL_t *url);
HTTP_header_t *http_read_response(int fd);
+#ifdef USE_ATON
+# define inet_pton(a, b, c) inet_aton(b, c)
+#endif
+
#endif
More information about the MPlayer-dev-eng
mailing list