changeset 192:3de8058dd549

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.
author John "Elwin" Edwards
date Mon, 03 Aug 2015 21:29:16 -0400
parents fb25a62680c7
children 533f1882dcb6
files srogue/main.c srogue/rogue.h srogue/save.c
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/srogue/main.c	Mon Aug 03 17:16:42 2015 -0400
+++ b/srogue/main.c	Mon Aug 03 21:29:16 2015 -0400
@@ -172,7 +172,7 @@
 	/* 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);
--- a/srogue/rogue.h	Mon Aug 03 17:16:42 2015 -0400
+++ b/srogue/rogue.h	Mon Aug 03 21:29:16 2015 -0400
@@ -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);
--- a/srogue/save.c	Mon Aug 03 17:16:42 2015 -0400
+++ b/srogue/save.c	Mon Aug 03 21:29:16 2015 -0400
@@ -296,6 +296,6 @@
 	strcpy(file_name, file);
 	setup();
 	restscr(cw);
-	md_srandom(getpid());
+	md_srandom(md_getpid());
 	playit();
 }