build both tty NetHack.exe and gui NetHackW.exe

Changes to be committed:
	modified:   include/config.h
	modified:   include/extern.h
	modified:   include/flag.h
	modified:   include/global.h
	modified:   include/ntconf.h
	modified:   include/wintty.h
	modified:   src/cmd.c
	modified:   src/files.c
	modified:   src/options.c
	modified:   sys/share/pcmain.c
	modified:   sys/share/pcsys.c
	modified:   sys/share/pcunix.c
	modified:   sys/winnt/Makefile.gcc
	modified:   sys/winnt/Makefile.msc
	modified:   sys/winnt/nttty.c
	new file:   sys/winnt/stubs.c
	modified:   sys/winnt/winnt.c
	modified:   util/makedefs.c
	modified:   win/tty/wintty.c

Adjust the code and the command line Makefile so that
you no longer have to choose whether to build the tty
version NetHack.exe, or the gui version NetHackW.exe.

Both will now be built in a single 'nmake install' pass.
This commit is contained in:
nhmall
2015-04-22 00:07:46 -04:00
parent 9b63abf2b0
commit aaca36a6d5
19 changed files with 804 additions and 684 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 cmd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 cmd.c $NHDT-Date: 1429675557 2015/04/22 04:05:57 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.187 $ */
/* NetHack 3.5 cmd.c $Date: 2013/03/16 01:44:28 $ $Revision: 1.162 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3718,10 +3718,8 @@ dotravel(VOID_ARGS)
}
#ifdef PORT_DEBUG
# ifdef WIN32CON
extern void NDECL(win32con_debug_keystrokes);
extern void NDECL(win32con_handler_info);
# endif
int
wiz_port_debug()
@@ -3735,9 +3733,9 @@ wiz_port_debug()
char *menutext;
void NDECL((*fn));
} menu_selections[] = {
#ifdef WIN32CON
{"test win32 keystrokes", win32con_debug_keystrokes},
{"show keystroke handler information", win32con_handler_info},
#ifdef WIN32
{"test win32 keystrokes (tty only)", win32con_debug_keystrokes},
{"show keystroke handler information (tty only)", win32con_handler_info},
#endif
{(char *)0, (void NDECL((*)))0} /* array terminator */
};

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 files.c $NHDT-Date: 1429136302 2015/04/15 22:18:22 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.166 $ */
/* NetHack 3.5 files.c $NHDT-Date: 1429675565 2015/04/22 04:06:05 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.169 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1070,7 +1070,7 @@ get_saved_games()
#if defined(SELECTSAVED)
int n, j = 0;
char **result = 0;
# ifdef WIN32CON
# ifdef WIN32
{
char *foundfile;
const char *fq_save;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 options.c $NHDT-Date: 1428088105 2015/04/03 19:08:25 $ $NHDT-Branch: scshunt-regex $:$NHDT-Revision: 1.182 $ */
/* NetHack 3.5 options.c $NHDT-Date: 1429675568 2015/04/22 04:06:08 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.187 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -206,7 +206,7 @@ static struct Bool_Opt
{"toptenwin",&iflags.toptenwin, FALSE, SET_IN_GAME},
{"travel", &flags.travelcmd, TRUE, SET_IN_GAME},
{"use_darkgray", &iflags.wc2_darkgray, TRUE, SET_IN_FILE},
#ifdef WIN32CON
#ifdef WIN32
{"use_inverse", &iflags.wc_inverse, TRUE, SET_IN_GAME}, /*WC*/
#else
{"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/
@@ -311,7 +311,7 @@ static struct Comp_Opt
MAXOCLASSES, SET_IN_GAME },
#ifdef CHANGE_COLOR
{ "palette",
# ifndef WIN32CON
# ifndef WIN32
"palette (00c/880/-fff is blue/yellow/reverse white)",
15 , SET_IN_GAME },
# else
@@ -372,7 +372,7 @@ static struct Comp_Opt
{ "videoshades", "gray shades to map to black/gray/white",
32, DISP_IN_GAME },
#endif
#ifdef WIN32CON
#ifdef WIN32
{"subkeyvalue", "override keystroke value", 7, SET_IN_FILE},
#endif
{ "windowcolors", "the foreground/background colors of windows", /*WC*/
@@ -1734,7 +1734,7 @@ boolean tinitial, tfrom_file;
) {
int color_number, color_incr;
# ifndef WIN32CON
# ifndef WIN32
if (duplicate) complain_about_duplicate(opts,1);
# endif
# ifdef MAC
@@ -1756,7 +1756,7 @@ boolean tinitial, tfrom_file;
# ifdef MAC
}
# endif
#ifdef WIN32CON
#ifdef WIN32
op = string_for_opt(opts, TRUE);
if (!alternative_palette(op))
badoption(opts);
@@ -1802,7 +1802,7 @@ boolean tinitial, tfrom_file;
color_number += color_incr;
}
}
# endif /* !WIN32CON */
# endif /* !WIN32 */
if (!initial) {
need_redraw = TRUE;
}
@@ -1923,7 +1923,7 @@ goodfruit:
if (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, negated))) {
#ifdef WIN32CON
#ifdef WIN32
(void)strncpy(iflags.altkeyhandler, op, MAX_ALTKEYHANDLER - 5);
load_keyboard_handler();
#endif
@@ -2481,7 +2481,7 @@ goodfruit:
/* no duplicate complaint here */
if (negated) bad_negation(fullname, FALSE);
else {
#if defined(WIN32CON)
#if defined(WIN32)
op = string_for_opt(opts, 0);
map_subkeyvalue(op);
#endif
@@ -3782,7 +3782,7 @@ char *buf;
defopt);
else if (!strcmp(optname,"align"))
Sprintf(buf, "%s", rolestring(flags.initalign, aligns, adj));
#ifdef WIN32CON
#ifdef WIN32
else if (!strcmp(optname,"altkeyhandler"))
Sprintf(buf, "%s", iflags.altkeyhandler[0] ?
iflags.altkeyhandler : "default");