summaryrefslogtreecommitdiff
path: root/src/dedicated.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-03-06 21:14:48 +0000
committertruelight <truelight@openttd.org>2007-03-06 21:14:48 +0000
commit621ea1d863ee516e7e6fdacb839389ef89938192 (patch)
tree1b90e1e6281fd9876636a023d4327f4c1c6bf150 /src/dedicated.cpp
parent43133c766c850ac4be15c9d357183d21aa765cc0 (diff)
downloadopenttd-621ea1d863ee516e7e6fdacb839389ef89938192.tar.xz
(svn r9035) -Fix [SunOS]: Solaris sometimes has pid_t defined as long. Fix warnings in those cases
Diffstat (limited to 'src/dedicated.cpp')
-rw-r--r--src/dedicated.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dedicated.cpp b/src/dedicated.cpp
index d142edc0c..124274662 100644
--- a/src/dedicated.cpp
+++ b/src/dedicated.cpp
@@ -14,6 +14,14 @@
#include <sys/types.h>
#include <unistd.h>
+#if defined(SUNOS) && !defined(_LP64) && !defined(_I32LPx)
+/* Solaris has, in certain situation, pid_t defined as long, while in other
+ * cases it has it defined as int... this handles all cases nicely. */
+# define PRINTF_PID_T "%ld"
+#else
+# define PRINTF_PID_T "%d"
+#endif
+
void DedicatedFork(void)
{
/* Fork the program */
@@ -47,7 +55,7 @@ void DedicatedFork(void)
default:
/* We're the parent */
printf("Loading dedicated server...\n");
- printf(" - Forked to background with pid %d\n", pid);
+ printf(" - Forked to background with pid " PRINTF_PID_T "\n", pid);
exit(0);
}
}