blob: f105b38f83a2cc020528017c527a0b6dfa55b290 [file] [log] [blame]
Daniel Dunbarbb146722008-10-02 01:17:28 +00001//===- 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
18using namespace llvm;
19
20std::string sys::osName() {
21 return "Windows";
22}
23
24std::string sys::osVersion() {
25 OSVERSIONINFO osvi = { 0 };
26 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
27
28 if (!GetVersionEx(&osvi))
29 return "";
30
31 char buf[64];
32 sprintf(buf, "%d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
33
34 return buf;
35}