From 93889b2b1872853c06e6e79cf90ee20f83ff6576 Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Fri, 10 Dec 2021 16:18:39 +0100 Subject: [PATCH] [v0.11] Small adjustments to fix compilation on older compilers --- CMakeLists.txt | 2 +- src/common/gpu.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ceca41..a97d1b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ endif() add_executable(gpufetch ${COMMON_DIR}/main.cpp ${COMMON_DIR}/args.cpp ${COMMON_DIR}/gpu.cpp ${COMMON_DIR}/pci.cpp ${COMMON_DIR}/global.cpp ${COMMON_DIR}/printer.cpp ${COMMON_DIR}/master.cpp ${COMMON_DIR}/uarch.cpp) set(SANITY_FLAGS "-Wfloat-equal -Wshadow -Wpointer-arith") -set(CMAKE_CXX_FLAGS "${SANITY_FLAGS} -Wall -Wextra -pedantic -fstack-protector-all -pedantic") +set(CMAKE_CXX_FLAGS "${SANITY_FLAGS} -Wall -Wextra -pedantic -fstack-protector-all -pedantic -std=c++11") if(ENABLE_INTEL_BACKEND) target_compile_definitions(gpufetch PUBLIC BACKEND_INTEL) diff --git a/src/common/gpu.cpp b/src/common/gpu.cpp index 3d2feee..512ad85 100644 --- a/src/common/gpu.cpp +++ b/src/common/gpu.cpp @@ -32,8 +32,6 @@ VENDOR get_gpu_vendor(struct gpu_info* gpu) { return gpu->vendor; } -double trunc(double val) { return ((int)(100 * val)) / 100.0; } - int32_t get_value_as_smallest_unit(char ** str, uint64_t value) { int32_t ret; int max_len = 10; // Max is 8 for digits, 2 for units