From: Derrick Brashear Date: Fri, 11 Sep 2009 05:28:49 +0000 (-0400) Subject: des crypt cope with 64 bit longs X-Git-Tag: openafs-devel-1_5_63~16 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=98f9b6ae2bafe69440c090443efb2f71ec15309c;p=packages%2Fo%2Fopenafs.git des crypt cope with 64 bit longs we test for them in configure; instead of hardcoding it in yet another place, use the information we have Reviewed-on: http://gerrit.openafs.org/442 Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- diff --git a/src/config/afsconfig-windows.h b/src/config/afsconfig-windows.h index 337499092..05de66a82 100644 --- a/src/config/afsconfig-windows.h +++ b/src/config/afsconfig-windows.h @@ -33,6 +33,9 @@ /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + /* Define to `unsigned' if doesn't define. */ //#undef size_t unsigned int diff --git a/src/des/crypt.c b/src/des/crypt.c index 2f00a78f8..73e171967 100644 --- a/src/des/crypt.c +++ b/src/des/crypt.c @@ -83,16 +83,6 @@ #endif #endif -/* - * define "LONG_IS_32_BITS" only if sizeof(long)==4. - * This avoids use of bit fields (your compiler may be sloppy with them). - */ - -/* XXX shouldn't this be !AFS_64BIT_ENV ? */ -#if !defined(cray) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV) && !defined(AFS_PPC64_LINUX20_ENV) & !defined(AFS_S390X_LINUX20_ENV) -#define LONG_IS_32_BITS -#endif - /* * define "B64" to be the declaration for a 64 bit integer. * XXX this feature is currently unused, see "endian" comment below. @@ -240,7 +230,7 @@ STATIC prtab(); typedef union { unsigned char b[8]; struct { -#if defined(LONG_IS_32_BITS) +#if (SIZEOF_LONG == 4) /* long is often faster than a 32-bit bit field */ long i0; long i1;