Skip to content

About

The Winpthreads Library for Zig toolchain

Topics

Resources

Stars

12 stars

Watchers

2 watching

Forks

Repository files navigation

The Winpthreads Library for Zig

build

Based on: ziglang/zig#10989 solved: ziglang/zig#22156 (Zig v0.14.0)

Zig v0.6 ~ v0.13.0 toolchain/MinGW don't includes winpthreads.

This library provides POSIX threading APIs for mingw-w64.

For maximum compatibility, winpthreads headers expose APIs without the dllimport attribute by default. If your program is linked against the DLL, you may define the WINPTHREADS_USE_DLLIMPORT macro to add the dllimport attribute to all APIs, which makes function calls to them a bit more efficient.

How to use

Requires: zig v0.12.0 or v0.13.0

  • Make a project:
mkdir your-project-folder
cd your-project-folder 
# generate both (exe and lib template w/ build.zig & build.zig.zon)
zig init
# get latest version (commit-tag or branch)
zig fetch git+https://github.com/kassane/winpthreads-zigbuild#main
  • Add on current project:
# (w/ build.zig & build.zig.zon)
cd your-project-folder
# get latest version
zig fetch git+https://github.com/kassane/winpthreads-zigbuild#main # or #commit-tag

Warn: main branch changes commit hashes.

About

The Winpthreads Library for Zig toolchain

Topics

Resources

Stars

12 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages