Skip to content

Remove usingnamespace usage and fixup build script / callconv deprecations#37

Merged
hazeycode merged 3 commits intozig-gamedev:mainfrom
kcbanner:0.15.x
Jul 20, 2025
Merged

Remove usingnamespace usage and fixup build script / callconv deprecations#37
hazeycode merged 3 commits intozig-gamedev:mainfrom
kcbanner:0.15.x

Conversation

@kcbanner
Copy link
Contributor

As of 0.15.x usingnamespace has been removed: ziglang/zig#20663

kcbanner added 2 commits July 20, 2025 02:19
- Fixup build script, callconv deprecations
@hazeycode hazeycode requested a review from Copilot July 20, 2025 09:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the zglfw codebase to be compatible with Zig 0.15.x by removing the deprecated usingnamespace feature and updating build script patterns. The changes also address callconv deprecations by updating from .C to .c.

Key changes include:

  • Replacing usingnamespace with explicit @export calls for Emscripten compatibility functions
  • Updating all callback function calling conventions from .C to .c
  • Modernizing build.zig to use newer addLibrary API instead of separate static/shared library functions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/zglfw.zig Updates calling conventions, removes usingnamespace, adds getInputMode functions, and refactors Emscripten compatibility code
build.zig Modernizes library creation using addLibrary API and createModule pattern
Comments suppressed due to low confidence (1)

src/zglfw.zig:1235

  • The parameter names use anonymous underscores which makes the function signature unclear. Consider using descriptive parameter names like 'joystick_id' and 'state' to improve code readability.
        fn glfwGetGamepadState(_: i32, _: ?*anyopaque) callconv(.c) i32 {

@hazeycode hazeycode merged commit d16ea17 into zig-gamedev:main Jul 20, 2025
3 checks passed
This was referenced Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants