From 96e32da5c9f51fd7b8fd987b096d73b61e539ebd Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Mon, 23 Sep 2013 14:49:39 +0100 Subject: [PATCH] dbghelp: Add a couple of structures that are missing from the Android ndk. --- configure | 32 ++++++++++++++++++++++++++++++++ configure.ac | 8 ++++++++ dlls/dbghelp/elf_module.c | 26 ++++++++++++++++++++++++++ include/config.h.in | 6 ++++++ 4 files changed, 72 insertions(+) diff --git a/configure b/configure index 7cbe21718c1..2e2169086cd 100755 --- a/configure +++ b/configure @@ -14220,6 +14220,38 @@ _ACEOF fi +ac_fn_c_check_type "$LINENO" "struct r_debug" "ac_cv_type_struct_r_debug" "#ifdef HAVE_LINK_H +#include +#endif +#ifdef HAVE_SYS_LINK_H +#include +#endif +" +if test "x$ac_cv_type_struct_r_debug" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_R_DEBUG 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct link_map" "ac_cv_type_struct_link_map" "#ifdef HAVE_LINK_H +#include +#endif +#ifdef HAVE_SYS_LINK_H +#include +#endif +" +if test "x$ac_cv_type_struct_link_map" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_LINK_MAP 1 +_ACEOF + + +fi + + ac_fn_c_check_member "$LINENO" "struct ff_effect" "direction" "ac_cv_member_struct_ff_effect_direction" "#ifdef HAVE_LINUX_INPUT_H #include #endif diff --git a/configure.ac b/configure.ac index 8b78cfe6184..d73361021bd 100644 --- a/configure.ac +++ b/configure.ac @@ -2203,6 +2203,14 @@ AC_CHECK_TYPES([struct xinpgen],,, #include #endif]) +AC_CHECK_TYPES([struct r_debug, struct link_map],,, +[#ifdef HAVE_LINK_H +#include +#endif +#ifdef HAVE_SYS_LINK_H +#include +#endif]) + AC_CHECK_MEMBERS([struct ff_effect.direction],,, [#ifdef HAVE_LINUX_INPUT_H #include diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index f8015c1b6c2..8539d0ca2d9 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -60,6 +60,32 @@ #define NT_GNU_BUILD_ID 3 #endif +#ifndef HAVE_STRUCT_R_DEBUG +struct r_debug +{ + int r_version; + struct link_map *r_map; + ElfW(Addr) r_brk; + enum + { + RT_CONSISTENT, + RT_ADD, + RT_DELETE + } r_state; + ElfW(Addr) r_ldbase; +}; +#endif /* HAVE_STRUCT_R_DEBUG */ + +#ifndef HAVE_STRUCT_LINK_MAP +struct link_map +{ + ElfW(Addr) l_addr; + char *l_name; + ElfW(Dyn) *l_ld; + struct link_map *l_next, *l_prev; +}; +#endif /* HAVE_STRUCT_LINK_MAP */ + WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); struct elf_info diff --git a/include/config.h.in b/include/config.h.in index 1f0bfea3ecd..5863d10bc04 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -825,6 +825,9 @@ /* Define to 1 if `ips_total' is a member of `struct ip_stats'. */ #undef HAVE_STRUCT_IP_STATS_IPS_TOTAL +/* Define to 1 if the system has the type `struct link_map'. */ +#undef HAVE_STRUCT_LINK_MAP + /* Define to 1 if `msg_accrights' is a member of `struct msghdr'. */ #undef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS @@ -840,6 +843,9 @@ /* Define to 1 if `name' is a member of `struct option'. */ #undef HAVE_STRUCT_OPTION_NAME +/* Define to 1 if the system has the type `struct r_debug'. */ +#undef HAVE_STRUCT_R_DEBUG + /* Define to 1 if `sin6_scope_id' is a member of `struct sockaddr_in6'. */ #undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID