Cleanup after non-Linux code removal.

Conditions such as defined(LINUX) are always true now,
defined(FREEBSD) etc are always false.
When if directive has them as subexpressions, it can be simplified.
Another trivial changes here are fixes for directive indentation.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/defs.h b/defs.h
index 6cf3783..84b7d74 100644
--- a/defs.h
+++ b/defs.h
@@ -48,7 +48,7 @@
 
 /* Configuration section */
 #ifndef MAX_QUALS
-#if defined(LINUX) && defined(MIPS)
+#if defined(MIPS)
 #define MAX_QUALS	7000	/* maximum number of syscalls, signals, etc. */
 #else
 #define MAX_QUALS	2048	/* maximum number of syscalls, signals, etc. */
@@ -67,11 +67,6 @@
  * Make sure that all entries in all syscallent.h files
  * have nargs <= MAX_ARGS!
  * linux/<ARCH>/syscallent.h: all have nargs <= 6.
- * freebsd/i386/syscallent.h: one syscall with nargs = 8
- * (sys_sendfile, looks legitimate)
- * and one with nargs = 7 (sys_mmap, maybe it should have 6?).
- * sunos4/syscallent.h: all are <= 6.
- * svr4/syscallent.h: all are MA (MAX_ARGS), it's unclear what the real max is.
  */
 #ifndef MAX_ARGS
 #   define MAX_ARGS	6
@@ -578,8 +573,7 @@
 extern char *stpcpy(char *dst, const char *src);
 #endif
 
-#if !(defined(LINUX) && !defined(SPARC) && !defined(SPARC64) && !defined(IA64) \
-	&& !defined(SH))
+#if defined(SPARC) || defined(SPARC64) || defined(IA64) || defined(SH)
 extern long getrval2(struct tcb *);
 #endif
 
diff --git a/desc.c b/desc.c
index 2d5ac5d..be327eb 100644
--- a/desc.c
+++ b/desc.c
@@ -465,13 +465,13 @@
 	return do_dup2(tcp, 2);
 }
 
-#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4)
+#if defined(ALPHA)
 int
 sys_getdtablesize(struct tcb *tcp)
 {
 	return 0;
 }
-#endif /* ALPHA || FREEBSD || SUNOS4 */
+#endif
 
 static int
 decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
diff --git a/file.c b/file.c
index a1d30b3..7e3e3fb 100644
--- a/file.c
+++ b/file.c
@@ -41,7 +41,7 @@
 	char            d_name[1];
 };
 
-#  ifdef LINUXSPARC
+#ifdef LINUXSPARC
 struct stat {
 	unsigned short	st_dev;
 	unsigned int	st_ino;
@@ -61,7 +61,7 @@
 	int		st_blocks;
 	unsigned int	__unused4[2];
 };
-#if defined(SPARC64)
+# if defined(SPARC64)
 struct stat_sparc64 {
 	unsigned int	st_dev;
 	unsigned long	st_ino;
@@ -78,81 +78,82 @@
 	long		st_blocks;
 	unsigned long	__unused4[2];
 };
-#endif /* SPARC64 */
-#    define stat kernel_stat
-#    include <asm/stat.h>
-#    undef stat
-#  else
-#    undef dev_t
-#    undef ino_t
-#    undef mode_t
-#    undef nlink_t
-#    undef uid_t
-#    undef gid_t
-#    undef off_t
-#    undef loff_t
+# endif /* SPARC64 */
+# define stat kernel_stat
+# include <asm/stat.h>
+# undef stat
+#else
+# undef dev_t
+# undef ino_t
+# undef mode_t
+# undef nlink_t
+# undef uid_t
+# undef gid_t
+# undef off_t
+# undef loff_t
 
-#    define dev_t __kernel_dev_t
-#    define ino_t __kernel_ino_t
-#    define mode_t __kernel_mode_t
-#    define nlink_t __kernel_nlink_t
-#    define uid_t __kernel_uid_t
-#    define gid_t __kernel_gid_t
-#    define off_t __kernel_off_t
-#    define loff_t __kernel_loff_t
+# define dev_t __kernel_dev_t
+# define ino_t __kernel_ino_t
+# define mode_t __kernel_mode_t
+# define nlink_t __kernel_nlink_t
+# define uid_t __kernel_uid_t
+# define gid_t __kernel_gid_t
+# define off_t __kernel_off_t
+# define loff_t __kernel_loff_t
 
-#    include <asm/stat.h>
+# include <asm/stat.h>
 
-#    undef dev_t
-#    undef ino_t
-#    undef mode_t
-#    undef nlink_t
-#    undef uid_t
-#    undef gid_t
-#    undef off_t
-#    undef loff_t
+# undef dev_t
+# undef ino_t
+# undef mode_t
+# undef nlink_t
+# undef uid_t
+# undef gid_t
+# undef off_t
+# undef loff_t
 
-#    define dev_t dev_t
-#    define ino_t ino_t
-#    define mode_t mode_t
-#    define nlink_t nlink_t
-#    define uid_t uid_t
-#    define gid_t gid_t
-#    define off_t off_t
-#    define loff_t loff_t
-#  endif
-#  ifdef HPPA	/* asm-parisc/stat.h defines stat64 */
-#    undef stat64
-#  endif
-#  define stat libc_stat
-#  define stat64 libc_stat64
-#  include <sys/stat.h>
-#  undef stat
-#  undef stat64
-   /* These might be macros. */
-#  undef st_atime
-#  undef st_mtime
-#  undef st_ctime
-#  ifdef HPPA
-#    define stat64 hpux_stat64
-#  endif
+# define dev_t dev_t
+# define ino_t ino_t
+# define mode_t mode_t
+# define nlink_t nlink_t
+# define uid_t uid_t
+# define gid_t gid_t
+# define off_t off_t
+# define loff_t loff_t
+#endif
+
+#ifdef HPPA	/* asm-parisc/stat.h defines stat64 */
+# undef stat64
+#endif
+#define stat libc_stat
+#define stat64 libc_stat64
+#include <sys/stat.h>
+#undef stat
+#undef stat64
+ /* These might be macros. */
+#undef st_atime
+#undef st_mtime
+#undef st_ctime
+#ifdef HPPA
+# define stat64 hpux_stat64
+#endif
 
 #include <fcntl.h>
 
 
 #ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
+# include <sys/vfs.h>
 #endif
 
 #ifdef HAVE_LINUX_XATTR_H
-#include <linux/xattr.h>
+# include <linux/xattr.h>
 #else
-#define XATTR_CREATE 1
-#define XATTR_REPLACE 2
+# define XATTR_CREATE 1
+# define XATTR_REPLACE 2
 #endif
 
 
-#if _LFS64_LARGEFILE && (defined(LINUX) || defined(SVR4))
+#if _LFS64_LARGEFILE
 # ifdef HAVE_INTTYPES_H
 #  include <inttypes.h>
 # else
@@ -166,27 +167,27 @@
  * Ugly hacks for systems that have typedef long long off_t
  */
 
-#define stat64 stat
-#define HAVE_STAT64 1	/* Ugly hack */
+# define stat64 stat
+# define HAVE_STAT64 1	/* Ugly hack */
 
-#define	sys_stat64	sys_stat
-#define sys_fstat64	sys_fstat
-#define sys_lstat64	sys_lstat
-#define sys_lseek64	sys_lseek
-#define sys_truncate64	sys_truncate
-#define sys_ftruncate64	sys_ftruncate
+# define sys_stat64	sys_stat
+# define sys_fstat64	sys_fstat
+# define sys_lstat64	sys_lstat
+# define sys_lseek64	sys_lseek
+# define sys_truncate64	sys_truncate
+# define sys_ftruncate64	sys_ftruncate
 #endif
 
 #ifdef MAJOR_IN_SYSMACROS
-#include <sys/sysmacros.h>
+# include <sys/sysmacros.h>
 #endif
 
 #ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
+# include <sys/mkdev.h>
 #endif
 
 #ifdef HAVE_SYS_ASYNCH_H
-#include <sys/asynch.h>
+# include <sys/asynch.h>
 #endif
 
 
@@ -830,7 +831,7 @@
 #endif /* SPARC64 */
 #endif /* LINUXSPARC */
 
-#if defined LINUX && defined POWERPC64
+#if defined POWERPC64
 struct stat_powerpc32 {
 	unsigned int	st_dev;
 	unsigned int	st_ino;
@@ -893,7 +894,7 @@
 	else
 		tprints("...}");
 }
-#endif /* LINUX && POWERPC64 */
+#endif /* POWERPC64 */
 
 static const struct xlat fileflags[] = {
 	{ 0,		NULL		},
@@ -994,7 +995,7 @@
 #endif
 #endif /* LINUXSPARC */
 
-#if defined LINUX && defined POWERPC64
+#if defined POWERPC64
 	if (current_personality == 1) {
 		printstat_powerpc32(tcp, addr);
 		return;
@@ -1010,7 +1011,7 @@
 }
 #endif	/* !HAVE_LONG_LONG_OFF_T */
 
-#if !defined HAVE_STAT64 && defined LINUX && defined X86_64
+#if !defined HAVE_STAT64 && defined X86_64
 /*
  * Linux x86_64 has unified `struct stat' but its i386 biarch needs
  * `struct stat64'.  Its <asm-i386/stat.h> definition expects 32-bit `long'.
@@ -1074,7 +1075,7 @@
 # endif
 #endif /* LINUXSPARC */
 
-#if defined LINUX && defined X86_64
+#if defined X86_64
 	if (current_personality == 0) {
 		printstat(tcp, addr);
 		return;
@@ -1162,8 +1163,7 @@
 }
 #endif /* HAVE_STAT64 */
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
-    && !defined(HAVE_LONG_LONG_OFF_T)
+#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) && !defined(HAVE_LONG_LONG_OFF_T)
 static void
 convertoldstat(const struct __old_kernel_stat *oldbuf, struct stat *newbuf)
 {
@@ -1198,12 +1198,12 @@
 		return;
 	}
 
-#ifdef LINUXSPARC
+# ifdef LINUXSPARC
 	if (current_personality == 1) {
 		printstatsol(tcp, addr);
 		return;
 	}
-#endif /* LINUXSPARC */
+# endif
 
 	if (umove(tcp, addr, &statbuf) < 0) {
 		tprints("{...}");
@@ -1213,7 +1213,7 @@
 	convertoldstat(&statbuf, &newstatbuf);
 	realprintstat(tcp, &newstatbuf);
 }
-#endif /* LINUX && !IA64 && !HPPA && !X86_64 && !S390 && !S390X */
+#endif
 
 #ifndef HAVE_LONG_LONG_OFF_T
 int
@@ -1278,8 +1278,7 @@
 	return 0;
 }
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
-    && !defined(HAVE_LONG_LONG_OFF_T)
+#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldstat(struct tcb *tcp)
 {
@@ -1291,7 +1290,7 @@
 	}
 	return 0;
 }
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
 
 #ifndef HAVE_LONG_LONG_OFF_T
 int
@@ -1323,8 +1322,7 @@
 #endif
 }
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
-    && !defined(HAVE_LONG_LONG_OFF_T)
+#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldfstat(struct tcb *tcp)
 {
@@ -1336,7 +1334,7 @@
 	}
 	return 0;
 }
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
 
 #ifndef HAVE_LONG_LONG_OFF_T
 int
@@ -1368,8 +1366,7 @@
 #endif
 }
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
-    && !defined(HAVE_LONG_LONG_OFF_T)
+#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldlstat(struct tcb *tcp)
 {
@@ -1381,10 +1378,10 @@
 	}
 	return 0;
 }
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
 
 
-#if defined(SVR4) || defined(LINUXSPARC)
+#if defined(LINUXSPARC)
 
 int
 sys_xstat(struct tcb *tcp)
@@ -1394,11 +1391,11 @@
 		printpath(tcp, tcp->u_arg[1]);
 		tprints(", ");
 	} else {
-#ifdef _STAT64_VER
+# ifdef _STAT64_VER
 		if (tcp->u_arg[0] == _STAT64_VER)
 			printstat64 (tcp, tcp->u_arg[2]);
 		else
-#endif
+# endif
 		printstat(tcp, tcp->u_arg[2]);
 	}
 	return 0;
@@ -1410,11 +1407,11 @@
 	if (entering(tcp))
 		tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
 	else {
-#ifdef _STAT64_VER
+# ifdef _STAT64_VER
 		if (tcp->u_arg[0] == _STAT64_VER)
 			printstat64 (tcp, tcp->u_arg[2]);
 		else
-#endif
+# endif
 		printstat(tcp, tcp->u_arg[2]);
 	}
 	return 0;
@@ -1428,11 +1425,11 @@
 		printpath(tcp, tcp->u_arg[1]);
 		tprints(", ");
 	} else {
-#ifdef _STAT64_VER
+# ifdef _STAT64_VER
 		if (tcp->u_arg[0] == _STAT64_VER)
 			printstat64 (tcp, tcp->u_arg[2]);
 		else
-#endif
+# endif
 		printstat(tcp, tcp->u_arg[2]);
 	}
 	return 0;
@@ -1449,15 +1446,9 @@
 		tprintf(", %s", sprintmode(mode));
 		switch (mode & S_IFMT) {
 		case S_IFCHR: case S_IFBLK:
-#ifdef LINUXSPARC
 			tprintf(", makedev(%lu, %lu)",
 				(unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
 				(unsigned long) (tcp->u_arg[3] & 0x3ffff));
-#else
-			tprintf(", makedev(%lu, %lu)",
-				(unsigned long) major(tcp->u_arg[3]),
-				(unsigned long) minor(tcp->u_arg[3]));
-#endif
 			break;
 		default:
 			break;
@@ -1466,29 +1457,29 @@
 	return 0;
 }
 
-#ifdef HAVE_SYS_ACL_H
+# ifdef HAVE_SYS_ACL_H
 
-#include <sys/acl.h>
+#  include <sys/acl.h>
 
 static const struct xlat aclcmds[] = {
-#ifdef SETACL
+#  ifdef SETACL
 	{ SETACL,	"SETACL"	},
-#endif
-#ifdef GETACL
+#  endif
+#  ifdef GETACL
 	{ GETACL,	"GETACL"	},
-#endif
-#ifdef GETACLCNT
+#  endif
+#  ifdef GETACLCNT
 	{ GETACLCNT,	"GETACLCNT"	},
-#endif
-#ifdef ACL_GET
+#  endif
+#  ifdef ACL_GET
 	{ ACL_GET,	"ACL_GET"	},
-#endif
-#ifdef ACL_SET
+#  endif
+#  ifdef ACL_SET
 	{ ACL_SET,	"ACL_SET"	},
-#endif
-#ifdef ACL_CNT
+#  endif
+#  ifdef ACL_CNT
 	{ ACL_CNT,	"ACL_CNT"	},
-#endif
+#  endif
 	{ 0,		NULL		},
 };
 
@@ -1534,15 +1525,15 @@
 
 
 static const struct xlat aclipc[] = {
-#ifdef IPC_SHM
+#  ifdef IPC_SHM
 	{ IPC_SHM,	"IPC_SHM"	},
-#endif
-#ifdef IPC_SEM
+#  endif
+#  ifdef IPC_SEM
 	{ IPC_SEM,	"IPC_SEM"	},
-#endif
-#ifdef IPC_MSG
+#  endif
+#  ifdef IPC_MSG
 	{ IPC_MSG,	"IPC_MSG"	},
-#endif
+#  endif
 	{ 0,		NULL		},
 };
 
@@ -1567,9 +1558,9 @@
 	return 0;
 }
 
-#endif /* HAVE_SYS_ACL_H */
+# endif /* HAVE_SYS_ACL_H */
 
-#endif /* SVR4 || LINUXSPARC */
+#endif /* LINUXSPARC */
 
 
 static const struct xlat fsmagic[] = {
@@ -1687,7 +1678,7 @@
 	return 0;
 }
 
-#if defined LINUX && defined HAVE_STATFS64
+#if defined HAVE_STATFS64
 static void
 printstatfs64(struct tcb *tcp, long addr)
 {
@@ -1804,8 +1795,7 @@
 }
 #endif
 
-#if defined(LINUX) && defined(__alpha)
-
+#if defined(__alpha)
 int
 osf_statfs(struct tcb *tcp)
 {
@@ -1830,8 +1820,7 @@
 	}
 	return 0;
 }
-#endif /* LINUX && __alpha */
-
+#endif
 
 
 /* directory */
diff --git a/io.c b/io.c
index 9aa0ddd..7dff4e6 100644
--- a/io.c
+++ b/io.c
@@ -69,7 +69,7 @@
 void
 tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov)
 {
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
 	union {
 		struct { u_int32_t base; u_int32_t len; } iov32;
 		struct { u_int64_t base; u_int64_t len; } iov64;
diff --git a/ipc.c b/ipc.c
index 963537e..d8757c1 100644
--- a/ipc.c
+++ b/ipc.c
@@ -62,7 +62,7 @@
 #define SEM_INFO 19
 #endif
 
-#if defined LINUX && !defined IPC_64
+#if !defined IPC_64
 # define IPC_64 0x100
 #endif
 
@@ -421,11 +421,11 @@
 		if (syserror(tcp))
 			return 0;
 /* HPPA does not use an IPC multiplexer on Linux.  */
-#if defined(LINUX) && !defined(HPPA)
+#if !defined(HPPA)
 		if (umove(tcp, tcp->u_arg[2], &raddr) < 0)
 			return RVAL_NONE;
 		tcp->u_rval = raddr;
-#endif /* LINUX */
+#endif
 		return RVAL_HEX;
 	}
 	return 0;
diff --git a/mem.c b/mem.c
index e8bad07..252486a 100644
--- a/mem.c
+++ b/mem.c
@@ -37,13 +37,13 @@
 #include <asm/mman.h>
 #include <sys/mman.h>
 
-#if defined(LINUX) && defined(I386)
+#if defined(I386)
 # include <asm/ldt.h>
 # ifdef HAVE_STRUCT_USER_DESC
 #  define modify_ldt_ldt_s user_desc
 # endif
 #endif
-#if defined(LINUX) && defined(SH64)
+#if defined(SH64)
 # include <asm/page.h>	    /* for PAGE_SHIFT */
 #endif
 
@@ -299,7 +299,7 @@
 	 * from pages to bytes. See test/mmap_offset_decode.c
 	 * Why SH64 and i386 are handled differently?
 	 */
-#if defined(LINUX) && defined(SH64)
+#if defined(SH64)
 	/*
 	 * Old mmap differs from new mmap in specifying the
 	 * offset in units of bytes rather than pages.  We
@@ -325,7 +325,7 @@
 sys_mmap64(struct tcb *tcp)
 {
 	if (entering(tcp)) {
-#if !defined(LINUX) || defined(ALPHA)
+#if defined(ALPHA)
 		long *u_arg = tcp->u_arg;
 #else
 		long u_arg[7];
@@ -354,7 +354,7 @@
 		tprints(", ");
 		printfd(tcp, u_arg[4]);
 		/* offset */
-#if !defined(LINUX) || defined(ALPHA)
+#if defined(ALPHA)
 		printllval(tcp, ", %#llx", 5);
 #else
 		/* NOTE: not verified that [5] and [6] should be used.
@@ -574,7 +574,7 @@
 	return 0;
 }
 
-#if defined(ALPHA) || defined(FREEBSD) || defined(IA64) || defined(SUNOS4) || defined(SVR4) || defined(SPARC) || defined(SPARC64)
+#if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64)
 int
 sys_getpagesize(struct tcb *tcp)
 {
@@ -582,9 +582,9 @@
 		return RVAL_HEX;
 	return 0;
 }
-#endif /* ALPHA || FREEBSD || IA64 || SUNOS4 || SVR4 */
+#endif
 
-#if defined(LINUX) && defined(__i386__)
+#if defined(__i386__)
 void
 print_ldt_entry(struct modify_ldt_ldt_s *ldt_entry)
 {
@@ -676,10 +676,9 @@
 	return 0;
 
 }
-#endif /* LINUX && __i386__ */
+#endif /* __i386__ */
 
-#if defined(LINUX) && defined(M68K)
-
+#if defined(M68K)
 int
 sys_set_thread_area(struct tcb *tcp)
 {
@@ -910,7 +909,7 @@
 	return 0;
 }
 
-#if defined(LINUX) && defined(POWERPC)
+#if defined(POWERPC)
 int
 sys_subpage_prot(struct tcb *tcp)
 {
diff --git a/net.c b/net.c
index e7d2a07..3955f16 100644
--- a/net.c
+++ b/net.c
@@ -1218,7 +1218,7 @@
 #ifdef HAVE_INET_NTOP
 		struct sockaddr_in6 sa6;
 #endif
-#if defined(LINUX) && defined(AF_IPX)
+#if defined(AF_IPX)
 		struct sockaddr_ipx sipx;
 #endif
 #ifdef AF_PACKET
@@ -1297,7 +1297,7 @@
 #endif
 		break;
 #endif
-#if defined(AF_IPX) && defined(linux)
+#if defined(AF_IPX)
 	case AF_IPX:
 		{
 			int i;
@@ -1315,7 +1315,7 @@
 			tprintf("/[%02x]", addrbuf.sipx.sipx_type);
 		}
 		break;
-#endif /* AF_IPX && linux */
+#endif /* AF_IPX */
 #ifdef AF_PACKET
 	case AF_PACKET:
 		{
@@ -1332,7 +1332,7 @@
 		}
 		break;
 
-#endif /* AF_APACKET */
+#endif /* AF_PACKET */
 #ifdef AF_NETLINK
 	case AF_NETLINK:
 		tprintf("pid=%d, groups=%08x", addrbuf.nl.nl_pid, addrbuf.nl.nl_groups);
@@ -1800,14 +1800,14 @@
 		if (syserror(tcp)) {
 			tprintf("%#lx", tcp->u_arg[0]);
 		} else {
-#if defined(LINUX) && !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64)
+#if !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64)
 			int fds[2];
 
 			if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0)
 				tprints("[...]");
 			else
 				tprintf("[%u, %u]", fds[0], fds[1]);
-#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(SVR4) || defined(FREEBSD) || defined(IA64)
+#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(IA64)
 			tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
 #else
 			tprintf("%#lx", tcp->u_arg[0]);
diff --git a/process.c b/process.c
index 699355b..20cfe20 100644
--- a/process.c
+++ b/process.c
@@ -52,50 +52,50 @@
 
 #ifdef HAVE_SYS_REG_H
 # include <sys/reg.h>
-#ifndef PTRACE_PEEKUSR
-# define PTRACE_PEEKUSR PTRACE_PEEKUSER
-#endif
-#ifndef PTRACE_POKEUSR
-# define PTRACE_POKEUSR PTRACE_POKEUSER
-#endif
+# ifndef PTRACE_PEEKUSR
+#  define PTRACE_PEEKUSR PTRACE_PEEKUSER
+# endif
+# ifndef PTRACE_POKEUSR
+#  define PTRACE_POKEUSR PTRACE_POKEUSER
+# endif
 #endif
 
 #ifdef HAVE_LINUX_PTRACE_H
-#undef PTRACE_SYSCALL
+# undef PTRACE_SYSCALL
 # ifdef HAVE_STRUCT_IA64_FPREG
 #  define ia64_fpreg XXX_ia64_fpreg
 # endif
 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
 #  define pt_all_user_regs XXX_pt_all_user_regs
 # endif
-#include <linux/ptrace.h>
+# include <linux/ptrace.h>
 # undef ia64_fpreg
 # undef pt_all_user_regs
 #endif
 
-#if defined (LINUX) && defined (SPARC64)
+#if defined(SPARC64)
 # define r_pc r_tpc
 # undef PTRACE_GETREGS
 # define PTRACE_GETREGS PTRACE_GETREGS64
 # undef PTRACE_SETREGS
 # define PTRACE_SETREGS PTRACE_SETREGS64
-#endif /* LINUX && SPARC64 */
+#endif
 
 #ifdef HAVE_LINUX_FUTEX_H
 # include <linux/futex.h>
 #endif
-# ifndef FUTEX_WAIT
-#  define FUTEX_WAIT 0
-# endif
-# ifndef FUTEX_WAKE
-#  define FUTEX_WAKE 1
-# endif
-# ifndef FUTEX_FD
-#  define FUTEX_FD 2
-# endif
-# ifndef FUTEX_REQUEUE
-#  define FUTEX_REQUEUE 3
-# endif
+#ifndef FUTEX_WAIT
+# define FUTEX_WAIT 0
+#endif
+#ifndef FUTEX_WAKE
+# define FUTEX_WAKE 1
+#endif
+#ifndef FUTEX_FD
+# define FUTEX_FD 2
+#endif
+#ifndef FUTEX_REQUEUE
+# define FUTEX_REQUEUE 3
+#endif
 
 #include <sched.h>
 #include <asm/posix_types.h>
@@ -104,7 +104,7 @@
 #undef GETGROUPS32_T
 #define GETGROUPS32_T __kernel_gid32_t
 
-#if defined(LINUX) && defined(IA64)
+#if defined(IA64)
 # include <asm/ptrace_offsets.h>
 # include <asm/rse.h>
 #endif
@@ -360,7 +360,7 @@
 	return 0;
 }
 
-#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA)
 int
 sys_gethostname(struct tcb *tcp)
 {
@@ -373,7 +373,7 @@
 	}
 	return 0;
 }
-#endif /* ALPHA || FREEBSD || SUNOS4 || SVR4 */
+#endif
 
 int
 sys_setdomainname(struct tcb *tcp)
@@ -1068,7 +1068,7 @@
 	return 0;
 }
 
-#if defined(ALPHA) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA)
 int
 sys_setpgrp(struct tcb *tcp)
 {
@@ -1077,7 +1077,7 @@
 	}
 	return 0;
 }
-#endif /* ALPHA || SUNOS4 || SVR4 */
+#endif
 
 int
 sys_getpgrp(struct tcb *tcp)
@@ -1165,7 +1165,7 @@
 	tprintf(fmt, count, count == 1 ? "" : "s");
 }
 
-#if defined(SPARC) || defined(SPARC64) || defined(SUNOS4)
+#if defined(SPARC) || defined(SPARC64)
 int
 sys_execv(struct tcb *tcp)
 {
@@ -1181,7 +1181,7 @@
 	}
 	return 0;
 }
-#endif /* SPARC || SPARC64 || SUNOS4 */
+#endif
 
 int
 sys_execve(struct tcb *tcp)
@@ -1209,11 +1209,10 @@
 }
 
 
-#if defined SUNOS4 || (defined LINUX && defined TCB_WAITEXECVE)
+#if defined(TCB_WAITEXECVE)
 int
 internal_exec(struct tcb *tcp)
 {
-# if defined LINUX && defined TCB_WAITEXECVE
 	if (exiting(tcp) && syserror(tcp))
 		tcp->flags &= ~TCB_WAITEXECVE;
 	else {
@@ -1221,7 +1220,6 @@
 		if (!(ptrace_setoptions & PTRACE_O_TRACEEXEC))
 			tcp->flags |= TCB_WAITEXECVE; /* no */
 	}
-# endif
 	return 0;
 }
 #endif
diff --git a/resource.c b/resource.c
index b340ccd..9040b05 100644
--- a/resource.c
+++ b/resource.c
@@ -118,7 +118,7 @@
 	return buf;
 }
 
-# if defined LINUX && (defined POWERPC64 || defined X86_64)
+# if defined POWERPC64 || defined X86_64
 static void
 print_rlimit32(struct tcb *tcp)
 {
@@ -152,7 +152,7 @@
 	else {
 		if (syserror(tcp) || !verbose(tcp))
 			tprintf("%#lx", tcp->u_arg[1]);
-# if defined LINUX && (defined POWERPC64 || defined X86_64)
+# if defined POWERPC64 || defined X86_64
 		else if (current_personality == 1)
 			print_rlimit32(tcp);
 # endif
@@ -176,7 +176,7 @@
 		tprints(", ");
 		if (!verbose(tcp))
 			tprintf("%#lx", tcp->u_arg[1]);
-# if defined LINUX && (defined POWERPC64 || defined X86_64)
+# if defined POWERPC64 || defined X86_64
 		else if (current_personality == 1)
 			print_rlimit32(tcp);
 # endif
diff --git a/signal.c b/signal.c
index f9e826c..eab5c52 100644
--- a/signal.c
+++ b/signal.c
@@ -43,21 +43,21 @@
 
 #ifdef HAVE_SYS_REG_H
 # include <sys/reg.h>
-#ifndef PTRACE_PEEKUSR
-# define PTRACE_PEEKUSR PTRACE_PEEKUSER
-#endif
-#ifndef PTRACE_POKEUSR
-# define PTRACE_POKEUSR PTRACE_POKEUSER
-#endif
+# ifndef PTRACE_PEEKUSR
+#  define PTRACE_PEEKUSR PTRACE_PEEKUSER
+# endif
+# ifndef PTRACE_POKEUSR
+#  define PTRACE_POKEUSR PTRACE_POKEUSER
+# endif
 #elif defined(HAVE_LINUX_PTRACE_H)
-#undef PTRACE_SYSCALL
+# undef PTRACE_SYSCALL
 # ifdef HAVE_STRUCT_IA64_FPREG
 #  define ia64_fpreg XXX_ia64_fpreg
 # endif
 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
 #  define pt_all_user_regs XXX_pt_all_user_regs
 # endif
-#include <linux/ptrace.h>
+# include <linux/ptrace.h>
 # undef ia64_fpreg
 # undef pt_all_user_regs
 #endif
@@ -68,24 +68,24 @@
 # include <asm/ptrace_offsets.h>
 #endif
 
-#if defined (LINUX) && defined (SPARC64)
+#if defined(SPARC64)
 # undef PTRACE_GETREGS
 # define PTRACE_GETREGS PTRACE_GETREGS64
 # undef PTRACE_SETREGS
 # define PTRACE_SETREGS PTRACE_SETREGS64
-#endif /* LINUX && SPARC64 */
+#endif
 
-#if defined (SPARC) || defined (SPARC64) || defined (MIPS)
+#if defined(SPARC) || defined(SPARC64) || defined(MIPS)
 typedef struct {
 	struct pt_regs		si_regs;
 	int			si_mask;
 } m_siginfo_t;
 #elif defined HAVE_ASM_SIGCONTEXT_H
-#if !defined(IA64) && !defined(X86_64)
-#include <asm/sigcontext.h>
-#endif /* !IA64 && !X86_64 */
+# if !defined(IA64) && !defined(X86_64)
+#  include <asm/sigcontext.h>
+# endif /* !IA64 && !X86_64 */
 #else /* !HAVE_ASM_SIGCONTEXT_H */
-#if defined I386 && !defined HAVE_STRUCT_SIGCONTEXT_STRUCT
+# if defined I386 && !defined HAVE_STRUCT_SIGCONTEXT_STRUCT
 struct sigcontext_struct {
 	unsigned short gs, __gsh;
 	unsigned short fs, __fsh;
@@ -110,8 +110,8 @@
 	unsigned long oldmask;
 	unsigned long cr2;
 };
-#else /* !I386 */
-#if defined M68K && !defined HAVE_STRUCT_SIGCONTEXT
+# else /* !I386 */
+#  if defined M68K && !defined HAVE_STRUCT_SIGCONTEXT
 struct sigcontext
 {
 	unsigned long sc_mask;
@@ -124,25 +124,25 @@
 	unsigned long sc_pc;
 	unsigned short sc_formatvec;
 };
-#endif /* M68K */
-#endif /* !I386 */
+#  endif /* M68K */
+# endif /* !I386 */
 #endif /* !HAVE_ASM_SIGCONTEXT_H */
 
 #ifndef NSIG
-#warning: NSIG is not defined, using 32
-#define NSIG 32
+# warning: NSIG is not defined, using 32
+# define NSIG 32
 #endif
 #ifdef ARM
 /* Ugh. Is this really correct? ARM has no RT signals?! */
-#undef NSIG
-#define NSIG 32
+# undef NSIG
+# define NSIG 32
 #endif
 
 
 
 #ifdef HAVE_SIGACTION
 
-#if defined LINUX && (defined I386 || defined X86_64)
+#if defined I386 || defined X86_64
 /* The libc headers do not define this constant since it should only be
    used by the implementation.  So we define it here.  */
 # ifndef SA_RESTORER
@@ -427,7 +427,7 @@
 
 #define SI_FROMUSER(sip)	((sip)->si_code <= 0)
 
-#endif /* LINUX */
+#endif
 
 #if __GLIBC_MINOR__ < 1
 /* Type for data associated with a signal.  */
@@ -1141,7 +1141,7 @@
 
 
 
-#if defined LINUX && !defined SS_ONSTACK
+#if !defined SS_ONSTACK
 #define SS_ONSTACK      1
 #define SS_DISABLE      2
 #if __GLIBC_MINOR__ == 0
diff --git a/strace.c b/strace.c
index bda091e..66dee5f 100644
--- a/strace.c
+++ b/strace.c
@@ -58,7 +58,7 @@
 #  define my_tkill(tid, sig) kill((tid), (sig))
 # endif
 
-#if defined(IA64) && defined(LINUX)
+#if defined(IA64)
 # include <asm/ptrace_offsets.h>
 #endif
 
diff --git a/stream.c b/stream.c
index a5bd831..3eb7dde 100644
--- a/stream.c
+++ b/stream.c
@@ -120,7 +120,7 @@
 	return 0;
 }
 
-#if defined(SPARC) || defined(SPARC64) || defined(SUNOS4) || defined(SVR4)
+#if defined(SPARC) || defined(SPARC64)
 int
 sys_getmsg(struct tcb *tcp)
 {
@@ -166,7 +166,7 @@
 	}
 	return RVAL_HEX | RVAL_STR;
 }
-#endif /* SPARC || SPARC64 || SUNOS4 || SVR4 */
+#endif
 
 #if defined SYS_putpmsg || defined SYS_getpmsg
 static const struct xlat pmsgflags[] = {
diff --git a/syscall.c b/syscall.c
index 978c65a..b94ad65 100644
--- a/syscall.c
+++ b/syscall.c
@@ -60,14 +60,14 @@
 # undef pt_all_user_regs
 #endif
 
-#if defined (LINUX) && defined (SPARC64)
+#if defined(SPARC64)
 # undef PTRACE_GETREGS
 # define PTRACE_GETREGS PTRACE_GETREGS64
 # undef PTRACE_SETREGS
 # define PTRACE_SETREGS PTRACE_SETREGS64
-#endif /* LINUX && SPARC64 */
+#endif
 
-#if defined(LINUX) && defined(IA64)
+#if defined(IA64)
 # include <asm/ptrace_offsets.h>
 # include <asm/rse.h>
 #endif
@@ -523,7 +523,7 @@
 
 enum subcall_style { shift_style, deref_style, mask_style, door_style };
 
-#if !(defined(LINUX) && ( defined(ALPHA) || defined(MIPS) || defined(__ARM_EABI__) ))
+#if !(defined(ALPHA) || defined(MIPS) || defined(__ARM_EABI__))
 
 static void
 decode_subcall(struct tcb *tcp, int subcall, int nsubcalls, enum subcall_style style)
@@ -1206,9 +1206,9 @@
 	   )
 		return internal_fork(tcp);
 
-#if defined SUNOS4 || (defined LINUX && defined TCB_WAITEXECVE)
+#if defined(TCB_WAITEXECVE)
 	if (   sys_execve == func
-# if defined(SPARC) || defined(SPARC64) || defined(SUNOS4)
+# if defined(SPARC) || defined(SPARC64)
 	    || sys_execv == func
 # endif
 	   )
diff --git a/time.c b/time.c
index 86f102e..4cc9c59 100644
--- a/time.c
+++ b/time.c
@@ -81,7 +81,7 @@
 		return buf + sprintf(buf, "%#lx", addr);
 
 	if (bitness == BITNESS_32
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
 	    || personality_wordsize[current_personality] == 4
 #endif
 		)
@@ -137,7 +137,7 @@
 	else {
 		int rc;
 
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
 		if (personality_wordsize[current_personality] == 4) {
 			struct timeval32 tv;
 
@@ -291,7 +291,7 @@
 		int rc;
 
 		if (bitness == BITNESS_32
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
 		    || personality_wordsize[current_personality] == 4
 #endif
 			)
diff --git a/util.c b/util.c
index b7ba283..80acc13 100644
--- a/util.c
+++ b/util.c
@@ -44,27 +44,27 @@
 #include <sys/uio.h>
 #endif
 
-#if defined(linux) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
 #include <linux/ptrace.h>
 #endif
 
-#if defined(LINUX) && defined(IA64)
+#if defined(IA64)
 # include <asm/ptrace_offsets.h>
 # include <asm/rse.h>
 #endif
 
 #ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
+# include <sys/reg.h>
 # define PTRACE_PEEKUSR PTRACE_PEEKUSER
 #elif defined(HAVE_LINUX_PTRACE_H)
-#undef PTRACE_SYSCALL
+# undef PTRACE_SYSCALL
 # ifdef HAVE_STRUCT_IA64_FPREG
 #  define ia64_fpreg XXX_ia64_fpreg
 # endif
 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
 #  define pt_all_user_regs XXX_pt_all_user_regs
 # endif
-#include <linux/ptrace.h>
+# include <linux/ptrace.h>
 # undef ia64_fpreg
 # undef pt_all_user_regs
 #endif
@@ -246,7 +246,7 @@
 int
 printllval(struct tcb *tcp, const char *format, int llarg)
 {
-# if defined LINUX && (defined X86_64 || defined POWERPC64)
+# if defined X86_64 || defined POWERPC64
 	if (current_personality == 0) {
 		tprintf(format, tcp->u_arg[llarg]);
 		llarg++;
@@ -655,7 +655,7 @@
 void
 dumpiov(struct tcb *tcp, int len, long addr)
 {
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
 	union {
 		struct { u_int32_t base; u_int32_t len; } *iov32;
 		struct { u_int64_t base; u_int64_t len; } *iov64;