diff --git a/libs/main/io_devices/pidir.cpp b/libs/main/io_devices/pidir.cpp index d554dddf..96814a63 100644 --- a/libs/main/io_devices/pidir.cpp +++ b/libs/main/io_devices/pidir.cpp @@ -23,7 +23,7 @@ const PIChar PIDir::separator = '/'; -# ifdef QNX +# if defined(QNX) || !(defined(MAC_OS) || defined(__GLIBC__) || defined(_WIN32)) # define _stat_struct_ struct stat # define _stat_call_ stat # define _stat_link_ lstat diff --git a/libs/main/io_devices/pifile.cpp b/libs/main/io_devices/pifile.cpp index 43739826..cebd11c1 100644 --- a/libs/main/io_devices/pifile.cpp +++ b/libs/main/io_devices/pifile.cpp @@ -59,7 +59,7 @@ # define _fseek_call_ fseek # define _ftell_call_ ftell # else -# ifdef CC_GCC +# if defined(CC_GCC) && (defined(__GLIBC__) || defined(_WIN32)) # define _fopen_call_ fopen64 # define _fseek_call_ fseeko64 # define _ftell_call_ ftello64 @@ -69,9 +69,15 @@ # define _ftell_call_ ftell # endif # endif -# define _stat_struct_ struct stat64 -# define _stat_call_ stat64 -# define _stat_link_ lstat64 +# if defined(MAC_OS) || defined(__GLIBC__) || defined(_WIN32) +# define _stat_struct_ struct stat64 +# define _stat_call_ stat64 +# define _stat_link_ lstat64 +# else +# define _stat_struct_ struct stat +# define _stat_call_ stat +# define _stat_link_ lstat +# endif # endif diff --git a/libs/main/math/pimathbase.h b/libs/main/math/pimathbase.h index 9aeb126e..b1ffd6e5 100644 --- a/libs/main/math/pimathbase.h +++ b/libs/main/math/pimathbase.h @@ -160,9 +160,11 @@ inline int pow2 (const int p ) {return 1 << p;} //! \~russian Возвращает `10` в указанной степени. inline float pow10(const float & e) {return powf(10.f, e);} +#if !defined(__linux__) || defined(__GLIBC__) || defined(__BIONIC__) //! \~english Returns `10` raised to the specified power. //! \~russian Возвращает `10` в указанной степени. inline double pow10(const double & e) {return pow (10. , e);} +#endif //! \~english Returns `10` raised to the specified power. //! \~russian Возвращает `10` в указанной степени. diff --git a/libs/main/thread/pithread.cpp b/libs/main/thread/pithread.cpp index b167d834..57b8a3c6 100644 --- a/libs/main/thread/pithread.cpp +++ b/libs/main/thread/pithread.cpp @@ -785,10 +785,10 @@ void PIThread::setPriority(PIThread::Priority prior) { piZeroMemory(PRIVATE->sparam); pthread_getschedparam(PRIVATE->thread, &policy_, &(PRIVATE->sparam)); PRIVATE->sparam. -# ifndef LINUX - sched_priority -# else +# if defined(LINUX) && defined(__GLIBC__) __sched_priority +# else + sched_priority # endif = priority2System(priority_); pthread_setschedparam(PRIVATE->thread, policy_, &(PRIVATE->sparam)); @@ -1054,7 +1054,7 @@ void PIThread::setThreadName() { pthread_setname_np((const char *)name_ba.data()); pthread_threadid_np(PRIVATE->thread, (__uint64_t *)&tid_); # else - pthread_setname_np(PRIVATE->thread, (const char *)name_ba.data()); + pthread_setname_np(pthread_self(), (const char *)name_ba.data()); # endif # endif }