srogue: provide type definitions if needed.

If not defined in headers, uid_t and gid_t will be defined as
unsigned ints, and pid_t as int.
This commit is contained in:
John "Elwin" Edwards 2015-08-03 21:29:16 -04:00
parent 3b34109c93
commit 268b30f851
3 changed files with 12 additions and 2 deletions

View file

@ -172,7 +172,7 @@ char **envp;
/* START NEW GAME */
dnum = (wizard && getenv("SEED") != NULL ?
atoi(getenv("SEED")) : lowtime + getpid());
atoi(getenv("SEED")) : lowtime + md_getpid());
if(wizard)
printf("Hello %s, welcome to dungeon #%d\n", whoami, dnum);

View file

@ -39,6 +39,16 @@
#include <sys/types.h>
#endif
#ifndef uid_t
typedef unsigned int uid_t;
#endif
#ifndef gid_t
typedef unsigned int gid_t;
#endif
#ifndef pid_t
typedef int pid_t;
#endif
int md_chmod(const char *filename, int mode);
char *md_crypt(const char *key, const char *salt);
int md_dsuspchar(void);

View file

@ -296,6 +296,6 @@ char *file, **envp;
strcpy(file_name, file);
setup();
restscr(cw);
md_srandom(getpid());
md_srandom(md_getpid());
playit();
}