This commit is contained in:
XMRig 2023-02-09 13:55:11 +07:00
parent 75474be060
commit 540b223eab
No known key found for this signature in database
GPG key ID: 446A53638BE94409
4 changed files with 23 additions and 34 deletions

View file

@ -10,7 +10,7 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
endif() endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release") if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(/DNDEBUG) add_definitions(-DNDEBUG)
endif() endif()
include(CheckSymbolExists) include(CheckSymbolExists)
@ -32,7 +32,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
add_definitions(/DHAVE_ROTR) add_definitions(-DHAVE_ROTR)
endif() endif()
if (WIN32) if (WIN32)
@ -49,16 +49,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif() endif()
add_definitions(/D_GNU_SOURCE) add_definitions(-D_GNU_SOURCE -DHAVE_BUILTIN_CLEAR_CACHE)
if (${CMAKE_VERSION} VERSION_LESS "3.1.0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
#set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -gdwarf-2")
add_definitions(/DHAVE_BUILTIN_CLEAR_CACHE)
elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC) elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_C_FLAGS_RELEASE "/MP /MT /O2 /Oi /DNDEBUG /GL") set(CMAKE_C_FLAGS_RELEASE "/MP /MT /O2 /Oi /DNDEBUG /GL")
@ -67,10 +58,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MP /Ob1 /Zi /DRELWITHDEBINFO") set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MP /Ob1 /Zi /DRELWITHDEBINFO")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MP /Ob1 /Zi /DRELWITHDEBINFO") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MP /Ob1 /Zi /DRELWITHDEBINFO")
add_definitions(/D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -DNOMINMAX -DHAVE_ROTR)
add_definitions(/D_CRT_NONSTDC_NO_WARNINGS)
add_definitions(/DNOMINMAX)
add_definitions(/DHAVE_ROTR)
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
@ -92,7 +80,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
check_symbol_exists("_rotr" "x86intrin.h" HAVE_ROTR) check_symbol_exists("_rotr" "x86intrin.h" HAVE_ROTR)
if (HAVE_ROTR) if (HAVE_ROTR)
add_definitions(/DHAVE_ROTR) add_definitions(-DHAVE_ROTR)
endif() endif()
endif() endif()
@ -105,6 +93,6 @@ endif()
if (NOT WIN32) if (NOT WIN32)
check_symbol_exists("__builtin___clear_cache" "stdlib.h" HAVE_BUILTIN_CLEAR_CACHE) check_symbol_exists("__builtin___clear_cache" "stdlib.h" HAVE_BUILTIN_CLEAR_CACHE)
if (HAVE_BUILTIN_CLEAR_CACHE) if (HAVE_BUILTIN_CLEAR_CACHE)
add_definitions(/DHAVE_BUILTIN_CLEAR_CACHE) add_definitions(-DHAVE_BUILTIN_CLEAR_CACHE)
endif() endif()
endif() endif()

View file

@ -1,6 +1,6 @@
/* XMRig /* XMRig
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> * Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -46,11 +46,11 @@ xmrig::String xmrig::DnsRecord::ip() const
if (m_type == AAAA) { if (m_type == AAAA) {
buf = new char[45](); buf = new char[45]();
uv_ip6_name(reinterpret_cast<sockaddr_in6*>(m_data), buf, 45); uv_ip6_name(reinterpret_cast<const sockaddr_in6*>(m_data), buf, 45);
} }
else { else {
buf = new char[16](); buf = new char[16]();
uv_ip4_name(reinterpret_cast<sockaddr_in*>(m_data), buf, 16); uv_ip4_name(reinterpret_cast<const sockaddr_in*>(m_data), buf, 16);
} }
return buf; return buf;

View file

@ -1,7 +1,7 @@
/* XMRig /* XMRig
* Copyright (c) 2018 Lee Clagett <https://github.com/vtnerd> * Copyright (c) 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> * Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -24,9 +24,6 @@
#include "base/tools/Object.h" #include "base/tools/Object.h"
#include <cstdint>
using SSL_CTX = struct ssl_ctx_st; using SSL_CTX = struct ssl_ctx_st;
@ -60,6 +57,7 @@ private:
}; };
} /* namespace xmrig */ } // namespace xmrig
#endif /* XMRIG_TLSCONTEXT_H */
#endif // XMRIG_TLSCONTEXT_H

View file

@ -1,6 +1,6 @@
/* XMRig /* XMRig
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> * Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,7 +20,9 @@
#define XMRIG_OBJECT_H #define XMRIG_OBJECT_H
#include <chrono> #include <cstddef>
#include <cstdint>
#include <memory>
namespace xmrig { namespace xmrig {
@ -41,6 +43,7 @@ namespace xmrig {
X &operator=(X &&other) = delete; X &operator=(X &&other) = delete;
} /* namespace xmrig */ } // namespace xmrig
#endif /* XMRIG_OBJECT_H */
#endif // XMRIG_OBJECT_H