Ensure MIN/MAX are defined in userspace builds of rx
authorRuss Allbery <rra@stanford.edu>
Thu, 3 Jan 2013 21:57:02 +0000 (13:57 -0800)
committerDerrick Brashear <shadow@your-file-system.com>
Fri, 4 Jan 2013 14:11:50 +0000 (06:11 -0800)
The include of <sys/param.h> was removed from rx_packet.h on
Linux 2.6 and later to fix kernel builds with 3.7, which doesn't
have that header in kernel space.  However, while kernel space
always provides MIN/MAX defines, userspace relied on the header.
On at least powerpc, no other include chain includes sys/param.h,
so MIN/MAX were left undefined.

Fix this by only skipping the include of <sys/param.h> on Linux
if building in kernel mode.

Change-Id: Icd2edd645ef4d18d626de8ce8b81ac07f37b1f21
Reviewed-on: http://gerrit.openafs.org/8870
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/rx/rx_packet.h

index b7cc508..f783472 100644 (file)
@@ -43,7 +43,7 @@
 #if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_USR_FBSD_ENV) && !defined(AFS_USR_DFBSD_ENV) && !defined(AFS_LINUX20_ENV)
 #include <sys/sysmacros.h>     /* MIN, MAX on Solaris */
 #endif
-#if !defined(AFS_LINUX26_ENV)
+#if !(defined(AFS_LINUX26_ENV) && defined(KERNEL))
 #include <sys/param.h>         /* MIN, MAX elsewhere */
 #endif
 #endif /* AFS_NT40_ENV */