Compile a test program to ensure that we have working atomic resource counting.

Original commit message from CVS:
Compile a test program to ensure that we have working atomic resource
counting.

A few small changes (include headers, fix a cast) to stop compiler
warnings.
This commit is contained in:
Richard Boulton 2000-02-04 02:25:34 +00:00
parent 65e7c2e158
commit 5d5807c0d5
3 changed files with 21 additions and 9 deletions

View file

@ -86,13 +86,23 @@ dnl Check for atomic.h
dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H) dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no) AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
AC_EGREP_HEADER(atomic_set, asm/atomic.h,, dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
[ if test x$HAVE_ATOMIC_H = xyes; then
if test x$HAVE_ATOMIC_H = xyes; then AC_TRY_RUN([
AC_MSG_WARN("Atomic reference counting is out of date: doing without.") #include "asm/atomic.h"
fi main() { atomic_t t; atomic_set(&t,0); return 0;}
HAVE_ATOMIC_H=no ],, [
]) # Not successful
if test x$HAVE_ATOMIC_H = xyes; then
AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
fi
HAVE_ATOMIC_H=no
], [
# Cross compiling
AC_MSG_RESULT(yes)
AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
])
fi
dnl Check for MMX capable compiler dnl Check for MMX capable compiler
AC_MSG_CHECKING(Checking MMX compilation) AC_MSG_CHECKING(Checking MMX compilation)

View file

@ -422,7 +422,7 @@ xmlNodePtr gst_element_save_thyself(GstElement *element,xmlNodePtr parent) {
while (pads) { while (pads) {
pad = GST_PAD(pads->data); pad = GST_PAD(pads->data);
// figure out if it's a direct pad or a ghostpad // figure out if it's a direct pad or a ghostpad
if (pad->parent == element) if (GST_ELEMENT(pad->parent) == element)
gst_pad_save_thyself(pad,self); gst_pad_save_thyself(pad,self);
pads = g_list_next(pads); pads = g_list_next(pads);
} }
@ -535,6 +535,7 @@ void gst_element_set_loop_function(GstElement *element,
GstElementLoopFunction loop) { GstElementLoopFunction loop) {
element->loopfunc = loop; element->loopfunc = loop;
if (element->threadstate != NULL) if (element->threadstate != NULL)
// note that this casts a GstElement * to a char **. Ick.
cothread_setfunc(element->threadstate,gst_element_loopfunc_wrapper, cothread_setfunc(element->threadstate,gst_element_loopfunc_wrapper,
0,element); 0,(char **)element);
} }

View file

@ -22,6 +22,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include <gst/gstplugin.h> #include <gst/gstplugin.h>