Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overloads to JSON::Value to allow assignment of size_t types (#214) #215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charles-dyfis-net
Copy link

Addresses build-time issue on MacOS. Not tested on other platforms.

@Thulinma
Copy link
Contributor

On Linux, this change breaks the build: size_t and uint64_t are aliases on 64-bit Linux configurations, and it will complain about a duplicate declaration.

The way we've fixed this so far (there were many more cases of this problem in the past) is to typecast to uint64_t whenever we assign a size_t to a JSON value. Been meaning to go through all the cases we missed, but MacOS is not exactly a priority at the moment since practically none of our customers use it.

It would probably be better to add a precompiler check around a size_t version of these functions, to only add them in if size_t is not already an alias of an existing declaration. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants