[PATCH] socklen_t definition
With more talk about libossupport I thought it might be a good time to resurrect KO Myung-Hun's socklen_t patch. Still typedefs it to int as that is what OS/2 and Beos use. Not sure about the windows bit that KO added. Dave
On Sun, Dec 23, 2007 at 06:08:37PM -0800, Dave Yeo wrote:
With more talk about libossupport I thought it might be a good time to resurrect KO Myung-Hun's socklen_t patch. Still typedefs it to int as that is what OS/2 and Beos use. Not sure about the windows bit that KO added. Dave
[configure i dont maintain]
=================================================================== --- libavformat/rtpproto.c (revision 11311) +++ libavformat/rtpproto.c (working copy) @@ -24,7 +24,6 @@ #include <unistd.h> #include <stdarg.h> #include "network.h" -#include "os_support.h" #include <fcntl.h>
#define RTP_TX_BUF_SIZE (64 * 1024)
unrelated
Index: libavformat/network.h =================================================================== --- libavformat/network.h (revision 11311) +++ libavformat/network.h (working copy) @@ -42,6 +42,10 @@ #include <arpa/inet.h> #endif
+#ifndef HAVE_SOCKLEN_T +#include "os_support.h" +#endif + int ff_socket_nonblock(int socket, int enable);
static inline int ff_network_init(void)
unrelated
Index: libavformat/os_support.h =================================================================== --- libavformat/os_support.h (revision 11311) +++ libavformat/os_support.h (working copy) @@ -27,7 +27,7 @@ * miscellaneous OS support macros and functions. */
-#if defined(__BEOS__) || defined(__INNOTEK_LIBC__) +#ifndef HAVE_SOCKLEN_T typedef int socklen_t; #endif
probably ok
Index: libavformat/tcp.c =================================================================== --- libavformat/tcp.c (revision 11311) +++ libavformat/tcp.c (working copy) @@ -21,7 +21,6 @@ #include "avformat.h" #include <unistd.h> #include "network.h" -#include "os_support.h" #include <sys/time.h>
typedef struct TCPContext {
unrelated [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker, user questions for the command line tools ffmpeg, ffplay, ... as well as questions about how to use libav* should be sent to the ffmpeg-user mailinglist.
On 12/30/07 12:46 pm, Michael Niedermayer wrote:
On Sun, Dec 23, 2007 at 06:08:37PM -0800, Dave Yeo wrote:
With more talk about libossupport I thought it might be a good time to resurrect KO Myung-Hun's socklen_t patch. Still typedefs it to int as that is what OS/2 and Beos use. Not sure about the windows bit that KO added. Dave
[configure i dont maintain] ...
Index: libavformat/os_support.h =================================================================== --- libavformat/os_support.h (revision 11311) +++ libavformat/os_support.h (working copy) @@ -27,7 +27,7 @@ * miscellaneous OS support macros and functions. */
-#if defined(__BEOS__) || defined(__INNOTEK_LIBC__) +#ifndef HAVE_SOCKLEN_T typedef int socklen_t; #endif
probably ok
...
[...]
Updated patch attached with unrelated stuff removed. Looking at the Windows headers that come with OpenWatcom socklen_t is declared in ws2tcpip.h. Dave
On Sun, Dec 30, 2007 at 05:12:33PM -0800, Dave Yeo wrote:
Updated patch attached with unrelated stuff removed. Looking at the Windows headers that come with OpenWatcom socklen_t is declared in ws2tcpip.h.
Does this stuff actually work for you?
--- configure (revision 11358) +++ configure (working copy) @@ -551,6 +551,23 @@
+check_type(){ + log check_type "$@" + headers=$1 + type=$2 + shift 2 + disable $type + incs="" + for hdr in $headers; do + incs="$incs +#include <$hdr>" + done + check_cc "$@" <<EOF && enable $type +$incs +$type v; +EOF +}
Ummm, $headers only ever contains one entry, you just assigned $1 to it, so what's the point of looping over its content? Diego
On Mon, Dec 31, 2007 at 11:15:39AM +0100, Diego Biurrun wrote:
--- configure (revision 11358) +++ configure (working copy) @@ -551,6 +551,23 @@
+check_type(){ + log check_type "$@" + headers=$1 + type=$2 + shift 2 + disable $type + incs="" + for hdr in $headers; do + incs="$incs +#include <$hdr>" + done + check_cc "$@" <<EOF && enable $type +$incs +$type v; +EOF +}
Ummm, $headers only ever contains one entry, you just assigned $1 to it, so what's the point of looping over its content?
check_type "foo.h bar.h baz.h" faz_t Rich
Rich Felker <dalias at aerifal.cx> writes:
On Mon, Dec 31, 2007 at 11:15:39AM +0100, Diego Biurrun wrote:
--- configure (revision 11358) +++ configure (working copy) @@ -551,6 +551,23 @@
+check_type(){ + log check_type "$@" + headers=$1 + type=$2 + shift 2 + disable $type + incs="" + for hdr in $headers; do + incs="$incs +#include <$hdr>" + done + check_cc "$@" <<EOF && enable $type +$incs +$type v; +EOF +}
Ummm, $headers only ever contains one entry, you just assigned $1 to it, so what's the point of looping over its content?
check_type "foo.h bar.h baz.h" faz_t
That won't work with the code as-is, since $1 isn't inside quotes. -- M?ns Rullg?rd mans at mansr.com
On Tue, Jan 01, 2008 at 11:00:14AM +0000, M?ns Rullg?rd wrote:
Rich Felker <dalias at aerifal.cx> writes:
On Mon, Dec 31, 2007 at 11:15:39AM +0100, Diego Biurrun wrote:
--- configure (revision 11358) +++ configure (working copy) @@ -551,6 +551,23 @@
+check_type(){ + log check_type "$@" + headers=$1 + type=$2 + shift 2 + disable $type + incs="" + for hdr in $headers; do + incs="$incs +#include <$hdr>" + done + check_cc "$@" <<EOF && enable $type +$incs +$type v; +EOF +}
Ummm, $headers only ever contains one entry, you just assigned $1 to it, so what's the point of looping over its content?
check_type "foo.h bar.h baz.h" faz_t
That won't work with the code as-is, since $1 isn't inside quotes.
Word splitting and pathname expansion are not performed on RHS of assignments in bourne shell. foo="$bar" is always useless; foo=$bar is just as good. Rich
On Tue, Jan 01, 2008 at 11:00:42AM -0500, Rich Felker wrote:
On Tue, Jan 01, 2008 at 11:00:14AM +0000, M?ns Rullg?rd wrote:
Rich Felker <dalias at aerifal.cx> writes:
On Mon, Dec 31, 2007 at 11:15:39AM +0100, Diego Biurrun wrote:
--- configure (revision 11358) +++ configure (working copy) @@ -551,6 +551,23 @@
+check_type(){ + log check_type "$@" + headers=$1 + type=$2 + shift 2 + disable $type + incs="" + for hdr in $headers; do + incs="$incs +#include <$hdr>" + done + check_cc "$@" <<EOF && enable $type +$incs +$type v; +EOF +}
Ummm, $headers only ever contains one entry, you just assigned $1 to it, so what's the point of looping over its content?
check_type "foo.h bar.h baz.h" faz_t
That won't work with the code as-is, since $1 isn't inside quotes.
Word splitting and pathname expansion are not performed on RHS of assignments in bourne shell. foo="$bar" is always useless; foo=$bar is just as good.
Yes, I was wrong, the patch is good, applied. Diego
On 12/31/07 02:15 am, Diego Biurrun wrote:
On Sun, Dec 30, 2007 at 05:12:33PM -0800, Dave Yeo wrote:
Updated patch attached with unrelated stuff removed. Looking at the Windows headers that come with OpenWatcom socklen_t is declared in ws2tcpip.h.
Does this stuff actually work for you?
Yes, tested with default and by adding the typedef to sys/socket.h.
--- configure (revision 11358) +++ configure (working copy) @@ -551,6 +551,23 @@
+check_type(){ + log check_type "$@" + headers=$1 + type=$2 + shift 2 + disable $type + incs="" + for hdr in $headers; do + incs="$incs +#include <$hdr>" + done + check_cc "$@" <<EOF && enable $type +$incs +$type v; +EOF +}
Ummm, $headers only ever contains one entry, you just assigned $1 to it, so what's the point of looping over its content?
What if you have one header that depends on another header? Perhaps a function that also needs inttypes.h pulled in as well? Not sure how things stand now but at one time quite a few headers depended on other headers here with the old EMX libc.
Diego
Dave
On Tue, Jan 01, 2008 at 11:14:57AM -0800, Dave Yeo wrote:
Ummm, $headers only ever contains one entry, you just assigned $1 to it, so what's the point of looping over its content?
What if you have one header that depends on another header? Perhaps a function that also needs inttypes.h pulled in as well? Not sure how things stand now but at one time quite a few headers depended on other headers here with the old EMX libc.
Huh? Makes no sense and it's unrelated to Diego's misunderstanding of Bourne shell. :) Rich
participants (5)
-
dalias@aerifal.cx -
daveryeo@telus.net -
diego@biurrun.de -
mans@mansr.com -
michaelni@gmx.at