diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 806f2b45b..a947dfb62 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -269,8 +269,8 @@ else endif ifeq ($(CLANG), y) - CPP := ${TOOL_PREFIX}clang++ - CC := ${TOOL_PREFIX}clang + CPP := clang++ + CC := clang else CPP := ${TOOL_PREFIX}g++ CC := ${TOOL_PREFIX}gcc @@ -304,17 +304,38 @@ ifeq ($(DEBUG), y) ifndef COPTIM COPTIM := -Og endif + ifndef CXXOPTIM + ifeq ($(CLANG), y) + CXXOPTIM := -Os + else + CXXOPTIM := -Og + endif + endif else DFLAGS += -g0 ifeq ($(OPTIM), y) AOPTIM := -mtune=native ifndef COPTIM - COPTIM := -O3 -ffp-contract=fast -flto + CXXOPTIM := -O3 -ffp-contract=fast -flto + endif + ifndef CXXOPTIM + ifeq ($(CLANG), y) + CXXOPTIM := -Os -ffp-contract=fast -flto + else + CXXOPTIM := -O3 -ffp-contract=fast -flto + endif endif else ifndef COPTIM COPTIM := -O3 endif + ifndef CXXOPTIM + ifeq ($(CLANG), y) + CXXOPTIM := -Os + else + CXXOPTIM := -O3 + endif + endif endif endif ifeq ($(AVX), y) @@ -531,7 +552,9 @@ CFLAGS := $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ # Add freetyp2 references through pkgconfig CFLAGS := $(CFLAGS) `pkg-config --cflags freetype2` -CXXFLAGS := $(CFLAGS) +CXXFLAGS := $(OPTS) $(DFLAGS) $(CXXOPTIM) $(AOPTIM) \ + $(AFLAGS) -fomit-frame-pointer -mstackrealign -Wall \ + -fno-strict-aliasing CFLAGS += -Werror=implicit-int -Werror=implicit-function-declaration \ -Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition @@ -811,13 +834,21 @@ else endif ifeq ($(RTMIDI), y) - LIBS += -lrtmidi -lwinmm + ifeq ($(CLANG), y) + LIBS += -lrtmidi.dll -lwinmm + else + LIBS += -lrtmidi -lwinmm + endif endif ifeq ($(VNC), y) LIBS += $(VNCLIB) -lws2_32 endif -LIBS += -lpng -lz -lwsock32 -liphlpapi -lpsapi -lhid -lsetupapi -luxtheme -static -lstdc++ +ifeq ($(CLANG), y) + LIBS += -lpng -lz -lwsock32 -liphlpapi -lpsapi -lhid -lsetupapi -luxtheme -static -lstdc++.dll +else + LIBS += -lpng -lz -lwsock32 -liphlpapi -lpsapi -lhid -lsetupapi -luxtheme -static -lstdc++ +endif ifneq ($(X64), y) ifneq ($(ARM64), y) LIBS += -Wl,--large-address-aware diff --git a/src/win/win_media_menu.c b/src/win/win_media_menu.c index 93d7396ae..9e5603442 100644 --- a/src/win/win_media_menu.c +++ b/src/win/win_media_menu.c @@ -544,6 +544,10 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) int ret = 0; int wp = 0; +#ifdef __clang__ + BROWSEINFO bi; +#endif + id = LOWORD(wParam) & 0x00ff; switch (LOWORD(wParam) & 0xff00) { @@ -651,10 +655,15 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case IDM_CDROM_DIR: +#ifndef __clang__ BROWSEINFO bi = { .hwndOwner = hwnd, .ulFlags = BIF_EDITBOX }; +#else + bi.hwndOwner = hwnd; + bi.ulFlags = BIF_EDITBOX; +#endif OleInitialize(NULL); int old_dopause = dopause; plat_pause(1);