rogue4, arogue5: improve portability.
Most changes merely prevent including header files that don't exist. All games now build and run on MinGW, though bugs remain.
This commit is contained in:
parent
120beada5a
commit
be61b1a69e
5 changed files with 46 additions and 40 deletions
|
|
@ -29,6 +29,10 @@
|
|||
SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <Windows.h>
|
||||
#include <Lmcons.h>
|
||||
|
|
@ -40,10 +44,15 @@
|
|||
#undef MOUSE_MOVED
|
||||
#elif defined(__DJGPP__)
|
||||
#include <process.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_UTMPX_H
|
||||
#include <utmpx.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -60,7 +69,7 @@ char *strdup(const char *s);
|
|||
#endif
|
||||
|
||||
#include <curses.h>
|
||||
#if !defined(DJGPP)
|
||||
#ifdef HAVE_TERM_H
|
||||
#include <term.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -657,28 +666,6 @@ md_memused()
|
|||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
md_gethostname()
|
||||
{
|
||||
static char nodename[80];
|
||||
char *n = NULL;
|
||||
#if !defined(_WIN32) && !defined(__DJGPP__)
|
||||
struct utsname ourname;
|
||||
|
||||
if (uname(&ourname) == 0)
|
||||
n = ourname.nodename;
|
||||
#endif
|
||||
if ((n == NULL) || (*n == '\0'))
|
||||
if ( (n = getenv("COMPUTERNAME")) == NULL)
|
||||
if ( (n = getenv("HOSTNAME")) == NULL)
|
||||
n = "localhost";
|
||||
|
||||
strncpy(nodename, n, 80);
|
||||
nodename[79] = 0;
|
||||
|
||||
return(nodename);
|
||||
}
|
||||
|
||||
int
|
||||
md_erasechar()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue