This should unbreak the build on 64-bit Linux.
authorMikhail Glushenkov <foldr@codedgers.com>
Tue, 8 Sep 2009 20:31:27 +0000 (20:31 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Tue, 8 Sep 2009 20:31:27 +0000 (20:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81252 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/Program.inc

index f5290b4075cd883749cad1b46cdb03c920abf995..1ffd71af10de657fc5f29a2ce03b3296519cae2a 100644 (file)
@@ -39,7 +39,8 @@ Program::Program() : Data_(0) {}
 Program::~Program() {}
 
 unsigned Program::GetPid() const {
-  return reinterpret_cast<unsigned>(Data_);
+  uint64_t pid = reinterpret_cast<uint64_t>(Data_);
+  return static_cast<unsigned>(pid);
 }
 
 // This function just uses the PATH environment variable to find the program.
@@ -241,7 +242,8 @@ Program::Wait(unsigned secondsToWait,
 
   // Parent process: Wait for the child process to terminate.
   int status;
-  pid_t child = reinterpret_cast<pid_t>(Data_);
+  uint64_t pid = reinterpret_cast<uint64_t>(Data_);
+  pid_t child = static_cast<pid_t>(pid);
   while (wait(&status) != child)
     if (secondsToWait && errno == EINTR) {
       // Kill the child.
@@ -294,7 +296,8 @@ Program::Kill(std::string* ErrMsg) {
     return true;
   }
 
-  pid_t pid = reinterpret_cast<pid_t>(Data_);
+  uint64_t pid64 = reinterpret_cast<uint64_t>(Data_);
+  pid_t pid = static_cast<pid_t>(pid64);
   return (kill(pid, SIGKILL) == 0);
 }