OSD_Thread - use pthread_timedjoin_np() instead of pthread_join() when available (glibc extension).
Suppress unused parameter warning in OSD_Signal, NCollection_WinHeapAllocator, OpenGl_Text, OpenGl_View, V3d_View and ViewerTest.
ULONG aHeapInfo = 2;
HeapSetInformation (myHeapH, HeapCompatibilityInformation,
&aHeapInfo, sizeof(aHeapInfo));
+#else
+ (void )theInitSizeBytes;
#endif
}
// OSD_Thread::Wait
//=============================================
-Standard_Boolean OSD_Thread::Wait (const Standard_Integer time, Standard_Address &result) const
+Standard_Boolean OSD_Thread::Wait (const Standard_Integer theTimeMs, Standard_Address &result) const
{
// check that thread handle is not null
result = 0;
#ifdef _WIN32
// On Windows, wait for the thread handle to be signaled
- DWORD ret = WaitForSingleObject ( myThread, time );
+ DWORD ret = WaitForSingleObject (myThread, theTimeMs);
if (ret == WAIT_OBJECT_0)
{
DWORD anExitCode;
return Standard_False;
#else
+ #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2,4)
+ #define HAS_TIMED_NP
+ #endif
+ #endif
+
+ #ifdef HAS_TIMED_NP
+ struct timespec aTimeout;
+ if (clock_gettime (CLOCK_REALTIME, &aTimeout) == -1)
+ {
+ return Standard_False;
+ }
+
+ time_t aSeconds = (theTimeMs / 1000);
+ long aMicroseconds = (theTimeMs - aSeconds * 1000) * 1000;
+ aTimeout.tv_sec += aSeconds;
+ aTimeout.tv_nsec += aMicroseconds * 1000;
+
+ return pthread_timedjoin_np (myThread, &result, &aTimeout) == 0;
+ #else
+ // join the thread without timeout
+ (void )theTimeMs;
+ return pthread_join (myThread, &result) == 0;
+ #endif
- // On Unix/Linux, join the thread
- return ! pthread_join ( myThread, &result );
-
-#endif
+#endif
}
//=============================================
//==== SIGSEGV is handled by "SegvHandler()"
//============================================================================
#ifdef SA_SIGINFO
+ #if defined(HAVE_PTHREAD_H) && defined(NO_CXX_EXCEPTION)
static void Handler (const int theSignal, siginfo_t *theSigInfo, const Standard_Address theContext)
+ #else
+static void Handler (const int theSignal, siginfo_t */*theSigInfo*/, const Standard_Address /*theContext*/)
+ #endif
#else
static void Handler (const int theSignal)
#endif
Handler(theSignal, ip, theContext);
return;
}
+#else
+ (void )theContext;
#endif
#ifdef linux
if (fFltExceptions)
// as it is better for keeping text/3d graphics proportions
Graphic3d_TransformUtils::Scale<GLdouble> (aModViewMat, aTextScaley, aTextScaley, aTextScaley);
}
+ #else
+ (void )thePrintCtx;
#endif
Graphic3d_TransformUtils::Scale<GLdouble> (aModViewMat, myScaleHeight, myScaleHeight, myScaleHeight);
}
return (Standard_Boolean) isDone;
#else // not _WIN32
+ (void )thePrinterDC;
+ (void )theToShowBackground;
+ (void )theFileName;
+ (void )thePrintAlgorithm;
+ (void )theScaleFactor;
Standard_NotImplemented::Raise ("OpenGl_View::Print is implemented only on Windows");
myWorkspace->PrinterContext().Nullify();
return Standard_False;
#endif
//=============================================================================
-//function : SetGrid
+//function : Print
//purpose :
//=============================================================================
Standard_Boolean V3d_View::Print (const Aspect_Handle thePrintDC,
return myView->Print (device._pd.hDC, theShowBackground, theFilename, thePrintAlgorithm, aScaleFactor);
}
#else
+ (void )thePrintDC;
+ (void )theShowDialog;
+ (void )theShowBackground;
+ (void )theFilename;
+ (void )thePrintAlgorithm;
Standard_NotImplemented::Raise ("V3d_View::Print is implemented only on Windows");
#endif
return Standard_False;
const char** argv)
{
#ifndef _WIN32
+ (void )argc;
+ (void )argv;
di << "Printing implemented only for WNT!\n";
return 0;
#else