LLVM API Documentation

Win32/Host.inc

Go to the documentation of this file.
00001 //===- llvm/System/Win32/Host.inc -------------------------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements the Win32 Host support.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "Win32.h"
00015 #include <cstdio>
00016 #include <string>
00017 
00018 using namespace llvm;
00019 
00020 std::string sys::osName() {
00021   return "Windows";
00022 }
00023 
00024 std::string sys::osVersion() {
00025   OSVERSIONINFO osvi;
00026 
00027   memset(&osvi, 0, sizeof(osvi));
00028   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
00029 
00030   if (!GetVersionEx(&osvi))
00031     return "";
00032 
00033   char buf[64];
00034   sprintf(buf, "%d.%d", (int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion);
00035 
00036   return buf;
00037 }



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.