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-stable-1_4_12pre1~43 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8316535067b6c944621bc53afd3fa275ccaa1101;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 (cherry picked from commit 98f9b6ae2bafe69440c090443efb2f71ec15309c) Change-Id: Ied35fdf7c325dbc63bdef1e1ebb328c455bc0133 Reviewed-on: http://gerrit.openafs.org/957 --- diff --git a/src/config/afsconfig-windows.h b/src/config/afsconfig-windows.h index c0ce4f4cf..8d1f91540 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 346ef50d3..71c59b57f 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. @@ -247,7 +237,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;