summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/AppHdr.h4
-rw-r--r--crawl-ref/source/debug.cc5
-rw-r--r--crawl-ref/source/libutil.cc3
-rw-r--r--crawl-ref/source/lua/safechnk.lua (renamed from crawl-ref/source/lua/safechunk.lua)0
-rw-r--r--crawl-ref/source/makefile.dos11
-rw-r--r--crawl-ref/source/religion.cc4
6 files changed, 19 insertions, 8 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index c60bd55aca..a781a2b6b3 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -178,6 +178,10 @@
#ifdef __DJGPP__
#define NEED_SNPRINTF
+
+ // [dshaligram] This is distressing, but djgpp lacks (v)snprintf, and
+ // we have to support DOS. Ow. FIXME
+ #define vsnprintf(buf, size, format, args) vsprintf(buf, format, args)
#endif
#elif defined(WIN32CONSOLE) && (defined(__IBMCPP__) || defined(__BCPLUSPLUS__) || defined(__MINGW32__))
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index eb29e8c9d9..13bf8739d9 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -1984,7 +1984,12 @@ static bool debug_fight_sim(int mindex, int missile_slot)
FILE *ostat = fopen("fight.stat", "a");
if (!ostat)
{
+ // I'm not sure what header provides errno on djgpp,
+ // and it's insufficiently important for a wizmode-only
+ // feature.
+#ifndef DOS
mprf("Can't write fight.stat: %s", strerror(errno));
+#endif
return (false);
}
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index 734ae2dc0a..7a3a9db7e5 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -144,7 +144,8 @@ int wrapcprintf( int wrapcol, const char *s, ... )
va_start(args, s);
// XXX: If snprintf isn't available, vsnprintf probably isn't, either.
- int len = vsnprintf(buf, sizeof buf, s, args), olen = len;
+ int len = vsnprintf(buf, sizeof buf, s, args);
+ int olen = len;
va_end(args);
char *run = buf;
diff --git a/crawl-ref/source/lua/safechunk.lua b/crawl-ref/source/lua/safechnk.lua
index cd0c9f036d..cd0c9f036d 100644
--- a/crawl-ref/source/lua/safechunk.lua
+++ b/crawl-ref/source/lua/safechnk.lua
diff --git a/crawl-ref/source/makefile.dos b/crawl-ref/source/makefile.dos
index 869d6f8745..a85301aede 100644
--- a/crawl-ref/source/makefile.dos
+++ b/crawl-ref/source/makefile.dos
@@ -6,20 +6,17 @@ include makefile.obj
# need .exe so make will find the right file
APPNAME = crawl.exe
-CXX = gxx
+CXX = gpp
DELETE = del
COPY = copy
OS_TYPE = DOS
-CFLAGS = -D$(OS_TYPE) $(EXTRA_FLAGS)
-LDFLAGS = -Bc:/djgpp/contrib/pdcurs22/lib
-INSTALLDIR = c:\games\crawl
+CFLAGS = -D$(OS_TYPE) $(EXTRA_FLAGS) -DREGEX_PCRE -DCLUA_BINDINGS
+LDFLAGS =
+LIB = -lpcre -llua
# LIB = -lcurso -lpano
all: $(APPNAME)
-install: $(APPNAME)
- $(COPY) $(APPNAME) ${INSTALLDIR}
-
clean:
$(DELETE) *.o
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 964840f972..8a2edd2095 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -27,6 +27,10 @@
#include <string.h>
#include <stdio.h>
+#ifdef DOS
+#include <dos.h>
+#endif
+
#include "externs.h"
#include "abl-show.h"