1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
|
/* Copyright (C) 2001 by Alex Kompel <shurikk@pacbell.net> */
/* Copyright (c) NetHack PC Development Team 1993, 1994. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef WCECONF_H
#define WCECONF_H
#pragma warning(disable:4142) /* benign redefinition of type */
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
/* Detect the targe device */
#if defined(WIN32_PLATFORM_PSPC)
# if _WIN32_WCE >= 300
# define WIN_CE_POCKETPC
# else
# define WIN_CE_PS2xx
# endif
#elif defined(WIN32_PLATFORM_HPCPRO)
# define WIN_CE_HPCPRO
#elif defined(WIN32_PLATFORM_WFSP)
# define WIN_CE_SMARTPHONE
#else
# error "Unsupported Windows CE platform"
#endif
/* #define SHELL /* nt use of pcsys routines caused a hang */
#define RANDOM /* have Berkeley random(3) */
#define TEXTCOLOR /* Color text */
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
#define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */
#define PC_LOCKING /* Prevent overwrites of aborted or in-progress games */
/* without first receiving confirmation. */
#define SELF_RECOVER /* Allow the game itself to recover from an aborted game */
#define NOTSTDC /* no strerror() */
#define USER_SOUNDS
#define AUTOPICKUP_EXCEPTIONS
/*
* -----------------------------------------------------------------
* The remaining code shouldn't need modification.
* -----------------------------------------------------------------
*/
/* #define SHORT_FILENAMES /* All NT filesystems support long names now */
#ifdef MICRO
#undef MICRO /* never define this! */
#endif
#define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that
it is defined for WIN32.
Allow paths to be specified for HACKDIR,
LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
#define NO_TERMS
#define ASCIIGRAPH
#ifdef OPTIONS_USED
#undef OPTIONS_USED
#endif
#ifdef MSWIN_GRAPHICS
#define OPTIONS_USED "guioptions"
#else
#define OPTIONS_USED "ttyoptions"
#endif
#define OPTIONS_FILE OPTIONS_USED
#define PORT_HELP "porthelp"
#if defined(WIN_CE_POCKETPC)
# define PORT_CE_PLATFORM "Pocket PC"
#elif defined(WIN_CE_PS2xx)
# define PORT_CE_PLATFORM "Palm-size PC 2.11"
#elif defined(WIN_CE_HPCPRO)
# define PORT_CE_PLATFORM "H/PC Pro 2.11"
#elif defined(WIN_CE_SMARTPHONE)
# define PORT_CE_PLATFORM "Smartphone 2002"
#endif
#if defined(ARM)
# define PORT_CE_CPU "ARM"
#elif defined(PPC)
# define PORT_CE_CPU "PPC"
#elif defined(ALPHA)
# define PORT_CE_CPU "ALPHA"
#elif defined(SH3)
# define PORT_CE_CPU "SH3"
#elif defined(SH4)
# define PORT_CE_CPU "SH4"
#elif defined(MIPS)
# define PORT_CE_CPU "MIPS"
#elif defined(X86) || defined(_X86_)
# define PORT_CE_CPU "X86"
#else
# error Only ARM, PPC, ALPHA, SH3, SH4, MIPS and X86 supported
#endif
#define RUNTIME_PORT_ID /* trigger run-time port identification since
Makedefs is bootstrapped on a cross-platform. */
#include <string.h> /* Provides prototypes of strncmpi(), etc. */
#ifdef STRNCMPI
#define strncmpi(a,b,c) _strnicmp(a,b,c)
#endif
#ifdef STRCMPI
#define strcmpi(a,b) _stricmp(a,b)
#define stricmp(a,b) _stricmp(a,b)
#endif
#include <stdlib.h>
#define PATHLEN BUFSZ /* maximum pathlength */
#define FILENAME BUFSZ /* maximum filename length (conservative) */
#if defined(_MAX_PATH) && defined(_MAX_FNAME)
# if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
#undef PATHLEN
#undef FILENAME
#define PATHLEN _MAX_PATH
#define FILENAME _MAX_FNAME
# endif
#endif
#define NO_SIGNAL
#define index strchr
#define rindex strrchr
#define USE_STDARG
#ifdef RANDOM
/* Use the high quality random number routines. */
#define Rand() random()
#else
#define Rand() rand()
#endif
#define FCMASK 0660 /* file creation mask */
#define regularize nt_regularize
#define HLOCK "NHPERM"
#ifndef M
#define M(c) ((char) (0x80 | (c)))
/* #define M(c) ((c) - 128) */
#endif
#ifndef C
#define C(c) (0x1f & (c))
#endif
#if defined(DLB)
#define FILENAME_CMP _stricmp /* case insensitive */
#endif
#if 0
extern char levels[], bones[], permbones[],
#endif /* 0 */
/* this was part of the MICRO stuff in the past */
extern const char *alllevels, *allbones;
extern char hackdir[];
#define ABORT C('a')
#define getuid() 1
#define getlogin() ((char *)0)
extern void NDECL(win32_abort);
#ifdef WIN32CON
extern void FDECL(nttty_preference_update, (const char *));
extern void NDECL(toggle_mouse_support);
#endif
#ifndef alloca
#define ALLOCA_HACK /* used in util/panic.c */
#endif
#ifndef REDO
#undef Getchar
#define Getchar nhgetch
#endif
#ifdef _MSC_VER
#if 0
#pragma warning(disable:4018) /* signed/unsigned mismatch */
#pragma warning(disable:4305) /* init, conv from 'const int' to 'char' */
#endif
#pragma warning(disable:4761) /* integral size mismatch in arg; conv supp*/
#ifdef YYPREFIX
#pragma warning(disable:4102) /* unreferenced label */
#endif
#endif
/* UNICODE stuff */
#define NHSTR_BUFSIZE 255
#ifdef UNICODE
#define NH_W2A(w, a, cb) ( WideCharToMultiByte( \
CP_ACP, \
0, \
(w), \
-1, \
(a), \
(cb), \
NULL, \
NULL), (a) )
#define NH_A2W(a, w, cb) ( MultiByteToWideChar( \
CP_ACP, \
0, \
(a), \
-1, \
(w), \
(cb)), (w) )
#else
#define NH_W2A(w, a, cb) (strncpy((a), (w), (cb)))
#define NH_A2W(a, w, cb) (strncpy((w), (a), (cb)))
#endif
extern int FDECL(set_win32_option, (const char *, const char *));
/*
* 3.4.3 addition - Stuff to help the user with some common, yet significant errors
* Let's make it NOP for now
*/
#define interject_assistance(_1,_2,_3,_4)
#define interject(_1)
/* Missing definitions */
extern int mswin_have_input();
#define kbhit mswin_have_input
#define getenv(a) ((char*)NULL)
/* __stdio.h__ */
#define perror(a)
#define freopen(a, b, c) fopen(a, b)
extern int isatty(int);
/* __time.h___ */
#ifndef _TIME_T_DEFINED
typedef __int64 time_t; /* time value */
#define _TIME_T_DEFINED /* avoid multiple def's of time_t */
#endif
#ifndef _TM_DEFINED
struct tm {
int tm_sec; /* seconds after the minute - [0,59] */
int tm_min; /* minutes after the hour - [0,59] */
int tm_hour; /* hours since midnight - [0,23] */
int tm_mday; /* day of the month - [1,31] */
int tm_mon; /* months since January - [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
int tm_isdst; /* daylight savings time flag - - NOT IMPLEMENTED */
};
#define _TM_DEFINED
#endif
extern struct tm * __cdecl localtime(const time_t *);
extern time_t __cdecl time(time_t *);
/* __stdio.h__ */
#ifndef BUFSIZ
#define BUFSIZ 255
#endif
#define rewind(stream) (void)fseek( stream, 0L, SEEK_SET )
/* __io.h__ */
typedef long off_t;
extern int __cdecl close(int);
extern int __cdecl creat(const char *, int);
extern int __cdecl eof(int);
extern long __cdecl lseek(int, long, int);
extern int __cdecl open(const char *, int, ...);
extern int __cdecl read(int, void *, unsigned int);
extern int __cdecl unlink(const char *);
extern int __cdecl write(int, const void *, unsigned int);
extern int __cdecl rename(const char *, const char *);
extern int __cdecl access(const char *, int);
#ifdef DeleteFile
#undef DeleteFile
#endif
#define DeleteFile(a) unlink(a)
int chdir( const char *dirname );
extern char *getcwd( char *buffer, int maxlen );
/* __stdlib.h__ */
#define abort() (void)TerminateProcess(GetCurrentProcess(), 0)
#ifndef strdup
#define strdup _strdup
#endif
/* sys/stat.h */
#define S_IWRITE GENERIC_WRITE
#define S_IREAD GENERIC_READ
/* CE 2.xx is missing even more stuff */
#if defined(WIN_CE_PS2xx) || defined(WIN32_PLATFORM_HPCPRO)
#define ZeroMemory(p, s) memset((p), 0, (s))
extern int __cdecl isupper(int c);
extern int __cdecl isdigit(int c);
extern int __cdecl isspace(int c);
extern int __cdecl isprint(int c);
extern char* __cdecl _strdup(const char* s);
extern char* __cdecl strrchr( const char *string, int c );
extern int __cdecl _stricmp(const char* a, const char* b);
extern FILE * __cdecl fopen(const char* filename, const char *mode);
extern int __cdecl fscanf(FILE *f , const char *format, ...);
extern int __cdecl fprintf(FILE *f , const char *format, ...);
extern int __cdecl vfprintf(FILE* f, const char *format, va_list args);
extern int __cdecl fgetc(FILE * f);
extern char * __cdecl fgets(char *s, int size, FILE *f);
extern int __cdecl printf(const char *format, ...);
extern int __cdecl vprintf(const char *format, va_list args);
extern int __cdecl puts(const char * s);
extern FILE* __cdecl _getstdfilex(int desc);
extern int __cdecl fclose(FILE * f);
extern size_t __cdecl fread(void *p, size_t size, size_t count, FILE *f);
extern size_t __cdecl fwrite(const void *p, size_t size, size_t count, FILE * f);
extern int __cdecl fflush(FILE *f);
extern int __cdecl feof(FILE *f);
extern int __cdecl fseek(FILE *f, long offset, int from);
extern long __cdecl ftell(FILE * f);
#endif
/* ARM - the processor; avoids conflict with ARM in hack.h */
# ifdef ARM
# undef ARM
# endif
/* leave - Windows CE defines leave as part of exception handling (__leave)
It confilicts with existing sources and since we don't use exceptions it is safe
to undefine it */
# ifdef leave
# undef leave
# endif
#endif /* WCECONF_H */
|