Commit Graph

2413 Commits

Author SHA1 Message Date
nhmall
5e34883f36 windows: more setlocale 2023-07-01 09:24:57 -04:00
nhmall
52dcd101e4 windows: don't dupstr if setlocale returns NULL 2023-06-30 15:15:24 -04:00
nhmall
4d9bfccc90 update tested versions of Visual Studio 2023-06-30 2023-06-30 12:34:29 -04:00
nhmall
e1bae750de update DOS cross-compiler version 2023-06-27 10:49:35 -04:00
nhmall
47fc27d188 update for vmsbuild.com 2023-06-23 16:37:59 -04:00
nhmall
0616a83ef8 updated build command file 2023-06-23 13:25:09 -04:00
nhmall
c891066bf1 cppregex.cpp: move NetHack includes below c++ includes
Avoid a conflict with c++ std header file on at least one platform.

Build log prior:
In file included from DKA100:[DEVEL.nethack-37.sys.share]cppregex.cpp;1:12:
In file included from /SYS$COMMON/VSICXX$LIB/INCLUDE/LIB_CXX/INCLUDE/regex:768:
In file included from /SYS$COMMON/VSICXX$LIB/INCLUDE/LIB_CXX/INCLUDE/stdexcept:5
1:
In file included from /SYS$COMMON/VSICXX$LIB/INCLUDE/LIB_CXX/INCLUDE/exception:8
7:
In file included from /SYS$COMMON/VSICXX$LIB/INCLUDE/LIB_CXX/INCLUDE/cstdlib:91:
In file included from /SYS$COMMON/VSICXX$LIB/INCLUDE/LIB_CXX/INCLUDE/stdlib.h:10
3:
/SYS$COMMON/VSICXX$LIB/INCLUDE/DECC$RTLDEF/stdlib.h:200:24: error: too many argu
ments provided to function-like macro invocation
    void     abort    (void);
                       ^
../INCLUDE/vmsconf.h:307:9: note: macro 'abort' defined here
#define abort() vms_abort()             /* vmsmisc.c */
        ^
2023-06-23 13:15:01 -04:00
PatR
16d0a9e4ef vms_basename fix
vms_basename() was recently changed to take a second argument to
control whether to include the suffix portion of the name but an
existing call to set up 'hname' still had only one.

More than just adding the extra argument was needed.  It returns
a static buffer so if it got called for DEBUGFILES, 'hname' would
have been clobbered.
2023-06-22 15:59:56 -07:00
PatR
643b78bc40 vms_basename fix
vms_basename() was recently changed to take a second argument to
control whether to include the suffix portion of the name (used for
DEBUGFILES) but an existing call still had only one.
2023-06-22 15:30:27 -07:00
PatR
e5055e5f60 unix veryold(), take II
Instead of adding extra complexity to deal with something that had
become too complicated, simplify.  Having veryold() conditionally
close the lock file made sense when the usage was just
'if (veryold()) goto gotlock;' but didn't after that became
'if (veryold() && clearoldlocks()) goto gotlock;'.  Have veryold()
always leave the file open and getlock() always close it.
2023-06-18 16:29:16 -07:00
PatR
90f9b0742e unix veryold() file handling
Fix another analyzer complaint, about potentially calling close(fd)
for a file descriptor number that has already been closed.  This time
it was right, although I think nothing bad would happen if that
occurred.

With the original code, veryold() might succeed and close the file,
then clearoldlocks() fail so skip 'goto gotlock'.  Then the already
closed file would passed to close() again.

Normal usage still works.  No testing using failure conditions has
been done.
2023-06-18 14:43:43 -07:00
nhmall
5688754684 update tested versions of Visual Studio 2023-06-16 2023-06-16 07:13:55 -04:00
nhmall
41c9c660e8 follow-up for curses_putmixed vs genl_putmixed 2023-06-11 09:58:36 -04:00
nhmall
37b21dd9fd bypass curses_putmixed if -DCURSES_GENL_PUTMIXED is defined 2023-06-11 09:23:07 -04:00
nhmall
da08bb98e1 fix dos cross-compile attempt 2 2023-06-06 20:09:27 -04:00
nhmall
b21ef624eb fix dos cross-compile 2023-06-06 18:42:27 -04:00
nhmall
4034ec915c curses_putmixed() initial attempt
The curses interface was using genl_putmixed() which doesn't
preserve the symbol actually used for a glyph on the display.
This is a first-attempt at implementing curses_putmixed().

On Linux you'll need to distribute the Makefiles again
    sh sys/unix/setup.sh sys/unix/hints/linux.370

On macOS, you'll need to distribute the Makefiles again
    sh sys/unix/setup.sh sys/unix/hints/macOS.370
2023-06-06 17:50:08 -04:00
Ray Chason
199a76eaaa Fix compile on Qt 4 2023-06-04 18:05:09 -04:00
PatR
ecd3593163 github pull request #1030 - VDECL
The pull request from argrath would have moved the definition of
VDECL from tradstdc.h to vmsconf.h because some out of date references
to it in sys/vms/*.c were the only place it still appeared to be used.
Instead of applying that, remove those old references.

NetHack 3.7.x requires C99 so just remove VDECL since it was present
in order to support pre-ANSI compilers.  (There is at least one
comment that still mentions it though.)

This also gets rid of another chunk of tradstdc.h that was allowing
either pre-ANSI or nearly-ANSI compilers to deal with nethack's old
code.  I left the USE_STDARG/USE_VARARGS/USE_OLDARGS stuff in place
even though anything supporting C99 shouldn't need that.  Some or
all of the [UN]WIDENED_PROTOTYPES stuff is still there too.

Closes #1030
2023-05-31 01:34:11 -07:00
nhmall
102c0e3270 fix directory in Makefile.mingw32 2023-05-29 23:07:51 -04:00
nhmall
7eea8291ef bring Makefile.nmake to parity for PR 1028 2023-05-29 22:40:30 -04:00
Ray Chason
9037592ea1 parent 97edec62b5
author Ray Chason <ray.chason@protonmail.com> 1684372172 -0400
committer nhmall <nhmall@nethack.org> 1685414340 -0400

Add configuration to support Curses on WinGUI

and enable support for Unicode on Curses.

Allow NetHackW to select the Curses interface

Reorder drawing of extended command prompt

Curses on WinGUI needs this change. This may be a bug in PDCursesMod,
but it seems to be harmless to the other ports.

Avoid calling Curses after the windows are closed

Provide erase_char and kill_char for WinGUI Curses

Set Lua version to 5.4.6
2023-05-29 22:39:43 -04:00
nhmall
4bd7b79dd9 update sys/unix/hints/include/cross-pre.370 missed comment 2023-05-28 23:16:12 -04:00
nhmall
e6d94acbe1 update sys/unix/hints/include/cross-pre.370 2023-05-28 23:11:35 -04:00
nhmall
5e497ceeab sys/unix/Makefile.src 2023-05-28 23:08:39 -04:00
nhmall
b35d8a34ed update Lua version supported 2023-05-28 22:58:47 -04:00
PatR
cf8a49cae6 use to "feature" in DEBUGFILES
The code to lookup a value in DEBUGFILES usually operates on a file
name, but there are few non-file uses.  The latter wouldn't work on
VMS because of the way it was manipulating the name:  first stripping
away path, suffix, and version, then adding hardcoded ".c" suffix on.

I thought we already had a routine to get the base part of a name
from a full path, but if so, I haven't been able to find it.  This
adds new nh_basename() to do that, with the option of either keeping
or discarding the suffix or type portion.

The VMS usage that prompted this hasn't actually been tested.
2023-05-25 15:35:49 -07:00
nhmall
2876b6e8fd vmsbuild.com update 2023-05-24 19:46:33 -04:00
nhmall
65a0ff2d9a update OpenVMS com files (VSI C, NetHack-3.7) 2023-05-23 17:50:24 -04:00
nhmall
4761bf190e OpenVMS update follow-up 2023-05-22 20:50:35 -04:00
nhmall
68b8e84aa3 changes to build with VSI C compiler
The changes from past OpenVMS compilers are #ifdef'd VMS9
2023-05-22 14:43:10 -04:00
nhmall
0d116ac193 update tested OS in hints/macOS.370 2023-05-19 2023-05-19 09:48:41 -04:00
nhmall
476f962f67 update tested versions of Visual Studio 2023-05-18 2023-05-18 22:31:45 -04:00
nhmall
75e8e06dee commit 02a48aa8 split of g fixup 2023-05-17 21:17:35 -04:00
nhmall
ec9d3cb88e keep external identifiers under 31 characters length 2023-05-13 13:49:57 -04:00
PatR
65debc1adb incorporate 3.6.7+ build fix for VMS
Make sure CLR_MAX is defined when winprocs.h uses it.
sys/vms/vmsmail.c uses wintypes.h and winprocs.h without hack.h;
a change in 3.6.3 broke that but wasn't noticed until now.

I haven't added a fixes entry since we don't know whether 3.7.x
will eventually be buildable on VMS.
2023-05-10 12:47:42 -07:00
nhmall
b71fb18c63 warning fix for Windows Visual Stdio 2023-05-01 11:00:54 -04:00
nhmall
d4fb34bbb4 system.h 2023-04-23 12:29:02 -04:00
nhmall
8ec274bf2b unreachable code warning in VS uudecode build 2023-04-21 14:16:13 -04:00
nhmall
f326a9428d update tested versions of Visual Studio 2023-04-21 2023-04-21 11:58:31 -04:00
nhmall
9fd719cbf2 macOS build with latest clang from Xcode
A bunch of new warnings appeared by default on macOS compiler provided with Xcode,
including on every usage of sprintf(). Suppress those for now.

The issues with utilizing WANT_ASAN=1 on the make command line with macOS seem
to be resolved in this latest version, so allow it to be specified. Don't specify
it if using a problematic clang version.
2023-04-21 11:33:15 -04:00
nhmall
826ce951e7 get rid of NetHack macro conflict with curses routine delay_output() 2023-04-21 08:25:53 -04:00
Pasi Kallinen
d3e48dfad1 Tutorial: going down and up stairs
Adds the second tutorial level, tut-2.lua
2023-04-16 10:46:03 +03:00
nhmall
2185d325c4 header file changes hack.h, decl.h/.c, system.h, wintty.h
- Move secondary preprocessor defines down further in config.h
so that they can be overridden via [platform]conf.h which is
included from global.h, specifically:
    LIVELOGFILE when LIVELOG is defined
    DUMPLOG_FILE when DUMPLOG is defined

- Minimize platform-specific, or compiler-specific code in hack.h and decl.h.

- reorganize src/decl.c to align with include/decl.h.

- a new header file cstd.h added, containing calls to C99
standard header files.

- hack.h, decl.h, and decl.c have been cleaned up and had code
moved so that things line up as follows:

     hack.h     defines values that are available to all
                NetHack source files, contains enums for use in all
                NetHack source files, and contains a number of
                struct definitions for use in all NetHack source files.
                It does not contain variable declarations or variable
                definitions.

     decl.h     contains the extern declarations for variables that
                are defined in decl.c. These variables are global and
                available to all NetHack source files. The location of
                the variables within decl.h was random, so give it some
                order for now.

     decl.c     contains the definition of the variables declared in
                decl.h, and initializes them where appropriate. The
                variable definitions are laid out in much the
                same order as their declarations in decl.h.

- wintty.h: There were some varying terminal-related prototypes in
system.h, and that was the only thing left that demanded that
system.h be included. Those have been replaced by an #include
<term.h> in include/wintty.h to get the more current (and hopefully
more correct) prototypes, rather than hardcoding them in NetHack
sources.

For edge-case platform compatiblity, there is no #include <term.h>
if the build defines NO_TERMCAP_HEADERS. In that case one set of
hardcoded prototypes is still used in include/wintty.h.

The added #include "term.h" is also bypassed for NO_TERMS builds (builds
that don't link to terminfo/termcap at all, but still present a tty
interface using platform or window-port specific functions to fulfill
the same role as that of terminfo/termcap).

- some scattered, unnecessary #include "integer.h" were removed from
various files, since that's always included in current NetHack-3.7
sources, either directly from config.h or indirectly from #include
"hack.h".

- system.h references removed.

- new cstd.h added; the #include "system.h" references in Makefiles
and project files (Xcode, visual studio), were replaced
with #include "cstd.h" references. A "make depends" is probably
warranted.

Also:

 - Use of <term.h>, which defines clear_screen() as a macro, conflicts
with an actual function with that name in win/tty/termcap.c. The most
straight-forward course of action was to rename the NetHack function,
and change the references to it, from clear_screen() to
term_clear_screen(), so that was done.
2023-04-05 11:49:09 -04:00
nhmall
85feda8774 comment out WANT_ASAN=1 for now
encountered an error testing it on macOS
2023-03-29 22:09:19 -04:00
nhmall
d783afbda1 support WANT_ASAN=1 on make command line in linux.370 and macOS.370
When the address sanitizer is in use for gcc, clang, or visual studio,
(-fsanitize=address) define the NetHack preprocessor symbol USING_ADDRESS_SANITIZER.
2023-03-29 21:39:44 -04:00
nhmall
de64ae538c update tested versions of Visual Studio 2023-03-25 2023-03-25 11:38:36 -04:00
nhmall
8f142020a1 some Windows fixes
remove a couple of extraneous files from visual studio project
remove several trailing whitespace at end of line
remove an address sanitizer bounds error during player dialog init
rework fix for darkened lit tiles (fix issue #997)
2023-03-22 11:29:10 -04:00
nhmall
64eeafc2d7 remove package from visual studio solution for now 2023-03-02 22:17:51 -05:00
nhmall
11d83bbad3 retarget Visual Studio SDK 2023-03-02 22:06:14 -05:00