Skip to content

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

Merged
val-ms merged 2 commits intoCisco-Talos:dev/0.103.11from
val-ms:CLAM-2422-json-c-0.17-compatibility-0.103.11
Oct 20, 2023
Merged

Windows: json-c 0.17 compatibility with ssize_t type definition (0.103.11)#1065
val-ms merged 2 commits intoCisco-Talos:dev/0.103.11from
val-ms:CLAM-2422-json-c-0.17-compatibility-0.103.11

Conversation

@val-ms
Copy link
Contributor

@val-ms val-ms commented Oct 20, 2023

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.
@val-ms val-ms merged commit d1d9555 into Cisco-Talos:dev/0.103.11 Oct 20, 2023
@val-ms val-ms 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