From 418314e809358f324095d18267a71a2d4da79bcd Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 17 Jul 2011 23:52:23 +0200 Subject: compute BITS_PER_INT automatically based on BITS_PER_CHAR this is possible since BITS_PER_INT is not used in any preprocessor expression --- teco.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/teco.h b/teco.h index 87af8b8..c77efa1 100644 --- a/teco.h +++ b/teco.h @@ -80,16 +80,17 @@ * conditional compilation based on different machines quirks can be done. */ +#ifndef BITS_PER_CHAR /** - * Unless defined otherwise, we assume 32 bits to an integer and 8 bits / char + * Unless defined otherwise, we assume 8 bits / char */ -#ifndef BITS_PER_INT -#define BITS_PER_INT 32 -#endif -#ifndef BITS_PER_CHAR #define BITS_PER_CHAR 8 #endif +#ifndef BITS_PER_INT +#define BITS_PER_INT (BITS_PER_CHAR * (int)sizeof(int)) +#endif + #define ESCAPE 27 #define RUBOUT 127 -- cgit v1.2.3