summaryrefslogtreecommitdiffstats
path: root/term_ascii.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-16 19:00:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-16 19:00:01 +0000
commit2aa53e65cd397640a44a8f3489f93ee15a536c54 (patch)
tree004861e8817a1141dee31b9e1e64ffba81f451f4 /term_ascii.c
parentb910bc285b99278f25295489ecd0cef5e7339f23 (diff)
downloadmandoc-2aa53e65cd397640a44a8f3489f93ee15a536c54.tar.gz
Improve build system and autodetection.
* Make ./configure standalone, that's what people expect. * Let people write a ./configure.local from scratch, not edit existing files. * Autodetect wchar, sqlite3, and manpath and act accordingly. * Autodetect the need for -L/usr/local/lib and -lutil. * Get rid of config.h.p{re,ost}, let ./configure only write what's needed. * Let ./configure write a Makefile.local snippet, that's quite flexible.
Diffstat (limited to 'term_ascii.c')
-rw-r--r--term_ascii.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/term_ascii.c b/term_ascii.c
index b11e222e..248a6ca4 100644
--- a/term_ascii.c
+++ b/term_ascii.c
@@ -19,14 +19,14 @@
#include <sys/types.h>
-#ifdef USE_WCHAR
+#if HAVE_WCHAR
#include <locale.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#ifdef USE_WCHAR
+#if HAVE_WCHAR
#include <wchar.h>
#endif
@@ -36,17 +36,6 @@
#include "term.h"
#include "main.h"
-/*
- * Sadly, this doesn't seem to be defined on systems even when they
- * support it. For the time being, remove it and let those compiling
- * the software decide for themselves what to use.
- */
-#if 0
-#if ! defined(__STDC_ISO_10646__)
-# undef USE_WCHAR
-#endif
-#endif
-
static struct termp *ascii_init(enum termenc, char *);
static double ascii_hspan(const struct termp *,
const struct roffsu *);
@@ -58,7 +47,7 @@ static void ascii_endline(struct termp *);
static void ascii_letter(struct termp *, int);
static void ascii_setwidth(struct termp *, int, size_t);
-#ifdef USE_WCHAR
+#if HAVE_WCHAR
static void locale_advance(struct termp *, size_t);
static void locale_endline(struct termp *);
static void locale_letter(struct termp *, int);
@@ -90,7 +79,7 @@ ascii_init(enum termenc enc, char *outopts)
p->setwidth = ascii_setwidth;
p->width = ascii_width;
-#ifdef USE_WCHAR
+#if HAVE_WCHAR
if (TERMENC_ASCII != enc) {
v = TERMENC_LOCALE == enc ?
setlocale(LC_ALL, "") :
@@ -272,7 +261,7 @@ ascii_hspan(const struct termp *p, const struct roffsu *su)
return(r);
}
-#ifdef USE_WCHAR
+#if HAVE_WCHAR
static size_t
locale_width(const struct termp *p, int c)
{