mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-06-01 19:41:28 +00:00
Fix compilation problems if dladdr() doesn't exist. Fixes #115005
Original commit message from CVS: Fix compilation problems if dladdr() doesn't exist. Fixes #115005
This commit is contained in:
parent
e94d234ce5
commit
46534a11bb
|
@ -350,6 +350,14 @@ AC_CHECK_FUNC(posix_memalign,
|
|||
AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
|
||||
[Defined if we have posix_memalign ()]))
|
||||
|
||||
dnl test if we have dladdr(); we use it for debugging
|
||||
save_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -D_GNU_SOURCE"
|
||||
AC_CHECK_LIB(dl, dladdr,
|
||||
AC_DEFINE(HAVE_DLADDR, 1,
|
||||
[Defined if we have dladdr ()]))
|
||||
CFLAGS="$save_cflags"
|
||||
|
||||
if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
|
||||
AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
|
||||
fi
|
||||
|
|
|
@ -20,12 +20,19 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <dlfcn.h>
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "gst_private.h"
|
||||
#include "gstelement.h"
|
||||
#include "gstpad.h"
|
||||
#include "gstscheduler.h"
|
||||
#ifdef HAVE_DLFCN_H
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if defined __sgi__
|
||||
#include <rld_interface.h>
|
||||
typedef struct DL_INFO {
|
||||
|
@ -47,6 +54,7 @@ int dladdr(void *address, Dl_info *dl)
|
|||
return (int)v;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern gchar *_gst_progname;
|
||||
|
||||
|
@ -497,12 +505,18 @@ gchar *
|
|||
_gst_debug_nameof_funcptr (void *ptr)
|
||||
{
|
||||
gchar *ptrname;
|
||||
#ifdef HAVE_DLADDR
|
||||
Dl_info dlinfo;
|
||||
#endif
|
||||
if (__gst_function_pointers && (ptrname = g_hash_table_lookup(__gst_function_pointers,ptr))) {
|
||||
return g_strdup(ptrname);
|
||||
} else if (dladdr(ptr,&dlinfo) && dlinfo.dli_sname) {
|
||||
} else
|
||||
#ifdef HAVE_DLADDR
|
||||
if (dladdr(ptr,&dlinfo) && dlinfo.dli_sname) {
|
||||
return g_strdup(dlinfo.dli_sname);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
return g_strdup_printf("%p",ptr);
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue