Module Name:    src
Committed By:   uwe
Date:           Thu Nov 22 22:16:45 UTC 2018

Modified Files:
        src/lib/libcurses: add_wch.c add_wchstr.c addwstr.c cchar.c
            echo_wchar.c get_wch.c get_wstr.c in_wch.c in_wchstr.c ins_wch.c
            ins_wstr.c inwstr.c

Log Message:
Drop HAVE_WCHAR ifdefs from code that is not even compiled with !HAVE_WCHAR.

We still try to mainain the ability to build our curses with
!HAVE_WCHAR, but it doesn't make sense to provide stubs for new wide
API functions that just error out when !HAVE_WCHAR.  Any code that
only uses old API (and can work with !HAVE_WCHAR curses) doesn't use
those new functions.  The code that uses new API obviosly cannot work
when all the new API is stubbed out.

So the plan is to drop the stubs.  This commit does that for files
that are not even compiled with !HAVE_WCHAR (not only those stubs are
useless, they were not even there to begin with).

Same object code is generated for the normal HAVE_WCHAR case.  Nothing
is even recompiled for !HAVE_WCHAR.

Ok by blymn@ jdc@ roy@


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libcurses/add_wch.c \
    src/lib/libcurses/add_wchstr.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libcurses/addwstr.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/cchar.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libcurses/echo_wchar.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libcurses/get_wstr.c \
    src/lib/libcurses/in_wch.c src/lib/libcurses/in_wchstr.c \
    src/lib/libcurses/inwstr.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libcurses/ins_wch.c \
    src/lib/libcurses/ins_wstr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libcurses/add_wch.c
diff -u src/lib/libcurses/add_wch.c:1.5 src/lib/libcurses/add_wch.c:1.6
--- src/lib/libcurses/add_wch.c:1.5	Thu Jan  7 07:36:35 2016
+++ src/lib/libcurses/add_wch.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: add_wch.c,v 1.5 2016/01/07 07:36:35 jdc Exp $ */
+/*   $NetBSD: add_wch.c,v 1.6 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: add_wch.c,v 1.5 2016/01/07 07:36:35 jdc Exp $");
+__RCSID("$NetBSD: add_wch.c,v 1.6 2018/11/22 22:16:45 uwe Exp $");
 #endif /* not lint */
 
 #include <stdlib.h>
@@ -54,11 +54,7 @@ __RCSID("$NetBSD: add_wch.c,v 1.5 2016/0
 int
 add_wch(const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wadd_wch(stdscr, wch);
-#endif /* HAVE_WCHAR */
 }
 
 
@@ -69,11 +65,7 @@ add_wch(const cchar_t *wch)
 int
 mvadd_wch(int y, int x, const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwadd_wch(stdscr, y, x, wch);
-#endif /* HAVE_WCHAR */
 }
 
 
@@ -84,14 +76,10 @@ mvadd_wch(int y, int x, const cchar_t *w
 int
 mvwadd_wch(WINDOW *win, int y, int x, const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return wadd_wch(win, wch);
-#endif /* HAVE_WCHAR */
 }
 
 
@@ -104,9 +92,6 @@ mvwadd_wch(WINDOW *win, int y, int x, co
 int
 wadd_wch(WINDOW *win, const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	int x = win->curx, y = win->cury;
 	__LINE *lnp = NULL;
 
@@ -120,5 +105,4 @@ wadd_wch(WINDOW *win, const cchar_t *wch
 #endif
 	lnp = win->alines[y];
 	return _cursesi_addwchar(win, &lnp, &y, &x, wch, 1);
-#endif /* HAVE_WCHAR */
 }
Index: src/lib/libcurses/add_wchstr.c
diff -u src/lib/libcurses/add_wchstr.c:1.5 src/lib/libcurses/add_wchstr.c:1.6
--- src/lib/libcurses/add_wchstr.c:1.5	Sat Oct 22 21:55:06 2016
+++ src/lib/libcurses/add_wchstr.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: add_wchstr.c,v 1.5 2016/10/22 21:55:06 christos Exp $ */
+/*   $NetBSD: add_wchstr.c,v 1.6 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: add_wchstr.c,v 1.5 2016/10/22 21:55:06 christos Exp $");
+__RCSID("$NetBSD: add_wchstr.c,v 1.6 2018/11/22 22:16:45 uwe Exp $");
 #endif				/* not lint */
 
 #include <stdlib.h>
@@ -51,11 +51,7 @@ __RCSID("$NetBSD: add_wchstr.c,v 1.5 201
 int
 add_wchstr(const cchar_t *wchstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wadd_wchnstr(stdscr, wchstr, -1);
-#endif
 }
 
 
@@ -66,11 +62,7 @@ add_wchstr(const cchar_t *wchstr)
 int
 wadd_wchstr(WINDOW *win, const cchar_t *wchstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wadd_wchnstr(win, wchstr, -1);
-#endif
 }
 
 
@@ -82,11 +74,7 @@ wadd_wchstr(WINDOW *win, const cchar_t *
 int
 add_wchnstr(const cchar_t *wchstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wadd_wchnstr(stdscr, wchstr, n);
-#endif
 }
 
 
@@ -97,11 +85,7 @@ add_wchnstr(const cchar_t *wchstr, int n
 int
 mvadd_wchstr(int y, int x, const cchar_t *wchstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwadd_wchnstr(stdscr, y, x, wchstr, -1);
-#endif
 }
 
 
@@ -112,11 +96,7 @@ mvadd_wchstr(int y, int x, const cchar_t
 int
 mvwadd_wchstr(WINDOW *win, int y, int x, const cchar_t *wchstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwadd_wchnstr(win, y, x, wchstr, -1);
-#endif
 }
 
 
@@ -128,11 +108,7 @@ mvwadd_wchstr(WINDOW *win, int y, int x,
 int
 mvadd_wchnstr(int y, int x, const cchar_t *wchstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwadd_wchnstr(stdscr, y, x, wchstr, n);
-#endif
 }
 
 
@@ -144,14 +120,10 @@ mvadd_wchnstr(int y, int x, const cchar_
 int
 mvwadd_wchnstr(WINDOW *win, int y, int x, const cchar_t *wchstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return wadd_wchnstr(win, wchstr, n);
-#endif
 }
 
 
@@ -163,9 +135,6 @@ mvwadd_wchnstr(WINDOW *win, int y, int x
 int
 wadd_wchnstr(WINDOW *win, const cchar_t *wchstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	const cchar_t *chp;
 	wchar_t wc;
 	int cw, x, y, sx, ex, newx, i, cnt;
@@ -334,5 +303,4 @@ wadd_wchnstr(WINDOW *win, const cchar_t 
 	__touchline(win, y, sx, ex);
 
 	return OK;
-#endif /* HAVE_WCHAR */
 }

Index: src/lib/libcurses/addwstr.c
diff -u src/lib/libcurses/addwstr.c:1.3 src/lib/libcurses/addwstr.c:1.4
--- src/lib/libcurses/addwstr.c:1.3	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/addwstr.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: addwstr.c,v 1.3 2017/01/06 13:53:18 roy Exp $ */
+/*   $NetBSD: addwstr.c,v 1.4 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: addwstr.c,v 1.3 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: addwstr.c,v 1.4 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include <string.h>
@@ -51,11 +51,7 @@ __RCSID("$NetBSD: addwstr.c,v 1.3 2017/0
 int
 addwstr(const wchar_t *s)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return waddnwstr(stdscr, s, -1);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -65,11 +61,7 @@ addwstr(const wchar_t *s)
 int
 waddwstr(WINDOW *win, const wchar_t *s)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return waddnwstr(win, s, -1);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -80,11 +72,7 @@ waddwstr(WINDOW *win, const wchar_t *s)
 int
 addnwstr(const wchar_t *str, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return waddnwstr(stdscr, str, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -94,11 +82,7 @@ addnwstr(const wchar_t *str, int n)
 int
 mvaddwstr(int y, int x, const wchar_t *str)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwaddnwstr(stdscr, y, x, str, -1);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -108,11 +92,7 @@ mvaddwstr(int y, int x, const wchar_t *s
 int
 mvwaddwstr(WINDOW *win, int y, int x, const wchar_t *str)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwaddnwstr(win, y, x, str, -1);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -123,11 +103,7 @@ mvwaddwstr(WINDOW *win, int y, int x, co
 int
 mvaddnwstr(int y, int x, const wchar_t *str, int count)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwaddnwstr(stdscr, y, x, str, count);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -138,14 +114,10 @@ mvaddnwstr(int y, int x, const wchar_t *
 int
 mvwaddnwstr(WINDOW *win, int y, int x, const wchar_t *str, int count)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return waddnwstr(win, str, count);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -157,9 +129,6 @@ mvwaddnwstr(WINDOW *win, int y, int x, c
 int
 waddnwstr(WINDOW *win, const wchar_t *s, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	size_t  len;
 	const wchar_t *p;
 	cchar_t cc;
@@ -197,5 +166,4 @@ waddnwstr(WINDOW *win, const wchar_t *s,
 	}
 
 	return OK;
-#endif /* HAVE_WCHAR */
 }

Index: src/lib/libcurses/cchar.c
diff -u src/lib/libcurses/cchar.c:1.10 src/lib/libcurses/cchar.c:1.11
--- src/lib/libcurses/cchar.c:1.10	Tue Nov 20 22:02:31 2018
+++ src/lib/libcurses/cchar.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: cchar.c,v 1.10 2018/11/20 22:02:31 uwe Exp $ */
+/*   $NetBSD: cchar.c,v 1.11 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: cchar.c,v 1.10 2018/11/20 22:02:31 uwe Exp $");
+__RCSID("$NetBSD: cchar.c,v 1.11 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include <string.h>
@@ -52,9 +52,6 @@ int
 getcchar(const cchar_t *wcval, wchar_t *wch, attr_t *attrs,
          short *color_pair, void *opts)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	wchar_t *wp;
 	size_t len;
 
@@ -80,7 +77,6 @@ getcchar(const cchar_t *wcval, wchar_t *
 		wch[len] = L'\0';
 	}
 	return OK;
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -91,9 +87,6 @@ int
 setcchar(cchar_t *wcval, const wchar_t *wch, const attr_t attrs,
 	 short color_pair, const void *opts)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	int i;
 	size_t len;
 
@@ -125,7 +118,6 @@ setcchar(cchar_t *wcval, const wchar_t *
 	}
 
 	return OK;
-#endif /* HAVE_WCHAR */
 }
 
 void

Index: src/lib/libcurses/echo_wchar.c
diff -u src/lib/libcurses/echo_wchar.c:1.2 src/lib/libcurses/echo_wchar.c:1.3
--- src/lib/libcurses/echo_wchar.c:1.2	Mon May 28 15:01:55 2007
+++ src/lib/libcurses/echo_wchar.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: echo_wchar.c,v 1.2 2007/05/28 15:01:55 blymn Exp $ */
+/*   $NetBSD: echo_wchar.c,v 1.3 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: echo_wchar.c,v 1.2 2007/05/28 15:01:55 blymn Exp $");
+__RCSID("$NetBSD: echo_wchar.c,v 1.3 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include "curses.h"
@@ -49,11 +49,7 @@ __RCSID("$NetBSD: echo_wchar.c,v 1.2 200
 int
 echo_wchar(const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wecho_wchar(stdscr, wch);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -63,16 +59,12 @@ echo_wchar(const cchar_t *wch)
 int
 wecho_wchar(WINDOW *win, const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	int retval;
 
 	retval = wadd_wch(win, wch);
 	if (retval == OK)
 		 retval = wrefresh(win);
 	return retval;
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -83,9 +75,6 @@ wecho_wchar(WINDOW *win, const cchar_t *
 int
 pecho_wchar(WINDOW *pad, const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	int retval;
 
 	retval = wadd_wch(pad, wch);
@@ -93,5 +82,4 @@ pecho_wchar(WINDOW *pad, const cchar_t *
 		 retval = prefresh(pad, pad->pbegy, pad->pbegx,
 			pad->sbegy, pad->sbegx, pad->smaxy, pad->smaxx);
 	return retval;
-#endif /* HAVE_WCHAR */
 }

Index: src/lib/libcurses/get_wch.c
diff -u src/lib/libcurses/get_wch.c:1.19 src/lib/libcurses/get_wch.c:1.20
--- src/lib/libcurses/get_wch.c:1.19	Fri Sep 28 15:03:48 2018
+++ src/lib/libcurses/get_wch.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wch.c,v 1.19 2018/09/28 15:03:48 roy Exp $ */
+/*   $NetBSD: get_wch.c,v 1.20 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: get_wch.c,v 1.19 2018/09/28 15:03:48 roy Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.20 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include <errno.h>
@@ -48,18 +48,13 @@ __RCSID("$NetBSD: get_wch.c,v 1.19 2018/
 #include "curses_private.h"
 #include "keymap.h"
 
-#ifdef HAVE_WCHAR
 static short   wstate;		  /* state of the wcinkey function */
-#endif /* HAVE_WCHAR */
 extern short state;		/* storage declared in getch.c */
 
 /* prototypes for private functions */
-#ifdef HAVE_WCHAR
 static int inkey(wchar_t *wc, int to, int delay);
 static wint_t __fgetwc_resize(FILE *infd, bool *resized);
-#endif /* HAVE_WCHAR */
 
-#ifdef HAVE_WCHAR
 /*
  * __init_get_wch - initialise all the pointers & structures needed to make
  * get_wch work in keypad mode.
@@ -72,10 +67,8 @@ __init_get_wch(SCREEN *screen)
 	memset(&screen->cbuf, 0, sizeof(screen->cbuf));
 	screen->cbuf_head = screen->cbuf_tail = screen->cbuf_cur = 0;
 }
-#endif /* HAVE_WCHAR */
 
 
-#ifdef HAVE_WCHAR
 /*
  * inkey - do the work to process keyboard input, check for multi-key
  * sequences and return the appropriate symbol if we get a match.
@@ -451,7 +444,6 @@ inkey(wchar_t *wc, int to, int delay)
 		}
 	}
 }
-#endif /* HAVE_WCHAR */
 
 /*
  * get_wch --
@@ -460,11 +452,7 @@ inkey(wchar_t *wc, int to, int delay)
 int
 get_wch(wint_t *ch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wget_wch(stdscr, ch);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -474,11 +462,7 @@ get_wch(wint_t *ch)
 int
 mvget_wch(int y, int x, wint_t *ch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwget_wch(stdscr, y, x, ch);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -489,14 +473,10 @@ mvget_wch(int y, int x, wint_t *ch)
 int
 mvwget_wch(WINDOW *win, int y, int x, wint_t *ch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return wget_wch(win, ch);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -506,9 +486,6 @@ mvwget_wch(WINDOW *win, int y, int x, wi
 int
 wget_wch(WINDOW *win, wint_t *ch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	int ret, weset;
 	int c;
 	FILE *infd = _cursesi_screen->infd;
@@ -652,7 +629,6 @@ wget_wch(WINDOW *win, wint_t *ch)
 	if ( ret == KEY_CODE_YES )
 		return KEY_CODE_YES;
 	return inp < 0 ? ERR : OK;
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -665,7 +641,6 @@ unget_wch(const wchar_t c)
 	return __unget((wint_t)c);
 }
 
-#ifdef HAVE_WCHAR
 /*
  * __fgetwc_resize --
  *    Any call to fgetwc(3) should use this function instead.
@@ -689,4 +664,3 @@ __fgetwc_resize(FILE *infd, bool *resize
 	*resized = true;
 	return c;
 }
-#endif

Index: src/lib/libcurses/get_wstr.c
diff -u src/lib/libcurses/get_wstr.c:1.4 src/lib/libcurses/get_wstr.c:1.5
--- src/lib/libcurses/get_wstr.c:1.4	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/get_wstr.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wstr.c,v 1.4 2017/01/06 13:53:18 roy Exp $ */
+/*   $NetBSD: get_wstr.c,v 1.5 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,16 +36,14 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: get_wstr.c,v 1.4 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: get_wstr.c,v 1.5 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include "curses.h"
 #include "curses_private.h"
 
 /* prototypes for private functions */
-#ifdef HAVE_WCHAR
 static int __wgetn_wstr(WINDOW *, wchar_t *, int);
-#endif /* HAVE_WCHAR */
 
 /*
  * getn_wstr --
@@ -55,11 +53,7 @@ static int __wgetn_wstr(WINDOW *, wchar_
 int
 getn_wstr(wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wgetn_wstr(stdscr, wstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -71,11 +65,7 @@ __warn_references(get_wstr,
 int
 get_wstr(wchar_t *wstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wget_wstr(stdscr, wstr);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -85,11 +75,7 @@ get_wstr(wchar_t *wstr)
 int
 mvgetn_wstr(int y, int x, wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwgetn_wstr(stdscr, y, x, wstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -101,11 +87,7 @@ __warn_references(mvget_wstr,
 int
 mvget_wstr(int y, int x, wchar_t *wstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwget_wstr(stdscr, y, x, wstr);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -116,14 +98,10 @@ mvget_wstr(int y, int x, wchar_t *wstr)
 int
 mvwgetn_wstr(WINDOW *win, int y, int x, wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return wgetn_wstr(win, wstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -135,14 +113,10 @@ __warn_references(mvget_wstr,
 int
 mvwget_wstr(WINDOW *win, int y, int x, wchar_t *wstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return wget_wstr(win, wstr);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -154,11 +128,7 @@ __warn_references(wget_wstr,
 int
 wget_wstr(WINDOW *win, wchar_t *wstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return __wgetn_wstr(win, wstr, -1);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -169,9 +139,6 @@ wget_wstr(WINDOW *win, wchar_t *wstr)
 int
 wgetn_wstr(WINDOW *win, wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (n < 1)
 		return ERR;
 	if (n == 1) {
@@ -179,10 +146,8 @@ wgetn_wstr(WINDOW *win, wchar_t *wstr, i
 		return ERR;
 	}
 	return __wgetn_wstr(win, wstr, n);
-#endif /* HAVE_WCHAR */
 }
 
-#ifdef HAVE_WCHAR
 /*
  * __wgetn_wstr --
  *	The actual implementation.
@@ -288,4 +253,3 @@ __wgetn_wstr(WINDOW *win, wchar_t *wstr,
 	*wstr = L'\0';
 	return OK;
 }
-#endif /* HAVE_WCHAR */
Index: src/lib/libcurses/in_wch.c
diff -u src/lib/libcurses/in_wch.c:1.4 src/lib/libcurses/in_wch.c:1.5
--- src/lib/libcurses/in_wch.c:1.4	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/in_wch.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: in_wch.c,v 1.4 2017/01/06 13:53:18 roy Exp $ */
+/*   $NetBSD: in_wch.c,v 1.5 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: in_wch.c,v 1.4 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: in_wch.c,v 1.5 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include "curses.h"
@@ -49,11 +49,7 @@ __RCSID("$NetBSD: in_wch.c,v 1.4 2017/01
 int
 in_wch(cchar_t *wcval)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return win_wch(stdscr, wcval);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -63,11 +59,7 @@ in_wch(cchar_t *wcval)
 int
 mvin_wch(int y, int x, cchar_t *wcval)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwin_wch(stdscr, y, x, wcval);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -77,14 +69,10 @@ mvin_wch(int y, int x, cchar_t *wcval)
 int
 mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return win_wch(win, wcval);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -94,9 +82,6 @@ mvwin_wch(WINDOW *win, int y, int x, cch
 int
 win_wch(WINDOW *win, cchar_t *wcval)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	nschar_t *np;
 	__LDATA *lp = &win->alines[win->cury]->line[win->curx];
 	int cw = WCOL(*lp);
@@ -115,5 +100,4 @@ win_wch(WINDOW *win, cchar_t *wcval)
 	}
 
 	return OK;
-#endif /* HAVE_WCHAR */
 }
Index: src/lib/libcurses/in_wchstr.c
diff -u src/lib/libcurses/in_wchstr.c:1.4 src/lib/libcurses/in_wchstr.c:1.5
--- src/lib/libcurses/in_wchstr.c:1.4	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/in_wchstr.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: in_wchstr.c,v 1.4 2017/01/06 13:53:18 roy Exp $ */
+/*   $NetBSD: in_wchstr.c,v 1.5 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: in_wchstr.c,v 1.4 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: in_wchstr.c,v 1.5 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include "curses.h"
@@ -51,21 +51,13 @@ __warn_references(in_wchstr,
 int
 in_wchstr(cchar_t *wchstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return win_wchstr(stdscr, wchstr);
-#endif /* HAVE_WCHAR */
 }
 
 int
 in_wchnstr(cchar_t *wchstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return win_wchnstr(stdscr, wchstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -77,21 +69,13 @@ __warn_references(mvin_wchstr,
 int
 mvin_wchstr(int y, int x, cchar_t *wchstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwin_wchstr(stdscr, y, x, wchstr);
-#endif /* HAVE_WCHAR */
 }
 
 int
 mvin_wchnstr(int y, int x, cchar_t *wchstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwin_wchnstr(stdscr, y, x, wchstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -103,27 +87,19 @@ __warn_references(mvwin_wchstr,
 int
 mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return win_wchstr(win, wchstr);
-#endif /* HAVE_WCHAR */
 }
 
 int
 mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wchstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return win_wchnstr(win, wchstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -135,12 +111,8 @@ __warn_references(win_wchstr,
 int
 win_wchstr(WINDOW *win, cchar_t *wchstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 
 	return win_wchnstr(win, wchstr, -1);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -150,9 +122,6 @@ win_wchstr(WINDOW *win, cchar_t *wchstr)
 int
 win_wchnstr(WINDOW *win, cchar_t *wchstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	__LDATA	*start;
 	int x = 0, cw = 0, cnt = 0;
 	cchar_t *wcp;
@@ -193,5 +162,4 @@ win_wchnstr(WINDOW *win, cchar_t *wchstr
 	wcp->attributes = win->wattr;
 
 	return OK;
-#endif /* HAVE_WCHAR */
 }
Index: src/lib/libcurses/inwstr.c
diff -u src/lib/libcurses/inwstr.c:1.4 src/lib/libcurses/inwstr.c:1.5
--- src/lib/libcurses/inwstr.c:1.4	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/inwstr.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: inwstr.c,v 1.4 2017/01/06 13:53:18 roy Exp $ */
+/*   $NetBSD: inwstr.c,v 1.5 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: inwstr.c,v 1.4 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: inwstr.c,v 1.5 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include "curses.h"
@@ -51,21 +51,13 @@ __warn_references(inwstr,
 int
 inwstr(wchar_t *wstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return winwstr(stdscr, wstr);
-#endif /* HAVE_WCHAR */
 }
 
 int
 innwstr(wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return winnwstr(stdscr, wstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -77,21 +69,13 @@ __warn_references(mvinwstr,
 int
 mvinwstr(int y, int x, wchar_t *wstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwinwstr(stdscr, y, x, wstr);
-#endif /* HAVE_WCHAR */
 }
 
 int
 mvinnwstr(int y, int x, wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwinnwstr(stdscr, y, x, wstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -103,27 +87,19 @@ __warn_references(mvwinwstr,
 int
 mvwinwstr(WINDOW *win, int y, int x, wchar_t *wstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return winwstr(win, wstr);
-#endif /* HAVE_WCHAR */
 }
 
 int
 mvwinnwstr(WINDOW *win, int y, int x, wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return winnwstr(win, wstr, n);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -135,12 +111,8 @@ __warn_references(winwstr,
 int
 winwstr(WINDOW *win, wchar_t *wstr)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 
 	return winnwstr(win, wstr, -1);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -155,9 +127,6 @@ winwstr(WINDOW *win, wchar_t *wstr)
 int
 winnwstr(WINDOW *win, wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	__LDATA	*start;
 	int x, cw, cnt;
 	wchar_t *wcp;
@@ -190,5 +159,4 @@ winnwstr(WINDOW *win, wchar_t *wstr, int
 		return OK;
 	else
 		return cnt;
-#endif /* HAVE_WCHAR */
 }

Index: src/lib/libcurses/ins_wch.c
diff -u src/lib/libcurses/ins_wch.c:1.11 src/lib/libcurses/ins_wch.c:1.12
--- src/lib/libcurses/ins_wch.c:1.11	Tue Jan 31 09:17:53 2017
+++ src/lib/libcurses/ins_wch.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: ins_wch.c,v 1.11 2017/01/31 09:17:53 roy Exp $ */
+/*   $NetBSD: ins_wch.c,v 1.12 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ins_wch.c,v 1.11 2017/01/31 09:17:53 roy Exp $");
+__RCSID("$NetBSD: ins_wch.c,v 1.12 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include <string.h>
@@ -52,11 +52,7 @@ __RCSID("$NetBSD: ins_wch.c,v 1.11 2017/
 int
 ins_wch(const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return wins_wch(stdscr, wch);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -66,11 +62,7 @@ ins_wch(const cchar_t *wch)
 int
 mvins_wch(int y, int x, const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	return mvwins_wch(stdscr, y, x, wch);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -80,14 +72,10 @@ mvins_wch(int y, int x, const cchar_t *w
 int
 mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 
 	return wins_wch(stdscr, wch);
-#endif /* HAVE_WCHAR */
 }
 
 /*
@@ -97,9 +85,6 @@ mvwins_wch(WINDOW *win, int y, int x, co
 int
 wins_wch(WINDOW *win, const cchar_t *wch)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	__LDATA	*start, *temp1, *temp2;
 	__LINE *lnp;
 	int cw, pcw, x, y, sx, ex, newx, i;
@@ -249,5 +234,4 @@ wins_wch(WINDOW *win, const cchar_t *wch
 	__touchline(win, y, sx, (int)win->maxx - 1);
 	__sync(win);
 	return OK;
-#endif /* HAVE_WCHAR */
 }
Index: src/lib/libcurses/ins_wstr.c
diff -u src/lib/libcurses/ins_wstr.c:1.11 src/lib/libcurses/ins_wstr.c:1.12
--- src/lib/libcurses/ins_wstr.c:1.11	Tue Jan 31 09:17:53 2017
+++ src/lib/libcurses/ins_wstr.c	Thu Nov 22 22:16:45 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: ins_wstr.c,v 1.11 2017/01/31 09:17:53 roy Exp $ */
+/*   $NetBSD: ins_wstr.c,v 1.12 2018/11/22 22:16:45 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ins_wstr.c,v 1.11 2017/01/31 09:17:53 roy Exp $");
+__RCSID("$NetBSD: ins_wstr.c,v 1.12 2018/11/22 22:16:45 uwe Exp $");
 #endif						  /* not lint */
 
 #include <string.h>
@@ -130,9 +130,6 @@ wins_wstr(WINDOW *win, const wchar_t *ws
 int
 wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
 {
-#ifndef HAVE_WCHAR
-	return ERR;
-#else
 	__LDATA	 *start, *temp1, *temp2;
 	__LINE	  *lnp;
 	const wchar_t *scp;
@@ -330,5 +327,4 @@ wins_nwstr(WINDOW *win, const wchar_t *w
 	__touchline(win, (int) win->cury, sx, (int) win->maxx - 1);
 	__sync(win);
 	return OK;
-#endif /* HAVE_WCHAR */
 }

Reply via email to