mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-12-22 19:39:22 +00:00
Fixes for different BSD variants
This commit is contained in:
parent
da12b329be
commit
07a5b191bb
3 changed files with 8 additions and 3 deletions
|
@ -184,6 +184,7 @@ include(CheckCXXSourceCompiles)
|
|||
|
||||
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 <sched.h>\nint main(){sched_param param;return sched_setscheduler(0, SCHED_IDLE, ¶m);}" HAVE_SCHED)
|
||||
|
||||
if (HAVE_BUILTIN_CLZLL)
|
||||
add_definitions(/DHAVE_BUILTIN_CLZLL)
|
||||
|
@ -193,6 +194,10 @@ if (HAVE_BITSCANREVERSE64)
|
|||
add_definitions(/DHAVE_BITSCANREVERSE64)
|
||||
endif()
|
||||
|
||||
if (HAVE_SCHED)
|
||||
add_definitions(/DHAVE_SCHED)
|
||||
endif()
|
||||
|
||||
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES})
|
||||
|
||||
if (STATIC_BINARY OR STATIC_LIBS)
|
||||
|
|
2
external/src/RandomX
vendored
2
external/src/RandomX
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 118bb7b1b3efe5b1e3f811b0b122abdbb952fb87
|
||||
Subproject commit 89031917e9780b3ea0439bf362446efe5b59244c
|
|
@ -21,7 +21,7 @@
|
|||
#include <map>
|
||||
#include <thread>
|
||||
|
||||
#ifndef _WIN32
|
||||
#if !defined(_WIN32) && defined(HAVE_SCHED)
|
||||
#include <sched.h>
|
||||
#endif
|
||||
|
||||
|
@ -66,7 +66,7 @@ void make_thread_background()
|
|||
SetThreadPriorityBoost(GetCurrentThread(), true);
|
||||
SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);
|
||||
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);
|
||||
#elif !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||
#elif defined(HAVE_SCHED)
|
||||
sched_param param;
|
||||
param.sched_priority = 0;
|
||||
if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) {
|
||||
|
|
Loading…
Reference in a new issue