[llvm-commits] [llvm] r137111 - /llvm/trunk/lib/Support/Unix/Host.inc

Chris Lattner clattner at apple.com
Tue Aug 9 12:02:33 PDT 2011


On Aug 8, 2011, at 10:13 PM, Bob Wilson wrote:

> Author: bwilson
> Date: Tue Aug  9 00:13:36 2011
> New Revision: 137111
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=137111&view=rev
> Log:
> Recognize the UNAME_RELEASE environment variable to match Darwin's uname.
> When this variable is set, "uname -r" will return its value instead of the
> real OS version.  Make this affect LLVM's triple for consistency.
> <rdar://problem/9919167>

Hi Bob,

Should this be #ifdef __APPLE__ or something?

-Chris

> 
> Modified:
>    llvm/trunk/lib/Support/Unix/Host.inc
> 
> Modified: llvm/trunk/lib/Support/Unix/Host.inc
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Host.inc?rev=137111&r1=137110&r2=137111&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/Unix/Host.inc (original)
> +++ llvm/trunk/lib/Support/Unix/Host.inc Tue Aug  9 00:13:36 2011
> @@ -22,12 +22,18 @@
> #include <sys/utsname.h>
> #include <cctype>
> #include <string>
> +#include <cstdlib> // ::getenv
> 
> using namespace llvm;
> 
> static std::string getOSVersion() {
>   struct utsname info;
> 
> +  // Recognize UNAME_RELEASE environment variable to match Darwin uname.
> +  const char *UnameOverride = ::getenv("UNAME_RELEASE");
> +  if (UnameOverride && UnameOverride[0] != '\0')
> +    return UnameOverride;
> +
>   if (uname(&info))
>     return "";
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list