Windows Calculator: A simple yet powerful calculator that ships with Windows
Go to file
Daniel Belcher d21a47d5a1
Compile CalcManager project with or without precompiled headers (#436)
Fixes #324 .

Description of the changes:
In an effort to support other compilers (#109), this change reworks how precompiled headers are handled. For toolchains where precompiled headers are not used, there is unnecessary compilation cost because each source file explicity includes the pch, meaning all system headers in the pch were recompiled for each translation unit. This change modifies the project's files so that each translation unit includes a minimal set of dependent headers. For MSVC users, the precompiled headers option is still enabled and the precompiled header is added to each translation unit using the compiler's Forced Includes option. The end result is that MSVC users still see the same build times, but other toolchains are free to use or not use precompiled headers.

Risks introduced
Given that our CI build uses MSVC, this change introduces the risk that a system header is added to the pch and the CalcManager project builds correctly, but builds could be broken for other toolsets that don't use pch. We know we want to add support for Clang in our CI build (#211). It seems reasonable to also compile without precompiled headers there so that we can regression test this setup.

How changes were validated:
Rebuild CalcManager project. Compile time: ~4.5s.
Disable precompiled headers, keeping explicit include for pch in each source file. Compile time: ~13s.
Remove explicit pch inclusion and add the appropriate headers to each translation unit to allow the project to compile. Compile time: ~8s.
Re-enable pch and include it using the Forced Includes compiler option. MSVC compile time: ~4.5s.
Minor changes
Delete 'targetver.h'. I found this while looking around for system headers in the project. It's unused and unreferenced so let's remove it.
2019-04-17 17:28:45 -07:00
.github Updating Contributing (#431) 2019-04-09 17:36:36 -07:00
build Internal builds now require the OAuth access token (#457) 2019-04-15 14:12:10 -07:00
docs Updating Contributing (#431) 2019-04-09 17:36:36 -07:00
internal Remove invalid links from comments (#201) 2019-03-08 10:28:35 -08:00
src Compile CalcManager project with or without precompiled headers (#436) 2019-04-17 17:28:45 -07:00
Tools/PGO Hello GitHub 2019-01-28 16:24:37 -08:00
.editorconfig Remove duplicate .editorconfig. (#257) 2019-03-11 17:04:17 -07:00
.gitattributes Hello GitHub 2019-01-28 16:24:37 -08:00
.gitignore Add TemporaryKey.pfx (#354) 2019-03-21 17:03:42 -07:00
CODE_OF_CONDUCT.md Hello GitHub 2019-01-28 16:24:37 -08:00
CONTRIBUTING.md Updating Contributing (#431) 2019-04-09 17:36:36 -07:00
LICENSE Hello GitHub 2019-01-28 16:24:37 -08:00
NOTICE.txt Switch urls from http: to https: (#137) 2019-03-07 08:56:25 -08:00
nuget.config Hello GitHub 2019-01-28 16:24:37 -08:00
README.md Update README to add description of "date calculation" functionality (#365) 2019-04-03 06:45:47 -07:00

Calculator

The Windows Calculator app is a modern Windows app written in C++ that ships pre-installed with Windows. The app provides standard, scientific, and programmer calculator functionality, as well as a set of converters between various units of measurement and currencies.

Calculator ships regularly with new features and bug fixes. You can get the latest version of Calculator in the Microsoft Store.

Build Status

Calculator Screenshot

Features

  • Standard Calculator functionality which offers basic operations and evaluates commands immediately as they are entered.
  • Scientific Calculator functionality which offers expanded operations and evaluates commands using order of operations.
  • Programmer Calculator functionality which offers common mathematical operations for developers including conversion between common bases.
  • Date Calculation functionality which offers the difference between two dates, as well as the ability to add/subtract years, months and/or days to/from a given input date.
  • Calculation history and memory capabilities.
  • Conversion between many units of measurement.
  • Currency conversion based on data retrieved from Bing.

Getting started

Prerequisites:

  • Your computer must be running Windows 10, version 1803 or newer.

  • Install the latest version of Visual Studio (the free community edition is sufficient).

    • Install the "Universal Windows Platform Development" workload.
    • Install the optional "C++ Universal Windows Platform tools" component.
    • Install the latest Windows 10 SDK.

    Visual Studio Installation Screenshot

  • Install the XAML Styler Visual Studio extension.

  • Get the code:

    git clone https://github.com/Microsoft/calculator.git
    
  • Open src\Calculator.sln in Visual Studio to build and run the Calculator app.

  • For a general description of the Calculator project architecture see ApplicationArchitecture.md.

Contributing

Want to contribute? The team encourages community feedback and contributions. Please follow our contributing guidelines.

If Calculator is not working properly, please file a report in the Feedback Hub. We also welcome issues submitted on GitHub.

Roadmap

For information regarding Windows Calculator plans and release schedule, please see the Windows Calculator Roadmap.

Data / Telemetry

This project collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. Telemetry is disabled in development builds by default, and can be enabled with the SEND_TELEMETRY build flag.

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at <secure@microsoft.com>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.