LeeHolmes / watchysim

Simulation framework for Watchy watch faces
MIT License
85 stars 9 forks source link

_MAX_INT_DIG not found. #12

Closed dmoisan closed 1 month ago

dmoisan commented 1 month ago

I'm building WatchySim on Visual Studio 2022 Professional. My build is failing with _MAX_INT_DIG not found. This constant doesn't seem to be in limits.h.

dmoisan commented 1 month ago

Does _MAX_INT_DIG refer to the maximum integer digits to display? Would 5 or 6 be an appropriate value? Watchy.cpp is the only place it is referred to, so not much can go wrong for trying various values. EDIT: The value 6 seems to work for _MAX_INT_DIG.

LeeHolmes commented 1 month ago

This comes from "yvals.h", which gets dragged in via the <ctime> and <string> includes. It represents the maximum number of digits for the largest number but realistically nothing in WatchySim will ever get there. The default value is 32.

image

dmoisan commented 1 month ago

I have looked further. I don't have the 2017 MSVC headers. I have the 2022 headers, and its version of yvals.h does not have this particular define.

LeeHolmes commented 1 month ago

Thanks for digging! Mind submitting a PR to include the define in the file itself?

dmoisan commented 1 month ago

Done. I just added the define for _MAX_INT_DIG with a define guard so it's the least disruptive change. You should see the PR now. Thanks.

LeeHolmes commented 1 month ago

Thank you! Merged.