From: nethack.allison Date: Tue, 23 Jul 2002 04:51:28 +0000 (+0000) Subject: build fix for files.c X-Git-Tag: MOVE2GIT~2611 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9dad62838d913c6b810d737a9ae68fcdf632ec0;p=nethack build fix for files.c Warwick's plname files.c addition broke the build on both win32 and CE because NAMES_MAX wasn't defined. In win32 it was defined in limits.h, but only when _POSIX_ was defined. In CE it just didn't exist in any of the header files. Since it was also complaining about strdup(), I #ifdef'd Warwick's code out under CE. --- diff --git a/src/files.c b/src/files.c index 507dc8eed..5e1007353 100644 --- a/src/files.c +++ b/src/files.c @@ -42,6 +42,12 @@ extern int errno; # define O_BINARY 0 #endif +#if defined(WIN32) +#define _POSIX_ +#include +#undef _POSIX_ +#endif + #ifdef PREFIXES_IN_USE #define FQN_NUMBUF 4 static char fqn_filename_buffer[FQN_NUMBUF][FQN_MAX_FILENAME]; @@ -808,6 +814,8 @@ restore_saved_game() return fd; } +#if !defined(WIN_CE) + static char* plname_from_file(filename) const char* filename; @@ -901,6 +909,7 @@ char** saved; } } +#endif /* !WIN_CE */ /* ---------- END SAVE FILE HANDLING ----------- */