aboutsummaryrefslogtreecommitdiff
path: root/chartype.h
diff options
context:
space:
mode:
Diffstat (limited to 'chartype.h')
-rw-r--r--chartype.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/chartype.h b/chartype.h
index 78407f6c4a31..eeeef156ead3 100644
--- a/chartype.h
+++ b/chartype.h
@@ -1,4 +1,4 @@
-/* $NetBSD: chartype.h,v 1.10 2011/11/16 01:45:10 christos Exp $ */
+/* $NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
* supports non-BMP code points without requiring UTF-16, but nothing
* seems to actually advertise this properly, despite Unicode 3.1 having
* been around since 2001... */
-#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__))
+#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#ifndef __STDC_ISO_10646__
/* In many places it is assumed that the first 127 code points are ASCII
* compatible, so ensure wchar_t indeed does ISO 10646 and not some other
@@ -72,6 +72,7 @@
#define FUN(prefix,rest) prefix ## _w ## rest
#define FUNW(type) type ## _w
#define TYPE(type) type ## W
+#define FCHAR "%lc"
#define FSTR "%ls"
#define STR(x) L ## x
#define UC(c) c
@@ -126,6 +127,7 @@ Width(wchar_t c)
#define FUN(prefix,rest) prefix ## _ ## rest
#define FUNW(type) type
#define TYPE(type) type
+#define FCHAR "%c"
#define FSTR "%s"
#define STR(x) x
#define UC(c) (unsigned char)(c)
@@ -189,7 +191,8 @@ public Char *ct_decode_string(const char *, ct_buffer_t *);
protected Char **ct_decode_argv(int, const char *[], ct_buffer_t *);
/* Resizes the conversion buffer(s) if needed. */
-protected void ct_conv_buff_resize(ct_buffer_t *, size_t, size_t);
+protected int ct_conv_cbuff_resize(ct_buffer_t *, size_t);
+protected int ct_conv_wbuff_resize(ct_buffer_t *, size_t);
protected ssize_t ct_encode_char(char *, size_t, Char);
protected size_t ct_enc_width(Char);
@@ -199,7 +202,8 @@ protected size_t ct_enc_width(Char);
#define ct_encode_string(s, b) (s)
#define ct_decode_string(s, b) (s)
#define ct_decode_argv(l, s, b) (s)
-#define ct_conv_buff_resize(b, os, ns)
+#define ct_conv_cbuff_resize(b, s) ((s) == (0))
+#define ct_conv_wbuff_resize(b, s) ((s) == (0))
#define ct_encode_char(d, l, s) (*d = s, 1)
#define ct_free_argv(s)
#endif