On Sun, Jun 22, 2025 at 01:14:12PM -0400, Thomas Dickey wrote:
> On Sun, Jun 22, 2025 at 11:42:01AM +0000, Kirill Makurin wrote:
> > Thank you for looking into it. I tried building ncurses-6.5-20250621.
> > 
> > I still get errors with clang-cl.exe (btw, cl.exe is OK since it does not
> > care) about undeclared functions which are declared in wchar.h from the
> > following files:
> 
> a little surprising, because all of these use curses.priv.h, where I added
> the #include's for io.h and wchar.h (but I can investigate further).

I think this was because the ifdef's around wchar.h were too specific.
(have just made a change, which may work as needed)
  
> > ```
> > ncurses\base\lib_addch.c
> > ncurses\base\lib_slkset.c
> > ncurses\tty\tty_update.c
> > ncurses\widechar\lib_slk_wset.c
> > ncurses\widechar\charable.c
> > ncurses\widechar\lib_unget_wch.c
> > ```
> > 
> > About issue with requirement to explicitly link -luser32, I think I'll 
> > suggest Automake update their `compile` script to pass some libraries by 
> > default just like gcc does. This should eventually solve this issue. It 
> > also affects some other packages.
> > 
> > I think mingw-w64's implementation of tsearch and friends is public domain 
> > and I think their getopt implementation is under BSD-like or MIT. You could 
> > look into it. If you're interested, I could take a look and remove 
> > mingw-specific stuff (e.g. attribute macros) from them so they could 
> > compile by themselves.

I see

https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-crt/misc/tsearch.c

which actually is simpler than I had thought.  I was thinking it would be
more like

https://github.com/ThomasDickey/td_lib-snapshots/blob/master/src/compare/btree.c
https://github.com/ThomasDickey/vile-snapshots/blob/master/btree.c

(something to think about)

> > The libraries, including ncurses++ build successfully with MSVC.  The only
> > thing is that I cannot really test them since I am not really familiar with
> > curses, I was trying to build them as an optional dependency for gettext's
> > libtextstyle.
> 
> That's using the low-level terminfo interface, e.g., setupterm and tigetstr
> 
> Running that code requires a (terminfo) database, which is awkward in the
> Windows port.  If I were doing that, I'd consider using a fallback
> (compiled-in database), but with a clang-cl and cl toolset, I suppose that
> running infocmp to generate the fallbacks also is awkward :-)
>  
> > - Kirill Makurin
> > 
> > ________________________________
> > From: Thomas Dickey
> > Sent: Saturday, June 21, 2025 10:27 PM
> > To: [email protected]
> > Cc: Kirill Makurin
> > Subject: Re: Building ncurses with MSVC
> > 
> > On Tue, Jun 17, 2025 at 03:54:19AM -0400, Thomas Dickey wrote:
> > > On Tue, Jun 17, 2025 at 03:19:10AM +0000, Kirill Makurin wrote:
> > > > Hello,
> > > >
> > > > I have recently tried to build ncurses with MSVC-like tools (cl.exe and 
> > > > clang-cl.exe) and would like to share what I have encountered.
> > >
> > > well, yes - if you're attempting to configure on a platform lacking
> > > the C runtime support, it won't work well.
> > >
> > > thanks (will pick through this to improve)
> > 
> > For now, I'll make the suggested fix for $OBJEXT, and make fixes
> > for headers io.h and wchar.h -- that should let you make progress.
> > 
> > The issue with tsearch may be important - but probably requires some effort.
> > It appears that my choices are reworking source from FreeBSD, or code
> > that I wrote long ago using Knuth.
> > 
> > (gnulib isn't a viable choice, due to licensing)
> > 
> > --
> > Thomas E. Dickey <[email protected]>
> > https://invisible-island.net
> 
> -- 
> Thomas E. Dickey <[email protected]>
> https://invisible-island.net



-- 
Thomas E. Dickey <[email protected]>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature

Reply via email to