diff options
author | Jim Meyering <jim@meyering.net> | 1996-04-21 14:17:13 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-04-21 14:17:13 +0000 |
commit | 5beebbd8da1b2db1d09f2633592e408a027bdb26 (patch) | |
tree | a342a67f4aa354ef82d38060caac95e8f06718ff /src | |
parent | 763d748cf26e79b716483c6b766358f2b17bb18c (diff) | |
download | coreutils-5beebbd8da1b2db1d09f2633592e408a027bdb26.tar.xz |
Include <values.h>.
[!BITSPERBYTE]: Define.
[OFF_T_MAX]: Use BITSPERBYTE, not 8, and cast the result to off_t.
Diffstat (limited to 'src')
-rw-r--r-- | src/od.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -75,10 +75,17 @@ typedef double LONG_DOUBLE; #ifndef ULONG_MAX # define ULONG_MAX ((unsigned long) ~(unsigned long) 0) #endif + +#if HAVE_VALUES_H +# include <values.h> +#endif + +#ifndef BITSPERBYTE +# define BITSPERBYTE 8 +#endif + #ifndef OFF_T_MAX -/* FIXME: is there a way to do this without relying on the - `8 bits per byte' assumption? */ -# define OFF_T_MAX (~((off_t)1 << (sizeof (off_t) * 8 - 1))) +# define OFF_T_MAX ((off_t)(~((off_t)1 << (sizeof (off_t) * BITSPERBYTE - 1)))) #endif #define STREQ(a,b) (strcmp((a), (b)) == 0) |