aboutsummaryrefslogtreecommitdiff
path: root/contrib/less/less.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/less/less.h')
-rw-r--r--contrib/less/less.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/contrib/less/less.h b/contrib/less/less.h
index 2063558cf75a..333e70a998ed 100644
--- a/contrib/less/less.h
+++ b/contrib/less/less.h
@@ -70,6 +70,9 @@
#if HAVE_CTYPE_H
#include <ctype.h>
#endif
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -80,7 +83,7 @@
#include <modes.h>
#include <strings.h>
#endif
-#if MSDOS_COMPILER==WIN32C
+#if MSDOS_COMPILER==WIN32C || OS2
#include <io.h>
#endif
#if MSDOS_COMPILER==DJGPPC
@@ -136,13 +139,21 @@ void free();
#define BAD_LSEEK ((off_t)-1)
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif
+
+/*
+ * Upper bound on the string length of an integer converted to string.
+ * 302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit;
+ * add 1 for integer division truncation; add 1 more for a minus sign.
+ */
+#define INT_STRLEN_BOUND(t) ((sizeof(t) * CHAR_BIT - 1) * 302 / 1000 + 1 + 1)
+
/*
* Special types and constants.
*/
typedef off_t POSITION;
-#define PR_POSITION "%ld"
-#define MAX_PRINT_POSITION 20
-#define MAX_PRINT_INT 10
#define NULL_POSITION ((POSITION)(-1))
@@ -179,7 +190,7 @@ typedef off_t POSITION;
#if MSDOS_COMPILER==MSOFTC
#define SET_BINARY(f) _setmode(f, _O_BINARY);
#else
-#if MSDOS_COMPILER
+#if MSDOS_COMPILER || OS2
#define SET_BINARY(f) setmode(f, O_BINARY)
#else
#define SET_BINARY(f)
@@ -283,6 +294,10 @@ struct textlist
#define AT_INVIS (4)
#define AT_STANDOUT (5)
+#if '0' == 240
+#define IS_EBCDIC_HOST 1
+#endif
+
#if IS_EBCDIC_HOST
/*
* Long definition for EBCDIC.