Skip to content

Update json-c to latest (d1018cf)#4948

Open
Lpsd wants to merge 5 commits into
multitheftauto:masterfrom
Lpsd:json-c
Open

Update json-c to latest (d1018cf)#4948
Lpsd wants to merge 5 commits into
multitheftauto:masterfrom
Lpsd:json-c

Conversation

@Lpsd

@Lpsd Lpsd commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Upgrade json-c to current upstream master (d1018cf).

As a bonus, the %.16g double serialization fix that previously required patching json_object.c every upgrade is now done through the public API (json_c_set_serialization_double_format), so future json-c drops should need zero source modifications.

Motivation

Keeping it fresh 🥦

Notable changes

  • The %.17g to %.16g precision fix moves from a source patch to a one-time API call at server & client startup (see CClientGame / CGame). The existing startup self-check still validates the fix.
  • A test resource is included below that exercises float round-trip precision via toJSON/fromJSON. Start it with start json and check toJSON(5.1) does not leak IEEE 754 LSB artifacts.

Test plan

json.zip

Start the resource and confirm the startup precision check passes (no "JSON built without precision modification" warning in logs). Start the json test resource and verify all round-trip tests pass.

toJSON/fromJSON in Lua scripts should behave identically to before.

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@Lpsd Lpsd added the upstream Related to vendor library label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream Related to vendor library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant