diff --git a/CMakeLists.txt b/CMakeLists.txt index 575ae72703..efde6eaeb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,12 +33,20 @@ endif() include(FindPkgConfig REQUIRED) # Various compile flags -add_definitions(-msse2 -Wall -Wno-unused-result) +add_definitions(-msse2 -Wall) # gcc uses some optimizations which might break stuff without this flag add_definitions(-fno-strict-aliasing -fno-exceptions) include(CheckCXXCompilerFlag) + +# We call fread numerous times without checking return values. Hide the +# corresponding compiler warnings if the compiler supports doing so. +CHECK_CXX_COMPILER_FLAG(-Wno-unused-result NO_UNUSED_RESULT) +if(NO_UNUSED_RESULT) + add_definitions(-Wno-unused-result) +endif(NO_UNUSED_RESULT) + CHECK_CXX_COMPILER_FLAG(-fvisibility-inlines-hidden VISIBILITY_INLINES_HIDDEN) if(VISIBILITY_INLINES_HIDDEN) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden) @@ -275,10 +283,10 @@ if(WIN32) include_directories(Externals/GLew/include) else() include(CheckLib) - check_lib(GLEW glew TRUE) - check_lib(GLU glu TRUE) - check_lib(CG Cg TRUE) - check_lib(CGGL CgGL TRUE) + check_lib(GLEW glew REQUIRED) + check_lib(GLU glu REQUIRED) + check_lib(CG Cg REQUIRED) + check_lib(CGGL CgGL REQUIRED) endif() if(NOT APPLE) @@ -296,7 +304,7 @@ if(NOT DISABLE_WX) include(${wxWidgets_USE_FILE}) if(UNIX) - check_lib(GTK2 gtk+-2.0 TRUE) + check_lib(GTK2 gtk+-2.0 REQUIRED) if(GTK2_FOUND) include_directories(${GTK2_INCLUDE_DIRS}) endif(GTK2_FOUND) diff --git a/CMakeTests/CheckLib.cmake b/CMakeTests/CheckLib.cmake index f599f94ccd..5287113993 100644 --- a/CMakeTests/CheckLib.cmake +++ b/CMakeTests/CheckLib.cmake @@ -8,7 +8,7 @@ macro(check_lib var lib required) message("${lib} found") set(${var}_FOUND 1 CACHE INTERNAL "") else() - if(${required}) + if(${required} STREQUAL "REQUIRED") message(FATAL_ERROR "${lib} is required but not found") else() message("${lib} not found") diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index d4eda63a06..fb144d17fc 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -658,7 +658,7 @@ void CFrame::OnHostMessage(wxCommandEvent& event) #ifdef __WXGTK__ case IDM_PANIC: bPanicResult = (wxYES == wxMessageBox(event.GetString(), - wxT("Warning"), event.GetInt() ? wxYES_NO : wxOK), this); + wxT("Warning"), event.GetInt() ? wxYES_NO : wxOK, this)); panic_event.Set(); break; #endif diff --git a/Source/Core/wiiuse/Src/io_nix.cpp b/Source/Core/wiiuse/Src/io_nix.cpp index f508991848..7784767aea 100644 --- a/Source/Core/wiiuse/Src/io_nix.cpp +++ b/Source/Core/wiiuse/Src/io_nix.cpp @@ -183,7 +183,8 @@ static int wiiuse_connect_single(struct wiimote_t* wm, char* address) str2ba(address, &addr.l2_bdaddr); else { - if (bacmp(bdaddr, BDADDR_ANY) == 0) + bdaddr_t bdaddr_any = (bdaddr_t){{0, 0, 0, 0, 0, 0}}; + if (bacmp(bdaddr, &bdaddr_any) == 0) return 0; // use address of device discovered addr.l2_bdaddr = *bdaddr; diff --git a/Source/Core/wiiuse/Src/wiiuse.cpp b/Source/Core/wiiuse/Src/wiiuse.cpp index c990714255..937ecf2123 100644 --- a/Source/Core/wiiuse/Src/wiiuse.cpp +++ b/Source/Core/wiiuse/Src/wiiuse.cpp @@ -123,7 +123,7 @@ struct wiimote_t** wiiuse_init(int wiimotes) { wm[i]->unid = i+1; #if defined __linux__ && HAVE_BLUEZ - wm[i]->bdaddr = *BDADDR_ANY; + wm[i]->bdaddr = (bdaddr_t){{0, 0, 0, 0, 0, 0}}; wm[i]->out_sock = -1; wm[i]->in_sock = -1; #elif defined(_WIN32)