summaryrefslogtreecommitdiff
path: root/sys/arch/vax
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-02-22 17:29:15 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-02-22 17:29:15 +0000
commitfd2152f9e652fb5e938bc8f02fac662062af5df2 (patch)
tree284884ee2de5ccea2086d64cb22b6536e745fdb9 /sys/arch/vax
parent8ddf0fc0955bdedd8f4fdff69c51e32bde9bef12 (diff)
Use an _BSD_FOO_T_ type declaration for off_t in machine/ansi.h to allow
off_t to be visible in stdio.h even in strict ansi mode. This is needed for ftello()/fseeko() and it allows us to remove the horrible fpos_t hack.
Diffstat (limited to 'sys/arch/vax')
-rw-r--r--sys/arch/vax/include/ansi.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/sys/arch/vax/include/ansi.h b/sys/arch/vax/include/ansi.h
index 6c8d17f049f..5a5f0c64bfb 100644
--- a/sys/arch/vax/include/ansi.h
+++ b/sys/arch/vax/include/ansi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ansi.h,v 1.6 1997/07/07 05:56:43 millert Exp $ */
+/* $OpenBSD: ansi.h,v 1.7 2000/02/22 17:29:14 millert Exp $ */
/* $NetBSD: ansi.h,v 1.5 1996/11/15 22:39:01 jtc Exp $ */
/*-
@@ -47,8 +47,6 @@
* typedef _SIZE_T_ size_t;
* #undef _SIZE_T_
* #endif
- *
- * Thanks, ANSI!
*/
#define _BSD_CLOCK_T_ unsigned long /* clock() */
#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
@@ -56,10 +54,31 @@
#define _BSD_SSIZE_T_ int /* byte count or error */
#define _BSD_TIME_T_ int /* time() */
#define _BSD_VA_LIST_ char * /* va_list */
-#define _BSD_WCHAR_T_ int /* wchar_t */
-#define _BSD_WINT_T_ int /* wint_t */
#define _BSD_CLOCKID_T_ int
#define _BSD_TIMER_T_ int
+/*
+ * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t
+ * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
+ * defined for ctype.h.
+ */
+#define _BSD_WCHAR_T_ int /* wchar_t */
+#define _BSD_WINT_T_ int /* wint_t */
+#define _BSD_RUNE_T_ int /* rune_t */
+
+/*
+ * We describe off_t here so its declaration can be visible to
+ * stdio without pulling in all of <sys/type.h>, thus appeasing ANSI.
+ */
+#define _BSD_OFF_T_ long long /* file offset */
#endif /* _ANSI_H_ */