From 54acb28882bc42d58a0c0b8fdd8501bdb88df6e0 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 6 May 2012 08:24:18 +0000 Subject: [PATCH] Support/Process: Move llvm::sys::Process::GetRandomNumber() from Process.cpp to Unix/Process.inc. FIXME: GetRandomNumber() is not implemented in Win32. llvm-svn: 156251 --- llvm/lib/Support/Process.cpp | 10 ---------- llvm/lib/Support/Unix/Process.inc | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp index 2cff1cebe51f..88ca7c3f220f 100644 --- a/llvm/lib/Support/Process.cpp +++ b/llvm/lib/Support/Process.cpp @@ -13,7 +13,6 @@ #include "llvm/Support/Process.h" #include "llvm/Config/config.h" -#include namespace llvm { using namespace sys; @@ -23,15 +22,6 @@ using namespace sys; //=== independent code. //===----------------------------------------------------------------------===// -unsigned llvm::sys::Process::GetRandomNumber() { -#if defined(HAVE_ARC4RANDOM) - return arc4random(); -#else - static int x = (::srand(::time(NULL)), 0); - return ::rand(); -#endif -} - } // Include the platform-specific parts of this class. diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc index f640462a4517..de982625e961 100644 --- a/llvm/lib/Support/Unix/Process.inc +++ b/llvm/lib/Support/Unix/Process.inc @@ -297,3 +297,12 @@ const char *Process::OutputReverse() { const char *Process::ResetColor() { return "\033[0m"; } + +unsigned llvm::sys::Process::GetRandomNumber() { +#if defined(HAVE_ARC4RANDOM) + return arc4random(); +#else + static int x = (::srand(::time(NULL)), 0); + return ::rand(); +#endif +}