mirror of
https://github.com/wownero/p2pool-wow.git
synced 2026-10-17 15:21:36 +02:00
Fixes for different BSD variants
This commit is contained in:
@@ -184,6 +184,7 @@ include(CheckCXXSourceCompiles)
|
|||||||
|
|
||||||
check_cxx_source_compiles("int main(){ return __builtin_clzll(1);}" HAVE_BUILTIN_CLZLL)
|
check_cxx_source_compiles("int main(){ return __builtin_clzll(1);}" HAVE_BUILTIN_CLZLL)
|
||||||
check_cxx_source_compiles("#include <intrin.h>\n#pragma intrinsic(_BitScanReverse64)\nint main(){unsigned long r;_BitScanReverse64(&r,1);return r;}" HAVE_BITSCANREVERSE64)
|
check_cxx_source_compiles("#include <intrin.h>\n#pragma intrinsic(_BitScanReverse64)\nint main(){unsigned long r;_BitScanReverse64(&r,1);return r;}" HAVE_BITSCANREVERSE64)
|
||||||
|
check_cxx_source_compiles("#include <sched.h>\nint main(){sched_param param;return sched_setscheduler(0, SCHED_IDLE, ¶m);}" HAVE_SCHED)
|
||||||
|
|
||||||
if (HAVE_BUILTIN_CLZLL)
|
if (HAVE_BUILTIN_CLZLL)
|
||||||
add_definitions(/DHAVE_BUILTIN_CLZLL)
|
add_definitions(/DHAVE_BUILTIN_CLZLL)
|
||||||
@@ -193,6 +194,10 @@ if (HAVE_BITSCANREVERSE64)
|
|||||||
add_definitions(/DHAVE_BITSCANREVERSE64)
|
add_definitions(/DHAVE_BITSCANREVERSE64)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (HAVE_SCHED)
|
||||||
|
add_definitions(/DHAVE_SCHED)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES})
|
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES})
|
||||||
|
|
||||||
if (STATIC_BINARY OR STATIC_LIBS)
|
if (STATIC_BINARY OR STATIC_LIBS)
|
||||||
|
|||||||
Vendored
+1
-1
Submodule external/src/RandomX updated: 118bb7b1b3...89031917e9
+2
-2
@@ -21,7 +21,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#ifndef _WIN32
|
#if !defined(_WIN32) && defined(HAVE_SCHED)
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ void make_thread_background()
|
|||||||
SetThreadPriorityBoost(GetCurrentThread(), true);
|
SetThreadPriorityBoost(GetCurrentThread(), true);
|
||||||
SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);
|
SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);
|
||||||
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);
|
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);
|
||||||
#elif !defined(__APPLE__) && !defined(__FreeBSD__)
|
#elif defined(HAVE_SCHED)
|
||||||
sched_param param;
|
sched_param param;
|
||||||
param.sched_priority = 0;
|
param.sched_priority = 0;
|
||||||
if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) {
|
if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user