]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
HPUX: Allow des.c to compile
authorAndrew Deason <adeason@sinenomine.net>
Tue, 21 Dec 2010 21:11:50 +0000 (16:11 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sun, 2 Jan 2011 14:22:01 +0000 (06:22 -0800)
The HP-UX compiler does not like des.c without 'register' keywords. Be
sufficiently retro so the build can continue.

Change-Id: Ief032712893d96c2c198da82238eefe6807082cd
Reviewed-on: http://gerrit.openafs.org/3571
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/des/des.c

index 813ef479859ed8a9b8c29b8471fb5911bdc34d34..1072d9db24dc2b709730bc6a24db0bd2f59c1034 100644 (file)
 
 #include "des_prototypes.h"
 
+#ifdef AFS_HPUX_ENV
+/* When compiling with '-g -O', the HP-UX compiler can get confused with
+ * including ip.c and fp.c below. The result is that the compiler spins on
+ * the CPU and never compiles the file. As a workaround, we can avoid this if
+ * R1 and L1 are declared 'register' (I'm guessing this has to do with the
+ * fact that they are used in ip.c/fp.c, and declaring them register avoids
+ * creating debugging information, and it's that debugging information that
+ * the compiler is flipping out over since they're in multiple .c files). So
+ * declare them as 'register' on HP-UX; only do it on HP-UX to minimize the
+ * scope of such a change, so we don't impact other platforms. */
+# define HPUX_REGISTER register
+#else
+# define HPUX_REGISTER
+#endif
+
 #define XPRT_DES
 
 #ifdef DEBUG
@@ -71,8 +86,8 @@ des_ecb_encrypt(void * clear, void * cipher,
 {
     /* better pass 8 bytes, length not checked here */
 
-    afs_uint32 R1 = 0;
-    afs_uint32 L1 = 0; /* R1 = r10, L1 = r9 */
+    HPUX_REGISTER afs_uint32 R1 = 0;
+    HPUX_REGISTER afs_uint32 L1 = 0;   /* R1 = r10, L1 = r9 */
     afs_uint32 R2 = 0, L2 = 0; /* R2 = r8, L2 = r7 */
     afs_int32 i;
     /* one more registers left on VAX, see below P_temp_p */