diff --git a/src/libCom/osi/osiThread.h b/src/libCom/osi/osiThread.h index 90eab41a4..808661cf2 100644 --- a/src/libCom/osi/osiThread.h +++ b/src/libCom/osi/osiThread.h @@ -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::osiThreadPrivate () { this->id = threadPrivateCreate (); if (this->id == 0) { -# ifdef noExceptionsFromCXX - assert (this->id != 0); -# else - throw unableToCreateThreadPrivate (); -# endif + throwWithLocation ( unableToCreateThreadPrivate () ); } } diff --git a/src/libCom/osi/osiTime.cpp b/src/libCom/osi/osiTime.cpp index f22a9e61f..734599b7c 100644 --- a/src/libCom/osi/osiTime.cpp +++ b/src/libCom/osi/osiTime.cpp @@ -35,6 +35,7 @@ #include #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); diff --git a/src/libCom/osi/osiTime.h b/src/libCom/osi/osiTime.h index f33b419ea..ed434e52a 100644 --- a/src/libCom/osi/osiTime.h +++ b/src/libCom/osi/osiTime.h @@ -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);