aboutsummaryrefslogtreecommitdiffstatshomepage
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
commita005fc4b580b8743c2baaf08bb9fa7792201861b (patch)
treebc97e904c6fffbf344eabf934674809767674fe7 /term_ascii.c
parent2b458c52cbc836a7fa3ad35cfb84f021fd6356cf (diff)
downloadmandoc-a005fc4b580b8743c2baaf08bb9fa7792201861b.tar.gz
mandoc-a005fc4b580b8743c2baaf08bb9fa7792201861b.tar.zst
mandoc-a005fc4b580b8743c2baaf08bb9fa7792201861b.zip
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.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/term_ascii.c b/term_ascii.c
index c4428073..8a2458c3 100644
--- a/term_ascii.c
+++ b/term_ascii.c
@@ -1,4 +1,4 @@
-/* $Id: term_ascii.c,v 1.30 2014/08/14 22:33:10 schwarze Exp $ */
+/* $Id: term_ascii.c,v 1.31 2014/08/16 19:00:01 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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)
{