Skip to content

Commit

Permalink
Initial support for compiling with Intel C++ Compiler (icc/icpc).
Browse files Browse the repository at this point in the history
  • Loading branch information
mtl1979 committed Feb 15, 2024
1 parent 737a04d commit 433c1ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ else()
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=unused-function -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wno-error=unused-result")
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(WARNINGS "${WARNINGS} -Wno-error=mismatched-tags -Wno-error=null-conversion -Wno-overloaded-shift-op-parentheses -Wno-error=shift-count-overflow -Wno-error=tautological-constant-out-of-range-compare -Wno-error=unused-private-field -Wno-error=unneeded-internal-declaration -Wno-error=unused-function -Wno-error=missing-braces")
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
set(WARNINGS "${WARNINGS} -Wno-error=maybe-uninitialized -Wno-error=clobbered -Wno-error=unused-but-set-variable -diag-disable=10441 -diag-disable 11074 -diag-disable 11076")
else()
set(WARNINGS "${WARNINGS} -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=clobbered -Wno-error=unused-but-set-variable")
endif()
Expand All @@ -137,7 +139,11 @@ else()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)
set(CXX_WARNINGS "${CXX_WARNINGS} -Wno-redundant-move")
endif()
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes")
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
set(C_WARNINGS "-Wold-style-definition -Wstrict-prototypes")
else()
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes")
endif()
set(CXX_WARNINGS "${CXX_WARNINGS} -Wno-reorder -Wno-missing-field-initializers")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${MINGW_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG}")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
Expand Down Expand Up @@ -199,6 +205,10 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT ANDROID)
set(CMAKE_EXE_LINKER_FLAGS "-pthread")
endif()

if(CMAKE_C_COMPILER_ID MATCHES "Intel")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -diag-disable=10441")
endif()

set(OLD_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(STATIC)
if(STATIC AND MINGW)
Expand Down
7 changes: 6 additions & 1 deletion src/CryptoNoteCore/AddBlockErrorCondition.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers
// Copyright (c) 2024, The Talleo developers
//
// This file is part of Bytecoin.
//
Expand Down Expand Up @@ -59,7 +60,11 @@ class AddBlockErrorConditionCategory: public std::error_category {
}
}

virtual bool equivalent(const std::error_code& errorCode, int condition) const throw() override {
virtual bool equivalent(int code, const std::error_condition& condition) const noexcept override {
return default_error_condition(code) == condition;
}

virtual bool equivalent(const std::error_code& errorCode, int condition) const throw() override {
AddBlockErrorCondition code = static_cast<AddBlockErrorCondition>(condition);

switch(code) {
Expand Down

0 comments on commit 433c1ba

Please sign in to comment.