The problem with keeping the epicsTimeERROR definition is that any code that equality compares it with a returned status value will stop working. Several such uses were fixed in this branch, for example this code would still compile with the requested change but needs to be modified to work properly:
if (epicsTimeFromTimespec(&timeNow, ×pecNow) == epicsTimeERROR) { ... }
since epicsTimeFromTimespec() now returns S_time_conversion on error.
It could be rewritten as either
if (epicsTimeFromTimespec(&timeNow, ×pecNow) != epicsTimeOK) { ... }
or
if (epicsTimeFromTimespec(&timeNow, ×pecNow)) { ... }
both of which are backwards compatible.
Time providers that have to return a status and need to be backwards compatible could do this:
#include "epicsTime.h"
#ifndef M_time
/* S_time_... status values were not provided before Base 3.16 */
#define S_time_unsynchronized epicsTimeERROR
#define S_time_...whatever... epicsTimeERROR
#endif
I added the above suggestion for time provider code to the release notes.
The problem with keeping the epicsTimeERROR definition is that any code that equality compares it with a returned status value will stop working. Several such uses were fixed in this branch, for example this code would still compile with the requested change but needs to be modified to work properly: imespec( &timeNow, ×pecNow) == epicsTimeERROR) { ... } mespec( ) now returns S_time_conversion on error.
if (epicsTimeFromT
since epicsTimeFromTi
It could be rewritten as either imespec( &timeNow, ×pecNow) != epicsTimeOK) { ... } imespec( &timeNow, ×pecNow)) { ... }
if (epicsTimeFromT
or
if (epicsTimeFromT
both of which are backwards compatible.
Time providers that have to return a status and need to be backwards compatible could do this:
#include "epicsTime.h" unsynchronized epicsTimeERROR ...whatever. .. epicsTimeERROR
#ifndef M_time
/* S_time_... status values were not provided before Base 3.16 */
#define S_time_
#define S_time_
#endif
I added the above suggestion for time provider code to the release notes.