JSBSim-Team / jsbsim

An open source flight dynamics & control software library
GNU Lesser General Public License v2.1
1.22k stars 420 forks source link

MSVC: toupper is not a member of std #1019

Closed carlocorradini closed 3 months ago

carlocorradini commented 3 months ago

I'm submitting a ...

Describe the issue Using MSVC 14.0 (2015), I receive the following error during compilation: error C2039: 'toupper': is not a member of 'std'

What is the current behavior? Compilation error: error C2039: 'toupper': is not a member of 'std'

What is the expected behavior? Compile without errors

Please tell us about your environment:

Other information The bug is simple to resolve. I'll create a PR ASAP

seanmcleod commented 3 months ago

Hmm, I was a bit surprised since we don't have an issue compiling aeromatic using the github build workflow and when I compile locally. But I see you're using a fairly old MSVC (2015) and we're using MSVC (2019) as part of the github build workflow and I'm compiling locally with MSVC (2022).

Having a quick look locally (MSVC 2022) I see the following in <string> which is included by aeromatic's types.cpp.

// The <cctype> include below is to workaround many projects that assumed
// <string> includes it. We workaround it instead of fixing all the upstream
// projects because <cctype> is inexpensive. See VSO-663136.
#include <cctype>

Which explains why it compiles fine with MSVC 2022, and probably for the same reason with MSVC 2019.

I've approved the workflow run for - https://github.com/JSBSim-Team/jsbsim/pull/1020