Skip to content

Commit

Permalink
patch c_linux.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
DerryAlex committed Jul 22, 2024
1 parent 3a8c861 commit abcad1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cimport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
paths: [ "test/abi/ci.sh", ".github/workflows/cimport.yml" ]
paths: [ "test/abi/ci.sh", "test/abi/c_linux.patch", ".github/workflows/cimport.yml" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
13 changes: 13 additions & 0 deletions test/abi/c_linux.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/c_linux.zig
+++ b/c_linux.zig
@@ -1,5 +1,9 @@
// /usr/include/pango-1.0/pango/pango-glyph.h:105:9: warning: struct demoted to opaque type - has bitfield
-pub const struct__PangoGlyphVisAttr = opaque {};
+pub const struct__PangoGlyphVisAttr = packed struct(u32) {
+ is_cluster_start: bool,
+ is_color: bool,
+ _: u30,
+};
pub const PangoGlyphVisAttr = struct__PangoGlyphVisAttr;
pub const struct__PangoGlyphInfo = extern struct {
glyph: PangoGlyph = @import("std").mem.zeroes(PangoGlyph),
3 changes: 2 additions & 1 deletion test/abi/ci.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/bash
pkg_rel=1 # used to trigger ci without actual changes
zig translate-c -cflags $(pkg-config --cflags gtk4) -- /usr/include/gtk-4.0/gtk/gtk.h -I/usr/include -I/usr/include/x86_64-linux-gnu/ >c_linux.zig
zig translate-c -cflags $(pkg-config --cflags gtk4) -- /usr/include/gtk-4.0/gtk/gtk.h -I/usr/include -I/usr/include/x86_64-linux-gnu/ >c_linux.zig
patch c_linux.zig c_linux.patch

0 comments on commit abcad1c

Please sign in to comment.