diff options
Diffstat (limited to 'openbsd-compat/openbsd-compat.h')
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 8cc8a11b7..37d2064cd 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h | |||
@@ -36,6 +36,8 @@ | |||
36 | 36 | ||
37 | #include <sys/socket.h> | 37 | #include <sys/socket.h> |
38 | 38 | ||
39 | #include <stddef.h> /* for wchar_t */ | ||
40 | |||
39 | /* OpenBSD function replacements */ | 41 | /* OpenBSD function replacements */ |
40 | #include "base64.h" | 42 | #include "base64.h" |
41 | #include "sigact.h" | 43 | #include "sigact.h" |
@@ -231,10 +233,43 @@ long long strtonum(const char *, long long, long long, const char **); | |||
231 | # define mblen(x, y) (1) | 233 | # define mblen(x, y) (1) |
232 | #endif | 234 | #endif |
233 | 235 | ||
236 | #ifndef HAVE_WCWIDTH | ||
237 | # define wcwidth(x) (((x) >= 0x20 && (x) <= 0x7e) ? 1 : -1) | ||
238 | /* force our no-op nl_langinfo and mbtowc */ | ||
239 | # undef HAVE_NL_LANGINFO | ||
240 | # undef HAVE_MBTOWC | ||
241 | # undef HAVE_LANGINFO_H | ||
242 | #endif | ||
243 | |||
244 | #ifndef HAVE_NL_LANGINFO | ||
245 | # define nl_langinfo(x) "" | ||
246 | #endif | ||
247 | |||
248 | #ifndef HAVE_MBTOWC | ||
249 | int mbtowc(wchar_t *, const char*, size_t); | ||
250 | #endif | ||
251 | |||
234 | #if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF) | 252 | #if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF) |
235 | # include <stdarg.h> | 253 | # include <stdarg.h> |
236 | #endif | 254 | #endif |
237 | 255 | ||
256 | /* | ||
257 | * Some platforms unconditionally undefine va_copy() so we define VA_COPY() | ||
258 | * instead. This is known to be the case on at least some configurations of | ||
259 | * AIX with the xlc compiler. | ||
260 | */ | ||
261 | #ifndef VA_COPY | ||
262 | # ifdef HAVE_VA_COPY | ||
263 | # define VA_COPY(dest, src) va_copy(dest, src) | ||
264 | # else | ||
265 | # ifdef HAVE___VA_COPY | ||
266 | # define VA_COPY(dest, src) __va_copy(dest, src) | ||
267 | # else | ||
268 | # define VA_COPY(dest, src) (dest) = (src) | ||
269 | # endif | ||
270 | # endif | ||
271 | #endif | ||
272 | |||
238 | #ifndef HAVE_VASPRINTF | 273 | #ifndef HAVE_VASPRINTF |
239 | int vasprintf(char **, const char *, va_list); | 274 | int vasprintf(char **, const char *, va_list); |
240 | #endif | 275 | #endif |