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

Windows: json-c 0.17 compatibility with ssize_t type definition (0.103.11) #1065

Conversation

micahsnyder
Copy link
Contributor

Backport of #1002

Note: this one has an extra commit with the same changes to some files that weren't generated back in 0.103 days when using Visual Studio.


json-c 0.17 defines the ssize_t type using a typedef on Windows. We have been setting ssize_t for Windows to a different type using a #define instead of a typedef.

We should have been using a typedef since it is a type. However, we must also match the exact type they're setting it to or else the compiler will baulk because the types are different.

Note: in C11, it's fine to use typedef the same type more than once, so long as you're defining it the same every time.

json-c 0.17 defines the ssize_t type using a typedef on Windows.
We have been setting ssize_t for Windows to a different type using
a #define instead of a typedef.

We should have been using a typedef since it is a type.
However, we must also match the exact type they're setting it to or else
the compiler will baulk because the types are different.

Note: in C11, it's fine to use typedef the same type more than once, so
long as you're defining it the same every time.
Additional changes required for Visual Studio 0.103 build.
@micahsnyder micahsnyder merged commit d1d9555 into Cisco-Talos:dev/0.103.11 Oct 20, 2023
1 check failed
@micahsnyder micahsnyder deleted the CLAM-2422-json-c-0.17-compatibility-0.103.11 branch October 20, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants