5151#include <asTrapWrite.h>
5252#include <epicsVersion.h>
5353
54- #define BASE_3_14 (EPICS_VERSION * 100 + EPICS_REVISION < 315)
55-
56- #if !(BASE_3_14 )
54+ #if EPICS_VERSION_INT >= VERSION_INT (3 ,15 ,0 ,0 )
5755#include "dbChannel.h"
5856#endif
5957
@@ -114,7 +112,7 @@ void caPutLogAsStop()
114112
115113static void caPutLogAs (asTrapWriteMessage * pmessage , int afterPut )
116114{
117- #if BASE_3_14
115+ #if EPICS_VERSION_INT < VERSION_INT ( 3 , 15 , 0 , 0 )
118116 dbAddr * paddr = pmessage -> serverSpecific ;
119117#else
120118 struct dbChannel * pchan = pmessage -> serverSpecific ;
@@ -143,7 +141,7 @@ static void caPutLogAs(asTrapWriteMessage *pmessage, int afterPut)
143141
144142 epicsSnprintf (plogData -> userid , MAX_USERID_SIZE , "%s" , pmessage -> userid );
145143 epicsSnprintf (plogData -> hostid , MAX_HOSTID_SIZE , "%s" , pmessage -> hostid );
146- #if BASE_3_14
144+ #if EPICS_VERSION_INT < VERSION_INT ( 3 , 15 , 0 , 0 )
147145 dbNameOfPV (paddr , plogData -> pv_name , PVNAME_STRINGSZ );
148146#else
149147 epicsSnprintf (plogData -> pv_name , PVNAME_STRINGSZ , "%s" , pv_name );
@@ -201,9 +199,7 @@ static void caPutLogAs(asTrapWriteMessage *pmessage, int afterPut)
201199
202200int caPutLogMaxArraySize (short type )
203201{
204- #if !JSON_AND_ARRAYS_SUPPORTED
205- return 1 ;
206- #else
202+ #if EPICS_VERSION >= 7
207203 static int const arraySizeLookUpTable [] = {
208204 MAX_ARRAY_SIZE_BYTES /MAX_STRING_SIZE , /* DBR_STRING */
209205 MAX_ARRAY_SIZE_BYTES /sizeof (epicsInt8 ), /* DBR_CHAR */
@@ -222,9 +218,11 @@ int caPutLogMaxArraySize(short type)
222218 if (type >= DBR_STRING || type <= DBR_ENUM ){
223219 return arraySizeLookUpTable [type ];
224220 } else {
225- errlogSevPrintf (errlogMajor , "caPutLogAs: Array size for type %d can not be determind \n" , type );
221+ errlogSevPrintf (errlogMajor , "caPutLogAs: Array size for type %d can not be determined \n" , type );
226222 return 1 ;
227223 }
224+ #else
225+ return 1 ;
228226#endif
229227}
230228
0 commit comments