Skip to content

fixed defines for NK_SIZE_TYPE and NK_POINTER_TYPE on MinGW and windows clang/clang-cl.#811

Merged
RobLoach merged 5 commits intoImmediate-Mode-UI:masterfrom
m256i:master
Feb 7, 2026
Merged

fixed defines for NK_SIZE_TYPE and NK_POINTER_TYPE on MinGW and windows clang/clang-cl.#811
RobLoach merged 5 commits intoImmediate-Mode-UI:masterfrom
m256i:master

Conversation

@m256i
Copy link
Copy Markdown
Contributor

@m256i m256i commented May 27, 2025

Issue as stated in #810
modified defines for NK_SIZE_TYPE and NK_POINTER_TYPE to:

    #elif defined(_WIN64) && (defined(__MINGW64__) || defined(__clang__))
      #define NK_SIZE/POINTER_TYPE unsigned long long
   ...
    #elif (defined(_WIN32) || defined(WIN32)) && (defined(__MINGW32__) || defined(__clang__))
      #define NK_SIZE/POINTER_TYPE unsigned long  

to account for MinGW 64 and 32 bit aswell as windows clang 64 and 32 bit and clang-cl 64 and 32 bit.
i've put together a quick goldbolt comparison
with MinGW gcc + clang and a gnu/linux gcc basecase, to demonstrate that the fix works as intended.

@m256i
Copy link
Copy Markdown
Contributor Author

m256i commented May 27, 2025

I have not tested building with clang-cl inside Vistual Studio.

Copy link
Copy Markdown
Contributor

@sleeptightAnsiC sleeptightAnsiC left a comment

Choose a reason for hiding this comment

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

Tested under MSYS2 UCRT64 and VS2022, and it indeed fixes this issue.

If you could only remove that one little space, it should be good to merge.

Just for reference, my environment is:

$ uname -a
MINGW64_NT-10.0-22631 QW11090824 3.6.4-23a25d49.x86_64 2025-07-16 16:15 UTC x86_64 Msys
$ gcc --version
gcc.exe (Rev8, Built by MSYS2 project) 15.2.0
$ clang-cl --version
clang version 21.1.0 (https://github.com/msys2/MSYS2-packages dd887afdaff2641f5919b53ef1286f484a8799a7)
** Visual Studio 2022 Developer Command Prompt v17.10.5
> cl /?
Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33813 for x86
> clang-cl --version
clang version 17.0.3

Comment thread src/nuklear.h Outdated
Comment thread src/nuklear.h Outdated
@RobLoach RobLoach merged commit a329721 into Immediate-Mode-UI:master Feb 7, 2026
1 check passed
PavelSharp pushed a commit to PavelSharp/Nuklear that referenced this pull request Feb 15, 2026
…/clang-cl (Immediate-Mode-UI#811)

* Update nuklear.h

fixed pointer and size type defs for MinGW64

* -- added __clang__ macro for windows clang and clang-cl to also work

* updated the template nuklear.h to fix NK_SIZE_TYPE and NK_POINTER_TYPE

* Update src/nuklear.h

* Apply suggestion from @RobLoach

---------

Co-authored-by: Rob Loach <RobLoach@users.noreply.github.com>
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