fix SYSCF so that things build when first defined
Things won't build for ports that first define SYSCF. This moves assure_syscf_file() from unixmain.c to files.c and adjusts extern.h to get it out from under #ifdef UNIX. The call to assure_syscf_file() in options.c was only #ifdef SYSCF, SYSCF_FILE and not UNIX, so new ports #defining SYSCF would get an erro. assure_syscf_file() will be utilized by mswin when SYSCF is defined.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/* NetHack 3.5 pcmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.5 pcmain.c $NHDT-Date: 1426966701 2015/03/21 19:38:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */
|
||||
/* NetHack 3.5 pcmain.c $Date: 2012/01/20 03:41:31 $ $Revision: 1.48 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/* main.c - MSDOS, OS/2, ST, Amiga, and NT NetHack */
|
||||
/* main.c - MSDOS, OS/2, ST, Amiga, and Windows NetHack */
|
||||
|
||||
#include "hack.h"
|
||||
#include "dlb.h"
|
||||
@@ -244,6 +244,9 @@ char *argv[];
|
||||
|
||||
#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
|
||||
chdirx(hackdir,0);
|
||||
#endif
|
||||
#ifdef SYSCF
|
||||
initoptions();
|
||||
#endif
|
||||
prscore(argc, argv);
|
||||
nethack_exit(EXIT_SUCCESS);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 unixmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.5 unixmain.c $NHDT-Date: 1426966705 2015/03/21 19:38:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ */
|
||||
/* NetHack 3.5 unixmain.c $Date: 2012/01/27 20:15:31 $ $Revision: 1.42 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -648,20 +648,4 @@ get_unix_pw()
|
||||
return pw;
|
||||
}
|
||||
|
||||
#ifdef SYSCF_FILE
|
||||
void
|
||||
assure_syscf_file(){
|
||||
/* All we really care about is the end result - can we read the file?
|
||||
* So just check that directly. */
|
||||
int fd;
|
||||
fd = open(SYSCF_FILE, O_RDONLY);
|
||||
if(fd >= 0){
|
||||
/* readable */
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
raw_printf("Unable to open SYSCF_FILE.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
/*unixmain.c*/
|
||||
|
||||
Reference in New Issue
Block a user