This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Simplify an #if #else #endif.
- From: Rafael Avila de Espindola <rafael at espindo dot la>
- To: libc-alpha at sourceware dot org, "H.J. Lu" <hjl dot tools at gmail dot com>, Florian Weimer <fweimer at redhat dot com>, Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Date: Wed, 10 Oct 2018 04:15:55 +0000
- Subject: [PATCH] Simplify an #if #else #endif.
- Reply-to: Rafael Avila de Espindola <rafael at espindo dot la>
The #else of two nested #if clauses were identical.
---
This also makes the followup patches for VDSO handling easier to read.
2018-10-09 Rafael Ávila de Espíndola <rafael@espindo.la>
[BZ #19767]
* sysdeps/unix/sysv/linux/sysdep-vdso.h: Merge nested #if.
diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
index 1912c1c156..7ec175c4c4 100644
--- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
+++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
@@ -26,13 +26,11 @@
funcptr (args)
#endif
-#ifdef SHARED
+#if defined SHARED && defined HAVE_VSYSCALL
-# ifdef HAVE_VSYSCALL
+# include <libc-vdso.h>
-# include <libc-vdso.h>
-
-# define INLINE_VSYSCALL(name, nr, args...) \
+# define INLINE_VSYSCALL(name, nr, args...) \
({ \
__label__ out; \
__label__ iserr; \
@@ -61,7 +59,7 @@
sc_ret; \
})
-# define INTERNAL_VSYSCALL(name, err, nr, args...) \
+# define INTERNAL_VSYSCALL(name, err, nr, args...) \
({ \
__label__ out; \
long v_ret; \
@@ -79,20 +77,13 @@
out: \
v_ret; \
})
-# else
-# define INLINE_VSYSCALL(name, nr, args...) \
- INLINE_SYSCALL (name, nr, ##args)
-# define INTERNAL_VSYSCALL(name, err, nr, args...) \
- INTERNAL_SYSCALL (name, err, nr, ##args)
-# endif /* HAVE_VSYSCALL */
-
-# else /* SHARED */
+#else
# define INLINE_VSYSCALL(name, nr, args...) \
INLINE_SYSCALL (name, nr, ##args)
# define INTERNAL_VSYSCALL(name, err, nr, args...) \
INTERNAL_SYSCALL (name, err, nr, ##args)
-#endif /* SHARED */
+#endif /* defined SHARED && defined HAVE_VSYSCALL */
#endif /* SYSDEP_VDSO_LINUX_H */
--
2.17.1