use location exception
This commit is contained in:
@@ -71,6 +71,8 @@ epicsShareFunc void * epicsShareAPI threadPrivateGet (threadPrivateId);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "locationException.h"
|
||||
|
||||
class osiThread {
|
||||
public:
|
||||
osiThread (const char *name, unsigned stackSize,
|
||||
@@ -200,11 +202,7 @@ inline osiThreadPrivate<T>::osiThreadPrivate ()
|
||||
{
|
||||
this->id = threadPrivateCreate ();
|
||||
if (this->id == 0) {
|
||||
# ifdef noExceptionsFromCXX
|
||||
assert (this->id != 0);
|
||||
# else
|
||||
throw unableToCreateThreadPrivate ();
|
||||
# endif
|
||||
throwWithLocation ( unableToCreateThreadPrivate () );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <limits.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "locationException.h"
|
||||
#include "epicsAssert.h"
|
||||
#include "envDefs.h"
|
||||
#include "osiTime.h"
|
||||
@@ -259,11 +260,7 @@ osiTime::osiTime (const tm_nano_sec &tm)
|
||||
|
||||
ansiTimeTicks.ts = mktime (&tmp);
|
||||
if (ansiTimeTicks.ts == mktimeFailure) {
|
||||
# ifdef noExceptionsFromCXX
|
||||
assert (0);
|
||||
# else
|
||||
throw formatProblemWithStructTM ();
|
||||
# endif
|
||||
throwWithLocation ( formatProblemWithStructTM () );
|
||||
}
|
||||
|
||||
*this = osiTime (ansiTimeTicks);
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "epicsTypes.h"
|
||||
#include "tsStamp.h"
|
||||
#include "epicsAssert.h"
|
||||
#include "locationException.h"
|
||||
|
||||
struct timespec; // POSIX real time
|
||||
struct timeval; // BSD
|
||||
@@ -264,11 +265,7 @@ inline osiTime osiTime::getCurrent ()
|
||||
|
||||
status = tsStampGetCurrent (¤t);
|
||||
if (status) {
|
||||
# ifdef noExceptionsFromCXX
|
||||
assert (0);
|
||||
# else
|
||||
throw unableToFetchCurrentTime ();
|
||||
# endif
|
||||
throwWithLocation ( unableToFetchCurrentTime () );
|
||||
}
|
||||
|
||||
return osiTime (current);
|
||||
@@ -281,11 +278,7 @@ inline osiTime osiTime::getEvent (const osiTimeEvent &event)
|
||||
|
||||
status = tsStampGetEvent (¤t, event.eventNumber);
|
||||
if (status) {
|
||||
# ifdef noExceptionsFromCXX
|
||||
assert (0);
|
||||
# else
|
||||
throw unableToFetchCurrentTime ();
|
||||
# endif
|
||||
throwWithLocation ( unableToFetchCurrentTime () );
|
||||
}
|
||||
|
||||
return osiTime (current);
|
||||
|
||||
Reference in New Issue
Block a user