Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kassane/winpthreads-zigbuild
The Winpthreads Library for Zig toolchain
https://github.com/kassane/winpthreads-zigbuild
mingw-w64 zig-package
Last synced: 23 days ago
JSON representation
The Winpthreads Library for Zig toolchain
- Host: GitHub
- URL: https://github.com/kassane/winpthreads-zigbuild
- Owner: kassane
- License: other
- Created: 2023-03-28T13:48:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-14T15:52:09.000Z (7 months ago)
- Last Synced: 2024-05-01T18:53:40.381Z (6 months ago)
- Topics: mingw-w64, zig-package
- Language: C
- Homepage: https://sourceforge.net/p/mingw-w64/mingw-w64/
- Size: 654 KB
- Stars: 9
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
- Authors: AUTHORS
Awesome Lists containing this project
README
The Winpthreads Library for Zig
-----------------------[![build](https://github.com/kassane/winpthreads-zigbuild/actions/workflows/build.yml/badge.svg)](https://github.com/kassane/winpthreads-zigbuild/actions/workflows/build.yml)
Based on: https://github.com/ziglang/zig/issues/10989
Zig 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 higher
* Make a project:
```bash
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:
```bash
# (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.