diff --git a/motorApp/MotorSimSrc/devMotorSim.c b/motorApp/MotorSimSrc/devMotorSim.c index 15552418..f8889e3c 100644 --- a/motorApp/MotorSimSrc/devMotorSim.c +++ b/motorApp/MotorSimSrc/devMotorSim.c @@ -6,6 +6,9 @@ #include #include +/* The following is needed to compile against Base R3.16.1 without a warning */ +#define USE_TYPED_RSET + #include "epicsFindSymbol.h" #include "dbAccess.h" #include "recGbl.h" diff --git a/motorApp/MotorSrc/devMotorAsyn.c b/motorApp/MotorSrc/devMotorAsyn.c index a3b915e8..c09834e9 100644 --- a/motorApp/MotorSrc/devMotorAsyn.c +++ b/motorApp/MotorSrc/devMotorAsyn.c @@ -51,15 +51,7 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include /* !! for callocMustSucceed() */ -#include +#include "motor_epics_inc.h" #include #include diff --git a/motorApp/MotorSrc/motorRecord.cc b/motorApp/MotorSrc/motorRecord.cc index dd8cacb7..0129b879 100644 --- a/motorApp/MotorSrc/motorRecord.cc +++ b/motorApp/MotorSrc/motorRecord.cc @@ -198,16 +198,10 @@ USAGE... Motor Record Support. #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include "motor_epics_inc.h" + #define GEN_SIZE_OFFSET #include "motorRecord.h" #undef GEN_SIZE_OFFSET @@ -249,38 +243,39 @@ static void syncTargetPosition(motorRecord *); /*** Record Support Entry Table (RSET) functions. ***/ -static long init_record(dbCommon *, int); -static long process(dbCommon *); +extern "C" { +static long init_record(struct dbCommon*, int); +static long process(struct dbCommon*); static long special(DBADDR *, int); -static long get_units(const DBADDR *, char *); -static long get_precision(const DBADDR *, long *); -static long get_graphic_double(const DBADDR *, struct dbr_grDouble *); -static long get_control_double(const DBADDR *, struct dbr_ctrlDouble *); -static long get_alarm_double(const DBADDR *, struct dbr_alDouble *); - +static long get_units(DBADDR *, char *); +static long get_precision(const struct dbAddr *, long *); +static long get_graphic_double(DBADDR *, struct dbr_grDouble *); +static long get_control_double(DBADDR *, struct dbr_ctrlDouble *); +static long get_alarm_double(DBADDR *, struct dbr_alDouble *); rset motorRSET = { RSETNUMBER, NULL, NULL, - (RECSUPFUN) init_record, - (RECSUPFUN) process, - (RECSUPFUN) special, + RECSUPFUN_CAST init_record, + RECSUPFUN_CAST process, + RECSUPFUN_CAST special, NULL, NULL, NULL, NULL, - (RECSUPFUN) get_units, - (RECSUPFUN) get_precision, + RECSUPFUN_CAST get_units, + RECSUPFUN_CAST get_precision, NULL, NULL, NULL, - (RECSUPFUN) get_graphic_double, - (RECSUPFUN) get_control_double, - (RECSUPFUN) get_alarm_double + RECSUPFUN_CAST get_graphic_double, + RECSUPFUN_CAST get_control_double, + RECSUPFUN_CAST get_alarm_double }; -extern "C" {epicsExportAddress(rset, motorRSET);} +epicsExportAddress(rset, motorRSET); +} /******************************************************************************* @@ -3116,7 +3111,7 @@ velcheckA: /****************************************************************************** get_units() *******************************************************************************/ -static long get_units(const DBADDR *paddr, char *units) +static long get_units(DBADDR *paddr, char *units) { motorRecord *pmr = (motorRecord *) paddr->precord; int siz = dbr_units_size - 1; /* "dbr_units_size" from dbAccess.h */ @@ -3173,7 +3168,7 @@ static long get_units(const DBADDR *paddr, char *units) /****************************************************************************** get_graphic_double() *******************************************************************************/ -static long get_graphic_double(const DBADDR *paddr, struct dbr_grDouble * pgd) +static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble * pgd) { motorRecord *pmr = (motorRecord *) paddr->precord; int fieldIndex = dbGetFieldIndex(paddr); @@ -3224,7 +3219,7 @@ static long get_graphic_double(const DBADDR *paddr, struct dbr_grDouble * pgd) get_control_double() *******************************************************************************/ static long - get_control_double(const DBADDR *paddr, struct dbr_ctrlDouble * pcd) + get_control_double(DBADDR *paddr, struct dbr_ctrlDouble * pcd) { motorRecord *pmr = (motorRecord *) paddr->precord; int fieldIndex = dbGetFieldIndex(paddr); @@ -3304,7 +3299,7 @@ static long get_precision(const DBADDR *paddr, long *precision) /****************************************************************************** get_alarm_double() *******************************************************************************/ -static long get_alarm_double(const DBADDR *paddr, struct dbr_alDouble * pad) +static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble * pad) { motorRecord *pmr = (motorRecord *) paddr->precord; int fieldIndex = dbGetFieldIndex(paddr); diff --git a/motorApp/MotorSrc/motorUtilAux.cc b/motorApp/MotorSrc/motorUtilAux.cc index 9b915d9d..fef1690c 100644 --- a/motorApp/MotorSrc/motorUtilAux.cc +++ b/motorApp/MotorSrc/motorUtilAux.cc @@ -29,6 +29,8 @@ USAGE... Motor Record Utility Support. */ #include +#include "motor_epics_inc.h" + #include #include diff --git a/motorApp/MotorSrc/motor_epics_inc.h b/motorApp/MotorSrc/motor_epics_inc.h new file mode 100644 index 00000000..0d4698c5 --- /dev/null +++ b/motorApp/MotorSrc/motor_epics_inc.h @@ -0,0 +1,33 @@ +#ifndef INCmotorepicsinc +#define INCmotorepicsinc 1 + +#include "epicsVersion.h" + +#ifndef VERSION_INT +# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P)) +#endif + +#define VERSION_INT_3_16 VERSION_INT(3,16,0,0) +#if EPICS_VERSION_INT < VERSION_INT_3_16 +#define RECSUPFUN_CAST (RECSUPFUN) +#else +#define RECSUPFUN_CAST +#define REC_TYPE motorRecord +#define USE_TYPED_RSET +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* !! for callocMustSucceed() */ +#include +#include + +#endif diff --git a/motorApp/MotorSrc/motordevCom.cc b/motorApp/MotorSrc/motordevCom.cc index c9a467e6..b82bc8fa 100644 --- a/motorApp/MotorSrc/motordevCom.cc +++ b/motorApp/MotorSrc/motordevCom.cc @@ -63,12 +63,7 @@ USAGE... This file contains device functions that are common to all motor #include #include #include -#include -#include -#include -#include -#include -#include +#include "motor_epics_inc.h" #include "motorRecord.h" #include "motor.h" diff --git a/motorApp/SoftMotorSrc/devSoft.cc b/motorApp/SoftMotorSrc/devSoft.cc index 5ef2ddd0..55d29138 100644 --- a/motorApp/SoftMotorSrc/devSoft.cc +++ b/motorApp/SoftMotorSrc/devSoft.cc @@ -46,6 +46,8 @@ NOTES... - Can't call CA functions until after dbLockInitRecords() has been called and initialized lock sets. */ +/* The following is needed to compile against Base R3.16.1 without a warning */ +#define USE_TYPED_RSET #include #include