Silence a warning
[oota-llvm.git] / lib / System / Win32 / Host.inc
1 //===- llvm/System/Win32/Host.inc -------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the Win32 Host support.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "Win32.h"
15 #include <cstdio>
16 #include <string>
17
18 using namespace llvm;
19
20 std::string sys::osName() {
21   return "Windows";
22 }
23
24 std::string sys::osVersion() {
25   OSVERSIONINFO osvi;
26
27   memset(&osvi, 0, sizeof(osvi));
28   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
29
30   if (!GetVersionEx(&osvi))
31     return "";
32
33   char buf[64];
34   sprintf(buf, "%d.%d", (int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion);
35
36   return buf;
37 }