function characterSetDefines(charset) {
    var defines = [];
    if (charset === "unicode")
        defines.push("UNICODE", "_UNICODE");
    else if (charset === "mbcs")
        defines.push("_MBCS");
    return defines;
}

function isValidWindowsVersion(systemVersion) {
    // Add new Windows versions to this list when they are released
    var realVersions = [ '6.2', '6.1', '6.0', '5.2', '5.1', '5.0', '4.0' ];
    for (i in realVersions)
        if (systemVersion === realVersions[i])
            return true;

    return false;
}

function getWindowsVersionInFormat(systemVersion, format) {
    if (!isValidWindowsVersion(systemVersion))
        return undefined;

    var major = parseInt(systemVersion.split('.')[0]);
    var minor = parseInt(systemVersion.split('.')[1]);

    if (format === 'hex') {
        return '0x' + major + (minor < 10 ? '0' : '') + minor;
    } else if (format === 'subsystem') {
        // http://msdn.microsoft.com/en-us/library/fcc1zstk.aspx
        return major + '.' + (minor < 10 ? '0' : '') + minor;
    } else {
        throw ("Unrecognized Windows version format " + format + ". Must be in {hex, subsystem}.");
    }
}

function characterSetDefines(charset) {
    var defines = [];
    if (charset === "unicode")
        defines.push("UNICODE", "_UNICODE");
    else if (charset === "mbcs")
        defines.push("_MBCS");
    return defines;
}

function isValidWindowsVersion(systemVersion) {
    // Add new Windows versions to this list when they are released
    var realVersions = [ '6.3', '6.2', '6.1', '6.0', '5.2', '5.1', '5.0', '4.0' ];
    for (i in realVersions)
        if (systemVersion === realVersions[i])
            return true;

    return false;
}

function getWindowsVersionInFormat(systemVersion, format) {
    if (!isValidWindowsVersion(systemVersion))
        return undefined;

    var major = parseInt(systemVersion.split('.')[0]);
    var minor = parseInt(systemVersion.split('.')[1]);

    if (format === 'hex') {
        return '0x' + major + (minor < 10 ? '0' : '') + minor;
    } else if (format === 'subsystem') {
        // http://msdn.microsoft.com/en-us/library/fcc1zstk.aspx
        return major + '.' + (minor < 10 ? '0' : '') + minor;
    } else {
        throw ("Unrecognized Windows version format " + format + ". Must be in {hex, subsystem}.");
    }
}

Add Windows 6.3 (8.1) to the list of known versions.
Add Windows 6.3 (8.1) to the list of known versions.

Change-Id: I4989605776cf6dbbc8a8852d88f0fc6262f08f0b
Reviewed-by: Jake Petroules <2d627e1cecd5435752fa500bacbe05f7cc90c369@petroules.com>
Reviewed-by: Joerg Bornemann <47777b9406dbddd02a3fdca8341789a013805a11@digia.com>
