[llvm-commits] [llvm] r156251 - in /llvm/trunk/lib/Support: Process.cpp Unix/Process.inc
NAKAMURA Takumi
geek4civic at gmail.com
Sun May 6 01:24:18 PDT 2012
Author: chapuni
Date: Sun May 6 03:24:18 2012
New Revision: 156251
URL: http://llvm.org/viewvc/llvm-project?rev=156251&view=rev
Log:
Support/Process: Move llvm::sys::Process::GetRandomNumber() from Process.cpp to Unix/Process.inc.
FIXME: GetRandomNumber() is not implemented in Win32.
Modified:
llvm/trunk/lib/Support/Process.cpp
llvm/trunk/lib/Support/Unix/Process.inc
Modified: llvm/trunk/lib/Support/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Process.cpp?rev=156251&r1=156250&r2=156251&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Process.cpp (original)
+++ llvm/trunk/lib/Support/Process.cpp Sun May 6 03:24:18 2012
@@ -13,7 +13,6 @@
#include "llvm/Support/Process.h"
#include "llvm/Config/config.h"
-#include <cstdlib>
namespace llvm {
using namespace sys;
@@ -23,15 +22,6 @@
//=== 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.
Modified: llvm/trunk/lib/Support/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=156251&r1=156250&r2=156251&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Process.inc (original)
+++ llvm/trunk/lib/Support/Unix/Process.inc Sun May 6 03:24:18 2012
@@ -297,3 +297,12 @@
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
+}
More information about the llvm-commits
mailing list