Skip to content

Commit

Permalink
attempt to generate c_win.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
DerryAlex committed Aug 12, 2024
1 parent f6a1db7 commit f96e2c7
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/cimport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,24 @@ jobs:
with:
add-paths: test/abi/c_*.zig
commit-message: Update c.zig

build-win:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: mingw-w64-ucrt-x86_64-gtk4

- uses: mlugg/[email protected]

- name: Generate c.zig
run: cd test/abi && ./ci.bat && cd ../..

- uses: peter-evans/create-pull-request@v6
with:
add-paths: test/abi/c_*.zig
commit-message: Update c.zig
2 changes: 2 additions & 0 deletions test/abi/c_win.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include <gtk/gtk.h>
#include <gdk/win32/gdkwin32.h>
13 changes: 13 additions & 0 deletions test/abi/c_win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/c_win.zig
+++ b/c_win.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),
2 changes: 2 additions & 0 deletions test/abi/ci.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zig translate-c -cflags $(pkg-config --cflags gtk4) -- c_win.h -I/ucrt64/include >c_win.zig
patch c_win.zig c_win.patch

0 comments on commit f96e2c7

Please sign in to comment.