aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2011-07-17 23:52:23 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2011-07-17 23:52:23 +0200
commit418314e809358f324095d18267a71a2d4da79bcd (patch)
tree8712ef5231b0025e5f1969c6f0e8c80fdc5d9797
parent1b3b8ac2c6b8e652a56b6da71b6287e5d888a26d (diff)
downloadvideoteco-fork-418314e809358f324095d18267a71a2d4da79bcd.tar.gz
compute BITS_PER_INT automatically based on BITS_PER_CHAR
this is possible since BITS_PER_INT is not used in any preprocessor expression
-rw-r--r--teco.h11
1 files 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