diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index ef0b35d07..57d401e9d 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -32,9 +32,24 @@ a script by starting those lines with '#-' rather than just '#'.

The table of record support functions (rset methods for short) no longer has entries of type RECSUPFUN (which says: any number and type of -arguments). The RECSUPFUN typedef has been removed and casts to -RECSUPFUN can no longer be used when initializing struct -rset. Record supports can define the macro REC_TYPE to the +arguments). Instead, rset methods are now typed by default. The +RECSUPFUN typedef has been removed and casts to RECSUPFUN +can no longer be used when initializing struct rset.

+ +

Existing code (e.g. external record supports) might not compile cleanly +against the new rset definition without changes. Instead of adapting their +code as described further below, users can instead get the old untyped +definitions back by placing

+ +
+#define UNTYPED_RSET
+
+ +

before including headers from base.

+ +

The following assumes that UNTYPED_RSET has not been defined.

+ +

Record supports can define the macro REC_TYPE to the name of their record type (including the Record suffix) before including any headers from base, like this:

diff --git a/src/ioc/dbStatic/Makefile b/src/ioc/dbStatic/Makefile index c962501d9..2836785ba 100644 --- a/src/ioc/dbStatic/Makefile +++ b/src/ioc/dbStatic/Makefile @@ -21,6 +21,7 @@ INC += guigroup.h INC += devSup.h INC += drvSup.h INC += recSup.h +INC += oldRecSup.h INC += dbStaticIocRegister.h dbCore_SRCS += dbStaticLib.c diff --git a/src/ioc/dbStatic/oldRecSup.h b/src/ioc/dbStatic/oldRecSup.h new file mode 100644 index 000000000..35971a670 --- /dev/null +++ b/src/ioc/dbStatic/oldRecSup.h @@ -0,0 +1,30 @@ +/* + * DO NOT INCLUDE THIS FILE + * + * Instead #define UNTYPED_RSET, then #include "recSup.h" + */ + +typedef long (*RECSUPFUN) (); /* ptr to record support function*/ + +typedef struct rset { /* record support entry table */ + long number; /*number of support routines */ + RECSUPFUN report; /*print report */ + RECSUPFUN init; /*init support */ + RECSUPFUN init_record; /*init record */ + RECSUPFUN process; /*process record */ + RECSUPFUN special; /*special processing */ + RECSUPFUN get_value; /*no longer used */ + RECSUPFUN cvt_dbaddr; /*cvt dbAddr */ + RECSUPFUN get_array_info; + RECSUPFUN put_array_info; + RECSUPFUN get_units; + RECSUPFUN get_precision; + RECSUPFUN get_enum_str; /*get string from enum item*/ + RECSUPFUN get_enum_strs; /*get all enum strings */ + RECSUPFUN put_enum_str; /*put string from enum item*/ + RECSUPFUN get_graphic_double; + RECSUPFUN get_control_double; + RECSUPFUN get_alarm_double; +}rset; + +#define RSETNUMBER ( (sizeof(struct rset) - sizeof(long))/sizeof(RECSUPFUN) ) diff --git a/src/ioc/dbStatic/recSup.h b/src/ioc/dbStatic/recSup.h index 21d724e36..6bc6adf90 100644 --- a/src/ioc/dbStatic/recSup.h +++ b/src/ioc/dbStatic/recSup.h @@ -23,6 +23,10 @@ extern "C" { typedef struct rset rset; +#ifdef UNTYPED_RSET +#include "oldRecSup.h" +#else + /* defined elsewhere */ struct dbAddr; struct dbr_enumStrs; @@ -60,6 +64,8 @@ struct rset { #define RSETNUMBER 17 +#endif /* UNTYPED_RSET */ + #define S_rec_noRSET (M_recSup| 1) /*Missing record support entry table*/ #define S_rec_noSizeOffset (M_recSup| 2) /*Missing SizeOffset Routine*/ #define S_rec_outMem (M_recSup| 3) /*Out of Memory*/