diff options
| author | 2016-04-24 02:02:45 -0400 | |
|---|---|---|
| committer | 2016-04-24 02:02:45 -0400 | |
| commit | 0964a3ff530f2eb5b7ecdf9dfbb74deea890352d (patch) | |
| tree | c566efaf69f8d3564d1e678a0a31981a52794a8a | |
| parent | Merge pull request #1705 from LittleWhite-tb/compat_gcc49 (diff) | |
| parent | assert: Add _MSG variations for UNREACHABLE and UNIMPLEMENTED (diff) | |
| download | yuzu-0964a3ff530f2eb5b7ecdf9dfbb74deea890352d.tar.gz yuzu-0964a3ff530f2eb5b7ecdf9dfbb74deea890352d.tar.xz yuzu-0964a3ff530f2eb5b7ecdf9dfbb74deea890352d.zip | |
Merge pull request #1576 from smspillaz/fix-build-errors-03272016
Fix various build errors encountered on Clang 3.9 on OS X
| -rw-r--r-- | CMakeLists.txt | 6 | ||||
| -rw-r--r-- | externals/microprofile/microprofileui.h | 7 | ||||
| -rw-r--r-- | src/citra/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 6 | ||||
| -rw-r--r-- | src/common/assert.h | 2 | ||||
| -rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/fs/fs_user.cpp | 2 | ||||
| -rw-r--r-- | src/core/loader/ncch.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/pica.h | 7 |
9 files changed, 29 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a0a161e7..ddde19760 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -65,8 +65,8 @@ endif() | |||
| 65 | message(STATUS "Target architecture: ${ARCHITECTURE}") | 65 | message(STATUS "Target architecture: ${ARCHITECTURE}") |
| 66 | 66 | ||
| 67 | if (NOT MSVC) | 67 | if (NOT MSVC) |
| 68 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -Wno-attributes -pthread") | 68 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -Wno-attributes") |
| 69 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") | 69 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") |
| 70 | 70 | ||
| 71 | if (ARCHITECTURE_x86_64) | 71 | if (ARCHITECTURE_x86_64) |
| 72 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") | 72 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") |
| @@ -135,6 +135,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules") | |||
| 135 | find_package(OpenGL REQUIRED) | 135 | find_package(OpenGL REQUIRED) |
| 136 | include_directories(${OPENGL_INCLUDE_DIR}) | 136 | include_directories(${OPENGL_INCLUDE_DIR}) |
| 137 | 137 | ||
| 138 | find_package(Threads REQUIRED) | ||
| 139 | |||
| 138 | if (ENABLE_SDL2) | 140 | if (ENABLE_SDL2) |
| 139 | if (CITRA_USE_BUNDLED_SDL2) | 141 | if (CITRA_USE_BUNDLED_SDL2) |
| 140 | # Detect toolchain and platform | 142 | # Detect toolchain and platform |
diff --git a/externals/microprofile/microprofileui.h b/externals/microprofile/microprofileui.h index eac1119a4..45bec8af6 100644 --- a/externals/microprofile/microprofileui.h +++ b/externals/microprofile/microprofileui.h | |||
| @@ -879,7 +879,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, | |||
| 879 | static int64_t nRefCpu = 0, nRefGpu = 0; | 879 | static int64_t nRefCpu = 0, nRefGpu = 0; |
| 880 | if(MicroProfileGetGpuTickReference(&nTickReferenceCpu, &nTickReferenceGpu)) | 880 | if(MicroProfileGetGpuTickReference(&nTickReferenceCpu, &nTickReferenceGpu)) |
| 881 | { | 881 | { |
| 882 | if(0 == nRefCpu || abs(nRefCpu-nBaseTicksCpu) > abs(nTickReferenceCpu-nBaseTicksCpu)) | 882 | if(0 == nRefCpu || std::abs(nRefCpu-nBaseTicksCpu) > std::abs(nTickReferenceCpu-nBaseTicksCpu)) |
| 883 | { | 883 | { |
| 884 | nRefCpu = nTickReferenceCpu; | 884 | nRefCpu = nTickReferenceCpu; |
| 885 | nRefGpu = nTickReferenceGpu; | 885 | nRefGpu = nTickReferenceGpu; |
| @@ -1230,7 +1230,12 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, | |||
| 1230 | char ThreadName[MicroProfileThreadLog::THREAD_MAX_LEN + 16]; | 1230 | char ThreadName[MicroProfileThreadLog::THREAD_MAX_LEN + 16]; |
| 1231 | const char* cLocal = MicroProfileIsLocalThread(nThreadId) ? "*": " "; | 1231 | const char* cLocal = MicroProfileIsLocalThread(nThreadId) ? "*": " "; |
| 1232 | 1232 | ||
| 1233 | #if defined(WIN32) | ||
| 1234 | // nThreadId is 32-bit on Windows | ||
| 1233 | int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04x: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); | 1235 | int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04x: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); |
| 1236 | #else | ||
| 1237 | int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04llx: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); | ||
| 1238 | #endif | ||
| 1234 | uint32_t nThreadColor = -1; | 1239 | uint32_t nThreadColor = -1; |
| 1235 | if(nThreadId == nContextSwitchHoverThreadAfter || nThreadId == nContextSwitchHoverThreadBefore) | 1240 | if(nThreadId == nContextSwitchHoverThreadAfter || nThreadId == nContextSwitchHoverThreadBefore) |
| 1236 | nThreadColor = UI.nHoverColorShared|0x906060; | 1241 | nThreadColor = UI.nHoverColorShared|0x906060; |
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index fa615deb9..351752c1c 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt | |||
| @@ -21,7 +21,7 @@ target_link_libraries(citra ${SDL2_LIBRARY} ${OPENGL_gl_LIBRARY} inih glad) | |||
| 21 | if (MSVC) | 21 | if (MSVC) |
| 22 | target_link_libraries(citra getopt) | 22 | target_link_libraries(citra getopt) |
| 23 | endif() | 23 | endif() |
| 24 | target_link_libraries(citra ${PLATFORM_LIBRARIES}) | 24 | target_link_libraries(citra ${PLATFORM_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) |
| 25 | 25 | ||
| 26 | if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") | 26 | if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") |
| 27 | install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") | 27 | install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") |
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index c30e75933..68cff78b2 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp | |||
| @@ -346,5 +346,11 @@ u32 GraphicsFramebufferWidget::BytesPerPixel(GraphicsFramebufferWidget::Format f | |||
| 346 | case Format::RGBA4: | 346 | case Format::RGBA4: |
| 347 | case Format::D16: | 347 | case Format::D16: |
| 348 | return 2; | 348 | return 2; |
| 349 | default: | ||
| 350 | UNREACHABLE_MSG("GraphicsFramebufferWidget::BytesPerPixel: this " | ||
| 351 | "should not be reached as this function should " | ||
| 352 | "be given a format which is in " | ||
| 353 | "GraphicsFramebufferWidget::Format. Instead got %i", | ||
| 354 | static_cast<int>(format)); | ||
| 349 | } | 355 | } |
| 350 | } | 356 | } |
diff --git a/src/common/assert.h b/src/common/assert.h index 6849778b7..d7f19f5eb 100644 --- a/src/common/assert.h +++ b/src/common/assert.h | |||
| @@ -39,6 +39,7 @@ static void assert_noinline_call(const Fn& fn) { | |||
| 39 | }); } while (0) | 39 | }); } while (0) |
| 40 | 40 | ||
| 41 | #define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!") | 41 | #define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!") |
| 42 | #define UNREACHABLE_MSG(_a_, ...) ASSERT_MSG(false, _a_, __VA_ARGS__) | ||
| 42 | 43 | ||
| 43 | #ifdef _DEBUG | 44 | #ifdef _DEBUG |
| 44 | #define DEBUG_ASSERT(_a_) ASSERT(_a_) | 45 | #define DEBUG_ASSERT(_a_) ASSERT(_a_) |
| @@ -49,3 +50,4 @@ static void assert_noinline_call(const Fn& fn) { | |||
| 49 | #endif | 50 | #endif |
| 50 | 51 | ||
| 51 | #define UNIMPLEMENTED() DEBUG_ASSERT_MSG(false, "Unimplemented code!") | 52 | #define UNIMPLEMENTED() DEBUG_ASSERT_MSG(false, "Unimplemented code!") |
| 53 | #define UNIMPLEMENTED_MSG(_a_, ...) ASSERT_MSG(false, _a_, __VA_ARGS__) \ No newline at end of file | ||
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index c1a7ec5bf..ae0c116ef 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp | |||
| @@ -529,7 +529,7 @@ static void ReadRegister() { | |||
| 529 | id |= HexCharToValue(command_buffer[2]); | 529 | id |= HexCharToValue(command_buffer[2]); |
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | if (id >= R0_REGISTER && id <= R15_REGISTER) { | 532 | if (id <= R15_REGISTER) { |
| 533 | IntToGdbHex(reply, Core::g_app_core->GetReg(id)); | 533 | IntToGdbHex(reply, Core::g_app_core->GetReg(id)); |
| 534 | } else if (id == CPSR_REGISTER) { | 534 | } else if (id == CPSR_REGISTER) { |
| 535 | IntToGdbHex(reply, Core::g_app_core->GetCPSR()); | 535 | IntToGdbHex(reply, Core::g_app_core->GetCPSR()); |
| @@ -584,7 +584,7 @@ static void WriteRegister() { | |||
| 584 | id |= HexCharToValue(command_buffer[2]); | 584 | id |= HexCharToValue(command_buffer[2]); |
| 585 | } | 585 | } |
| 586 | 586 | ||
| 587 | if (id >= R0_REGISTER && id <= R15_REGISTER) { | 587 | if (id <= R15_REGISTER) { |
| 588 | Core::g_app_core->SetReg(id, GdbHexToInt(buffer_ptr)); | 588 | Core::g_app_core->SetReg(id, GdbHexToInt(buffer_ptr)); |
| 589 | } else if (id == CPSR_REGISTER) { | 589 | } else if (id == CPSR_REGISTER) { |
| 590 | Core::g_app_core->SetCPSR(GdbHexToInt(buffer_ptr)); | 590 | Core::g_app_core->SetCPSR(GdbHexToInt(buffer_ptr)); |
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 3ec7ceb30..7df7da5a4 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp | |||
| @@ -250,7 +250,7 @@ static void CreateFile(Service::Interface* self) { | |||
| 250 | 250 | ||
| 251 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); | 251 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); |
| 252 | 252 | ||
| 253 | LOG_DEBUG(Service_FS, "type=%d size=%llu data=%s", filename_type, filename_size, file_path.DebugStr().c_str()); | 253 | LOG_DEBUG(Service_FS, "type=%d size=%llu data=%s", filename_type, file_size, file_path.DebugStr().c_str()); |
| 254 | 254 | ||
| 255 | cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; | 255 | cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; |
| 256 | } | 256 | } |
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index a4b47ef8c..066e91a9e 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp | |||
| @@ -255,7 +255,7 @@ ResultStatus AppLoader_NCCH::Load() { | |||
| 255 | resource_limit_category = exheader_header.arm11_system_local_caps.resource_limit_category; | 255 | resource_limit_category = exheader_header.arm11_system_local_caps.resource_limit_category; |
| 256 | 256 | ||
| 257 | LOG_INFO(Loader, "Name: %s" , exheader_header.codeset_info.name); | 257 | LOG_INFO(Loader, "Name: %s" , exheader_header.codeset_info.name); |
| 258 | LOG_INFO(Loader, "Program ID: %016X" , ncch_header.program_id); | 258 | LOG_INFO(Loader, "Program ID: %016llX" , ncch_header.program_id); |
| 259 | LOG_DEBUG(Loader, "Code compressed: %s" , is_compressed ? "yes" : "no"); | 259 | LOG_DEBUG(Loader, "Code compressed: %s" , is_compressed ? "yes" : "no"); |
| 260 | LOG_DEBUG(Loader, "Entry point: 0x%08X", entry_point); | 260 | LOG_DEBUG(Loader, "Entry point: 0x%08X", entry_point); |
| 261 | LOG_DEBUG(Loader, "Code size: 0x%08X", code_size); | 261 | LOG_DEBUG(Loader, "Code size: 0x%08X", code_size); |
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 1810eca98..cf130d7f8 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -747,8 +747,13 @@ struct Regs { | |||
| 747 | case LightingSampler::ReflectGreen: | 747 | case LightingSampler::ReflectGreen: |
| 748 | case LightingSampler::ReflectBlue: | 748 | case LightingSampler::ReflectBlue: |
| 749 | return (config == LightingConfig::Config4) || (config == LightingConfig::Config5) || (config == LightingConfig::Config7); | 749 | return (config == LightingConfig::Config4) || (config == LightingConfig::Config5) || (config == LightingConfig::Config7); |
| 750 | default: | ||
| 751 | UNREACHABLE_MSG("Regs::IsLightingSamplerSupported: Reached " | ||
| 752 | "unreachable section, sampler should be one " | ||
| 753 | "of Distribution0, Distribution1, Fresnel, " | ||
| 754 | "ReflectRed, ReflectGreen or ReflectBlue, instead " | ||
| 755 | "got %i", static_cast<int>(config)); | ||
| 750 | } | 756 | } |
| 751 | return false; | ||
| 752 | } | 757 | } |
| 753 | 758 | ||
| 754 | struct { | 759 | struct { |