mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
0025215: Porting to Android - fix minor issues
STEPConstruct_AP203Context = pw_gecos member of passwd struct disabled in android case. Standard_Atomic - correct usage of __atomic_inc()/__atomic_dec(). Standard_CLocaleSentry - Android doesn't support locales in the C library. Standard_MMgrOpt - use "/dev/zero" and "/dev/null" for allocation of memory blocks on Android. OSD_Chronometer - fix compilation on Android. OSD_Disk, OSD_signal - fix headers inclusion on Android.
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
//=======================================================================
|
||||
void OSD_Chronometer::GetProcessCPU (Standard_Real& UserSeconds, Standard_Real& SystemSeconds)
|
||||
{
|
||||
#if defined(LIN) || defined(linux) || defined(__FreeBSD__)
|
||||
#if defined(LIN) || defined(linux) || defined(__FreeBSD__) || defined(__ANDROID__)
|
||||
static const long aCLK_TCK = sysconf(_SC_CLK_TCK);
|
||||
#else
|
||||
static const long aCLK_TCK = CLK_TCK;
|
||||
@@ -87,7 +87,7 @@ void OSD_Chronometer::GetThreadCPU (Standard_Real& theUserSeconds,
|
||||
theUserSeconds = Standard_Real(aTaskInfo.user_time.seconds) + 0.000001 * aTaskInfo.user_time.microseconds;
|
||||
theSystemSeconds = Standard_Real(aTaskInfo.system_time.seconds) + 0.000001 * aTaskInfo.system_time.microseconds;
|
||||
}
|
||||
#elif defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)
|
||||
#elif (defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)) || defined(__ANDROID__)
|
||||
// on Linux, only user times are available for threads via clock_gettime()
|
||||
struct timespec t;
|
||||
if (!clock_gettime (CLOCK_THREAD_CPUTIME_ID, &t))
|
||||
|
Reference in New Issue
Block a user