]> granicus.if.org Git - strace/commitdiff
defs.h: cleanup personality specific macro definitions
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 8 Aug 2016 21:11:47 +0000 (21:11 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 8 Aug 2016 21:11:47 +0000 (21:11 +0000)
Move the code that defines PERSONALITY[12]_INCLUDE_FUNCS,
PERSONALITY[12]_INCLUDE_PRINTERS_DECLS,
PERSONALITY[12]_INCLUDE_PRINTERS_DEFS, and MPERS_{m,mx}32_IOCTL_MACROS
macros outside arch specific ifdefs.

* defs.h [SPARC] (PERSONALITY0_WORDSIZE): Remove.
[SPARC64 && HAVE_M32_MPERS]: Remove.
[X86_64 && HAVE_M32_MPERS]: Remove.
[X86_64 && HAVE_MX32_MPERS]: Remove.
[X32 && HAVE_M32_MPERS]: Remove.
[AARCH64 && HAVE_M32_MPERS]: Remove.
[POWERPC64 && HAVE_M32_MPERS]: Remove.
[TILE && HAVE_M32_MPERS]: Remove.
(PERSONALITY0_INCLUDE_PRINTERS_DECLS,
PERSONALITY0_INCLUDE_PRINTERS_DEFS): Define unconditionally.
[SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS]
(PERSONALITY1_INCLUDE_PRINTERS_DECLS,
PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_FUNCS,
MPERS_m32_IOCTL_MACROS): Define for
[SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] case.
(PERSONALITY2_INCLUDE_PRINTERS_DECLS,
PERSONALITY2_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_FUNCS,
MPERS_mx32_IOCTL_MACROS): Define for
[SUPPORTED_PERSONALITIES > 2 && HAVE_MX32_MPERS] case.

defs.h

diff --git a/defs.h b/defs.h
index d94cb687930075bea839e455f4db961099f08d01..cf8a4d031cab83208e0cda59834ecb9a2aef9330 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -151,18 +151,10 @@ extern char *stpcpy(char *dst, const char *src);
 # define ERESTART_RESTARTBLOCK 516
 #endif
 
-#if defined(SPARC) || defined(SPARC64)
+#ifdef SPARC64
+# define SUPPORTED_PERSONALITIES 2
 # define PERSONALITY0_WORDSIZE 4
-# if defined(SPARC64)
-#  define SUPPORTED_PERSONALITIES 2
-#  define PERSONALITY1_WORDSIZE 8
-#  ifdef HAVE_M32_MPERS
-#   define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
-#   define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
-#   define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
-#   define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
-#  endif
-# endif
+# define PERSONALITY1_WORDSIZE 8
 #endif
 
 #ifdef X86_64
@@ -170,59 +162,24 @@ extern char *stpcpy(char *dst, const char *src);
 # define PERSONALITY0_WORDSIZE 8
 # define PERSONALITY1_WORDSIZE 4
 # define PERSONALITY2_WORDSIZE 4
-# ifdef HAVE_M32_MPERS
-#  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
-#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
-# endif
-# ifdef HAVE_MX32_MPERS
-#  define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h"
-#  define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h"
-#  define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h"
-#  define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h"
-# endif
 #endif
 
 #ifdef X32
 # define SUPPORTED_PERSONALITIES 2
 # define PERSONALITY0_WORDSIZE 4
 # define PERSONALITY1_WORDSIZE 4
-# ifdef HAVE_M32_MPERS
-#  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
-#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
-# endif
-#endif
-
-#ifdef ARM
-/* one personality */
 #endif
 
 #ifdef AARCH64
-/* The existing ARM personality, then AArch64 */
 # define SUPPORTED_PERSONALITIES 2
 # define PERSONALITY0_WORDSIZE 8
 # define PERSONALITY1_WORDSIZE 4
-# ifdef HAVE_M32_MPERS
-#  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
-#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
-# endif
 #endif
 
 #ifdef POWERPC64
 # define SUPPORTED_PERSONALITIES 2
 # define PERSONALITY0_WORDSIZE 8
 # define PERSONALITY1_WORDSIZE 4
-# ifdef HAVE_M32_MPERS
-#  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
-#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
-# endif
 #endif
 
 #ifdef TILE
@@ -232,12 +189,6 @@ extern char *stpcpy(char *dst, const char *src);
 # ifdef __tilepro__
 #  define DEFAULT_PERSONALITY 1
 # endif
-# ifdef HAVE_M32_MPERS
-#  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
-#  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
-#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
-# endif
 #endif
 
 #ifndef SUPPORTED_PERSONALITIES
@@ -250,31 +201,28 @@ extern char *stpcpy(char *dst, const char *src);
 # define PERSONALITY0_WORDSIZE SIZEOF_LONG
 #endif
 
-#ifndef PERSONALITY0_INCLUDE_PRINTERS_DECLS
-# define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
-#endif
-#ifndef PERSONALITY0_INCLUDE_PRINTERS_DEFS
-# define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
-#endif
+#define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
+#define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
 
-#ifndef PERSONALITY1_INCLUDE_PRINTERS_DECLS
+#if SUPPORTED_PERSONALITIES > 1 && defined HAVE_M32_MPERS
+# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
+# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
+# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
+#else
 # define PERSONALITY1_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
-#endif
-#ifndef PERSONALITY1_INCLUDE_PRINTERS_DEFS
 # define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
+# define PERSONALITY1_INCLUDE_FUNCS "empty.h"
 #endif
 
-#ifndef PERSONALITY2_INCLUDE_PRINTERS_DECLS
+#if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS
+# define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h"
+# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h"
+# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h"
+# define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h"
+#else
 # define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
-#endif
-#ifndef PERSONALITY2_INCLUDE_PRINTERS_DEFS
 # define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
-#endif
-
-#ifndef PERSONALITY1_INCLUDE_FUNCS
-# define PERSONALITY1_INCLUDE_FUNCS "empty.h"
-#endif
-#ifndef PERSONALITY2_INCLUDE_FUNCS
 # define PERSONALITY2_INCLUDE_FUNCS "empty.h"
 #endif