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 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_EGREP_HEADER(atomic_set, asm/atomic.h,,
[
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
])
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
AC_TRY_RUN([
#include "asm/atomic.h"
main() { atomic_t t; atomic_set(&t,0); return 0;}
],, [
# 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
AC_MSG_CHECKING(Checking MMX compilation)

View file

@ -422,7 +422,7 @@ xmlNodePtr gst_element_save_thyself(GstElement *element,xmlNodePtr parent) {
while (pads) {
pad = GST_PAD(pads->data);
// 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);
pads = g_list_next(pads);
}
@ -535,6 +535,7 @@ void gst_element_set_loop_function(GstElement *element,
GstElementLoopFunction loop) {
element->loopfunc = loop;
if (element->threadstate != NULL)
// note that this casts a GstElement * to a char **. Ick.
cothread_setfunc(element->threadstate,gst_element_loopfunc_wrapper,
0,element);
0,(char **)element);
}

View file

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