neroist / uing

A fork of ui that wraps libui-ng instead of libui

Home Page:https://uing.nim.town

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Too many errors when compiling with clang and cpp

neroist opened this issue · comments

commented

Example:

C:\Users\xx\OneDrive\Documents\uing\uing\libui\windows\drawtext.cpp:279:36: warning: exception specification of
      overriding function is more lax than base version [-Wmicrosoft-exception-spec]
  279 |         virtual HRESULT STDMETHODCALLTYPE GetCurrentTransform(void *clientDrawingContext, DWRITE_MATRIX *transform)
      |                                           ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\dwrite.h:3607:15: note: overridden virtual function is
      here
 3607 |     STDMETHOD(GetCurrentTransform)(
      |               ^
...
7 warnings generated.

^ but x100

fix

This does it:

...
else:
  ...
  when defined(windows):
    ...
    when defined(clang) and defined(cpp):
      {.passC: "-D_CRT_SECURE_NO_WARNINGS".}
      {.passC: "-Wno-int-to-pointer-cast".}
      {.passC: "-Wno-microsoft-exception-spec".}