build issue without DLB defined

This commit is contained in:
nhmall
2021-08-21 22:47:55 -04:00
parent 9e3eb5c7dd
commit 1c270ea31b
2 changed files with 22 additions and 16 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ GAMEGRP = games
#-INCLUDE compiler.2020 #-INCLUDE compiler.2020
# NetHack sources control # NetHack sources control
NHCFLAGS+=-DDLB #NHCFLAGS+=-DDLB
NHCFLAGS+=-DHACKDIR=\"$(HACKDIR)\" NHCFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
NHCFLAGS+=-DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" NHCFLAGS+=-DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\"
NHCFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE NHCFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
+21 -15
View File
@@ -14,11 +14,13 @@
#include <string.h> #include <string.h>
#endif #endif
static void grow_ld(libdir **, int *, int);
static void xexit(int) NORETURN; static void xexit(int) NORETURN;
char *eos(char *); /* also used by dlb.c */
FILE *fopen_datafile(const char *, const char *);
#ifdef DLB #ifdef DLB
#ifdef DLBLIB #ifdef DLBLIB
static void grow_ld(libdir **, int *, int);
#define DLB_DIRECTORY "Directory" /* name of lib directory */ #define DLB_DIRECTORY "Directory" /* name of lib directory */
#define LIBLISTFILE "dlb.lst" /* default list file */ #define LIBLISTFILE "dlb.lst" /* default list file */
@@ -27,9 +29,6 @@ static void xexit(int) NORETURN;
extern boolean open_library(const char *, library *); extern boolean open_library(const char *, library *);
extern void close_library(library *); extern void close_library(library *);
char *eos(char *); /* also used by dlb.c */
FILE *fopen_datafile(const char *, const char *);
static void Write(int, char *, long); static void Write(int, char *, long);
static void usage(void) NORETURN; static void usage(void) NORETURN;
static void verbose_help(void) NORETURN; static void verbose_help(void) NORETURN;
@@ -128,14 +127,8 @@ Write(int out, char *buf, long len)
xexit(EXIT_FAILURE); xexit(EXIT_FAILURE);
} }
} }
#endif /* DLBLIB */
char * #endif /* DLB */
eos(char *s)
{
while (*s)
s++;
return s;
}
/* open_library(dlb.c) needs this (which normally comes from src/files.c) */ /* open_library(dlb.c) needs this (which normally comes from src/files.c) */
FILE * FILE *
@@ -144,11 +137,24 @@ fopen_datafile(const char *filename, const char *mode)
return fopen(filename, mode); return fopen(filename, mode);
} }
#endif /* DLBLIB */ char *
#endif /* DLB */ eos(char *s)
{
while (*s)
s++;
return s;
}
int int
main(int argc, char **argv) main(int argc
#ifndef DLB
UNUSED
#endif
, char **argv
#ifndef DLB
UNUSED
#endif
)
{ {
#ifdef DLB #ifdef DLB
#ifdef DLBLIB #ifdef DLBLIB