- 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.
99 lines
2.5 KiB
C
99 lines
2.5 KiB
C
/* NetHack 3.6 os2conf.h $NHDT-Date: 1432512775 2015/05/25 00:12:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
|
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
|
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
|
|
/* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993, 1996. */
|
|
/* NetHack may be freely redistributed. See license for details. */
|
|
|
|
#ifdef OS2
|
|
#ifndef OS2CONF_H
|
|
#define OS2CONF_H
|
|
|
|
/*
|
|
* Compiler configuration. Compiler may be
|
|
* selected either here or in Makefile.os2.
|
|
*/
|
|
|
|
/* #define OS2_MSC /* Microsoft C 5.1 and 6.0 */
|
|
#define OS2_GCC /* GCC emx 0.8f */
|
|
/* #define OS2_CSET2 /* IBM C Set/2 (courtesy Jeff Urlwin) */
|
|
/* #define OS2_CSET2_VER_1 /* CSet/2 version selection */
|
|
/* #define OS2_CSET2_VER_2 /* - " - */
|
|
|
|
/*
|
|
* System configuration.
|
|
*/
|
|
|
|
#define OS2_USESYSHEADERS /* use compiler's own system headers */
|
|
/* #define OS2_HPFS /* use OS/2 High Performance File System */
|
|
|
|
#if defined(OS2_GCC) || defined(OS2_CSET2)
|
|
#define OS2_32BITAPI /* enable for compilation in OS/2 2.0 */
|
|
#endif
|
|
|
|
/*
|
|
* Other configurable options. Generally no
|
|
* reason to touch the defaults, I think.
|
|
*/
|
|
|
|
/*#define MFLOPPY /* floppy and ramdisk support */
|
|
#define RANDOM /* Berkeley random(3) */
|
|
#define SHELL /* shell escape */
|
|
/* #define TERMLIB /* use termcap file */
|
|
#define ANSI_DEFAULT /* allows NetHack to run without termcap file */
|
|
#define TEXTCOLOR /* allow color */
|
|
|
|
/*
|
|
* The remaining code shouldn't need modification.
|
|
*/
|
|
|
|
#ifdef MSDOS
|
|
#undef MSDOS /* MSC autodefines this but we don't want it */
|
|
#endif
|
|
|
|
#ifndef MICRO
|
|
#define MICRO /* must be defined to allow some inclusions */
|
|
#endif
|
|
|
|
#if !defined(TERMLIB) && !defined(ANSI_DEFAULT)
|
|
#define ANSI_DEFAULT /* have to have one or the other */
|
|
#endif
|
|
|
|
#define PATHLEN 260 /* maximum pathlength (HPFS) */
|
|
#define FILENAME 260 /* maximum filename length (HPFS) */
|
|
#ifndef MICRO_H
|
|
#include "micro.h" /* necessary externs for [os_name].c */
|
|
#endif
|
|
|
|
#ifndef SYSTEM_H
|
|
/* #include "system.h" */
|
|
#endif
|
|
|
|
#include <time.h>
|
|
|
|
/* the high quality random number routines */
|
|
#ifndef USE_ISAAC64
|
|
# ifdef RANDOM
|
|
# define Rand() random()
|
|
# else
|
|
# define Rand() rand()
|
|
# endif
|
|
#endif
|
|
|
|
/* file creation mask */
|
|
|
|
#include <sys\types.h>
|
|
#include <sys\stat.h>
|
|
|
|
#define FCMASK (S_IREAD | S_IWRITE)
|
|
|
|
#include <fcntl.h>
|
|
|
|
#ifdef __EMX__
|
|
#include <unistd.h>
|
|
#define sethanguphandler(foo) (void) signal(SIGHUP, (SIG_RET_TYPE) foo)
|
|
#endif
|
|
|
|
void hangup(int i);
|
|
#endif /* OS2CONF_H */
|
|
#endif /* OS2 */
|