Some fixes for Clang compilation.
This commit is contained in:
@@ -269,8 +269,8 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CLANG), y)
|
ifeq ($(CLANG), y)
|
||||||
CPP := ${TOOL_PREFIX}clang++
|
CPP := clang++
|
||||||
CC := ${TOOL_PREFIX}clang
|
CC := clang
|
||||||
else
|
else
|
||||||
CPP := ${TOOL_PREFIX}g++
|
CPP := ${TOOL_PREFIX}g++
|
||||||
CC := ${TOOL_PREFIX}gcc
|
CC := ${TOOL_PREFIX}gcc
|
||||||
@@ -304,17 +304,38 @@ ifeq ($(DEBUG), y)
|
|||||||
ifndef COPTIM
|
ifndef COPTIM
|
||||||
COPTIM := -Og
|
COPTIM := -Og
|
||||||
endif
|
endif
|
||||||
|
ifndef CXXOPTIM
|
||||||
|
ifeq ($(CLANG), y)
|
||||||
|
CXXOPTIM := -Os
|
||||||
|
else
|
||||||
|
CXXOPTIM := -Og
|
||||||
|
endif
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
DFLAGS += -g0
|
DFLAGS += -g0
|
||||||
ifeq ($(OPTIM), y)
|
ifeq ($(OPTIM), y)
|
||||||
AOPTIM := -mtune=native
|
AOPTIM := -mtune=native
|
||||||
ifndef COPTIM
|
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
|
endif
|
||||||
else
|
else
|
||||||
ifndef COPTIM
|
ifndef COPTIM
|
||||||
COPTIM := -O3
|
COPTIM := -O3
|
||||||
endif
|
endif
|
||||||
|
ifndef CXXOPTIM
|
||||||
|
ifeq ($(CLANG), y)
|
||||||
|
CXXOPTIM := -Os
|
||||||
|
else
|
||||||
|
CXXOPTIM := -O3
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(AVX), y)
|
ifeq ($(AVX), y)
|
||||||
@@ -531,7 +552,9 @@ CFLAGS := $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \
|
|||||||
# Add freetyp2 references through pkgconfig
|
# Add freetyp2 references through pkgconfig
|
||||||
CFLAGS := $(CFLAGS) `pkg-config --cflags freetype2`
|
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 \
|
CFLAGS += -Werror=implicit-int -Werror=implicit-function-declaration \
|
||||||
-Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition
|
-Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition
|
||||||
@@ -811,13 +834,21 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(RTMIDI), y)
|
ifeq ($(RTMIDI), y)
|
||||||
LIBS += -lrtmidi -lwinmm
|
ifeq ($(CLANG), y)
|
||||||
|
LIBS += -lrtmidi.dll -lwinmm
|
||||||
|
else
|
||||||
|
LIBS += -lrtmidi -lwinmm
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(VNC), y)
|
ifeq ($(VNC), y)
|
||||||
LIBS += $(VNCLIB) -lws2_32
|
LIBS += $(VNCLIB) -lws2_32
|
||||||
endif
|
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 ($(X64), y)
|
||||||
ifneq ($(ARM64), y)
|
ifneq ($(ARM64), y)
|
||||||
LIBS += -Wl,--large-address-aware
|
LIBS += -Wl,--large-address-aware
|
||||||
|
@@ -544,6 +544,10 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
int wp = 0;
|
int wp = 0;
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
BROWSEINFO bi;
|
||||||
|
#endif
|
||||||
|
|
||||||
id = LOWORD(wParam) & 0x00ff;
|
id = LOWORD(wParam) & 0x00ff;
|
||||||
|
|
||||||
switch (LOWORD(wParam) & 0xff00) {
|
switch (LOWORD(wParam) & 0xff00) {
|
||||||
@@ -651,10 +655,15 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IDM_CDROM_DIR:
|
case IDM_CDROM_DIR:
|
||||||
|
#ifndef __clang__
|
||||||
BROWSEINFO bi = {
|
BROWSEINFO bi = {
|
||||||
.hwndOwner = hwnd,
|
.hwndOwner = hwnd,
|
||||||
.ulFlags = BIF_EDITBOX
|
.ulFlags = BIF_EDITBOX
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
bi.hwndOwner = hwnd;
|
||||||
|
bi.ulFlags = BIF_EDITBOX;
|
||||||
|
#endif
|
||||||
OleInitialize(NULL);
|
OleInitialize(NULL);
|
||||||
int old_dopause = dopause;
|
int old_dopause = dopause;
|
||||||
plat_pause(1);
|
plat_pause(1);
|
||||||
|
Reference in New Issue
Block a user