Skip to content

Commit 59f246c

Browse files
committed
zig 0.14.0
1 parent 1f6ab9e commit 59f246c

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
zig-version: ["0.12.1", "0.13.0", "master"]
17+
zig-version: ["0.14.0", "master"]
1818
os: [ubuntu-latest]
1919

2020
runs-on: ${{ matrix.os }}

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ Provides a package to be used by the zig package manager for C programs.
66

77
For now the hard-coded config assumes linux.
88

9-
| Refname | json-c version | Zig `0.12.x` | Zig `0.13.x` | Zig `0.14.0-dev` |
10-
|---------|------------------------|--------------|--------------|------------------|
11-
| `0.17` | `json-c-0.17-20230812` ||| |
12-
| `0.18` | `json-c-0.18-20240915` ||| |
13-
9+
| Refname | json-c version | Zig `0.12.x` | Zig `0.13.x` | Zig `0.14.x` |
10+
|----------|------------------------|--------------|--------------|--------------|
11+
| `0.17` | `json-c-0.17-20230812` ||| |
12+
| `0.18` | `json-c-0.18-20240915` ||| |
13+
| `0.18+1` | `json-c-0.18-20240915` ||||
1414

1515
## Use
1616

1717
Add the dependency in your `build.zig.zon` by running the following command:
1818
```bash
19-
zig fetch --save git+https://github.com/allyourcodebase/json-c#0.18
19+
zig fetch --save git+https://github.com/allyourcodebase/json-c#0.18+1
2020
```
2121

2222
Then, in your `build.zig`:
2323
```zig
24-
const jsonc = b.dependency("json-c", { .target = target, .optimize = optimize });
24+
const jsonc = b.dependency("jsonc", { .target = target, .optimize = optimize });
2525
const libjsonc = jsonc.artifact("json-c");
2626
// wherever needed:
2727
exe.linkLibrary(libjsonc);

build.zig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ pub fn build(b: *std.Build) !void {
3939
,
4040
},
4141
);
42+
config.addValues(.{
43+
.SIZEOF_INT = target.result.cTypeByteSize(.int),
44+
.SIZEOF_INT64_T = @sizeOf(i64),
45+
.SIZEOF_LONG = target.result.cTypeByteSize(.long),
46+
.SIZEOF_LONG_LONG = target.result.cTypeByteSize(.longlong),
47+
.SIZEOF_SIZE_T = @sizeOf(usize),
48+
.SIZEOF_SSIZE_T = @sizeOf(isize),
49+
});
4250

4351
const lib = b.addStaticLibrary(.{
4452
.name = "json-c",
@@ -158,12 +166,6 @@ const cmake_config = .{
158166
.HAVE_STRTOULL = 1,
159167
.HAVE___THREAD = 1,
160168
.JSON_C_HAVE_INTTYPES_H = 1,
161-
.SIZEOF_INT = @sizeOf(c_int),
162-
.SIZEOF_INT64_T = @sizeOf(i64),
163-
.SIZEOF_LONG = @sizeOf(c_long),
164-
.SIZEOF_LONG_LONG = @sizeOf(c_longlong),
165-
.SIZEOF_SIZE_T = @sizeOf(usize),
166-
.SIZEOF_SSIZE_T = @sizeOf(isize),
167169
.SPEC___THREAD = "__thread",
168170
.STDC_HEADERS = 1,
169171

build.zig.zon

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.{
2-
.name = "json-c",
2+
.name = .jsonc,
33
.version = "0.18.0",
4-
.minimum_zig_version = "0.12.0",
4+
.minimum_zig_version = "0.14.0",
5+
.fingerprint = 0x646d55b66fb40d,
56
.dependencies = .{
67
.upstream = .{
78
.url = "git+https://github.com/json-c/json-c?ref=json-c-0.18-20240915#41a55cfcedb54d9c1874f2f0eb07b504091d7e37",

0 commit comments

Comments
 (0)