Repository navigation
Conversation
| method `vsync=`*(window: Window, v: bool, silent = false) {.base.} = discard | ||
| ## enable/disable vsync | ||
|
|
||
| when sizeof(pointer) == 8: |
There was a problem hiding this comment.
If VulkanSurface needs to be exactly 8 bytes, use uint64 on both architectures.
pointer is just a number anyway.
| proc eglInitialize*(d: EglDisplay; major: ptr int32 = nil; minor: ptr int32 = nil): bool | ||
| proc eglTerminate*(d: EglDisplay) | ||
| proc eglInitialize*(d: EglDisplay; major: ptr int32 = nil; minor: ptr int32 = nil): cuint | ||
| proc eglTerminate*(d: EglDisplay): cuint |
There was a problem hiding this comment.
I don't know much about ABI, but this may not be necessary. bool is more convinient here, and most of the code here discard it anyway.
If you think this is necessary, ok.
There was a problem hiding this comment.
True, I'll see. In theory the C layer should just cast it to a bool. I'm making a new PR on Siwin and I'll check it out.
|
Replaced by levovix0#57 now that upstream levovix0#56 is merged. The replacement addresses both review comments: EGL keeps public bool results through explicit conversion from native cuint bindings, and Vulkan surfaces use uint64 on both architectures. |
Summary
Some platform declarations do not match their C signatures (i.e. 32bit platforms): Wayland and GLX pointers are declared as Nim structs, EGLBoolean results are declared as Nim bool, and Vulkan surface handles lose their upper 32 bits on 32-bit targets.
This PR changes them to match the native signatures and adapt Siwin's callers.
This is stacked on
fix/optional-platform-libraries, the head branch of upstream dynamic-loading PR #56. Its diff contains only the ABI follow-up. The stacked review lives in this fork because the base branch is in this fork; after levovix0#56 merges, the ABI changes can be submitted upstream on their own.wl_display_*andwl_proxy_*names, bind native pointer signatures, and pass.rawfrom Siwin's callers. Keep meaningful Nim helpers such asdispatchPendinganddestroyCallbacks.cuint, includingeglTerminate. Convert results at internal checks and omit bool compatibility adapters.uint64on 32-bit targets, including the exported C header.Direct low-level callers now pass raw Wayland pointers and compare EGLBoolean results with zero or discard them. The dynamic-loading PR retains the previous signatures.
Validation
Checked with Nim 2.2.10 on FreeBSD:
tests/t_dynlib_loading.nimpassed with the default memory manager and--mm:refc, including native EGL/Wayland signature checks and GLX/X11 source-compatibility checks.tests/t_opengl.nimalso passed.dlopenshim.nim check --os:linux --path:src src/siwin.nimpassed for amd64 and i386.git diff --checkpassed against both the stacked base and upstream master.The i386 checks are compile-time checks only; no 32-bit runtime or live Wayland rendering was exercised.