You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/elfutils/files/elfutils-0.156-nested-funcs...

37 lines
796 B

clang does not like nested funcs. use a define instead.
https://bugs.gentoo.org/451986
--- a/libelf/elf_begin.c
+++ b/libelf/elf_begin.c
@@ -1011,18 +1011,17 @@ elf_begin (fildes, cmd, ref)
return NULL;
}
- Elf *lock_dup_elf ()
- {
- /* We need wrlock to dup an archive. */
- if (ref->kind == ELF_K_AR)
- {
- rwlock_unlock (ref->lock);
- rwlock_wrlock (ref->lock);
- }
-
- /* Duplicate the descriptor. */
- return dup_elf (fildes, cmd, ref);
- }
+#define lock_dup_elf() \
+ ({ \
+ /* We need wrlock to dup an archive. */ \
+ if (ref->kind == ELF_K_AR) \
+ { \
+ rwlock_unlock (ref->lock); \
+ rwlock_wrlock (ref->lock); \
+ } \
+ /* Duplicate the descriptor. */ \
+ dup_elf (fildes, cmd, ref); \
+ })
switch (cmd)
{