Wide curses merge
Wide curses merge.
Merge wide curses.
Remove trailing whitespace.
Apply the changes that add debug "areas" on HEAD to the wcurses branch.
Add correspending changes to the debug code that is only present on the branch.
We need to include <assert.h> when debugging.
Add a cast (len should fit in long here).
Add a cast (mlen should fit in long here).
Change debug code slightly, so that it doesn't confuse __CTRACE().
We only need to include <assert.h> when debugging.
* Make WCHAR libcurses the default build
* Sprinkle about some SET_WCOL() calls where they were missing
Needs <assert.h> for _DIAGASSERT().
We only need to include <assert.h> when debugging.
We need to SET_WCOL() in wborder() too.
Only produce debug information for the current line.
Do the debug initialisation only in ctrace.c.  Otherwise, it might not
get done, for example, if we start curses with setterm() and not initscr().
Mask off the attribute bits when checking which attributes we need to set.
 * rearrange code to ensure that SET_WCOL() is called after attributes
   are copied/set.

 * fix some instances where attributes were being checked without
   masking with WA_ATTRIBUTES

 * Replace another instance of non-spacing character copying with function
   call.
Mask off wide char width when returning attributes.
Don't core dump if setlocale returns NULL - we punt and go for unicode
instead