#
#CURSES_DEF = -DUSE_NCURSES_H
+# Uncomment this if youy're compiling Unix Frotz on a machine that lacks
+# the strrchr() libc library call. If you don't know what this means,
+# leave it alone.
+#
+#STRRCHR_DEF = -DNO_STRRCHR
+
# Uncomment this if you're compiling Unix Frotz on a machine that lacks
# the memmove(3) system call. If you don't know what this means, leave it
# alone.
-DVERSION="\"$(VERSION)\"" -DSOUND_DEV="\"$(SOUND_DEV)\""
CURSES_DEFS = $(OPT_DEFS) $(COLOR_DEFS) $(SOUND_DEFS) $(SOUNDCARD) \
- $(MEMMOVE_DEF)
+ $(MEMMOVE_DEF) $(STRRCHR_DEF)
$(NAME): $(NAME)-curses
FILE *pathopen(const char *, const char *, const char *, char *);
+#ifdef NO_STRRCHR
+char *strrchr(const char *, int);
+#endif
+
#ifdef NO_MEMMOVE
void *memmove(void *, void *);
#endif
return blorb_err;
}
}
+
+#ifdef NO_STRRCHR
+/*
+ * This is for operating systems that lack strrchr(3).
+ *
+ */
+char *strrchr(const char *s, int c)
+{
+ const char *save;
+
+ if (c == 0) return (char *)s + strlen(s);
+ save = 0;
+ while (*s) {
+ if (*s == c)
+ save = s;
+ s++;
+ }
+ return (char *)save;
+}
+#endif