From 21ee244b5e1cf8477c92005d149fa34bced1153a Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Fri, 28 Mar 2003 16:01:45 +0000 Subject: [PATCH] more changes for epicsShare --- src/dbStatic/dbToRecordtypeH.c | 2 +- .../top/exampleApp/src/devXxxSoft.c | 2 +- src/rec/aaiRecord.c | 2 ++ src/rec/aaoRecord.c | 2 ++ src/rec/aiRecord.c | 2 ++ src/rec/aoRecord.c | 2 ++ src/rec/biRecord.c | 3 +- src/rec/boRecord.c | 3 +- src/rec/calcRecord.c | 3 +- src/rec/calcoutRecord.c | 3 +- src/rec/compressRecord.c | 3 +- src/rec/dfanoutRecord.c | 3 +- src/rec/egRecord.c | 4 ++- src/rec/egeventRecord.c | 4 +-- src/rec/erRecord.c | 3 +- src/rec/ereventRecord.c | 3 +- src/rec/eventRecord.c | 3 +- src/rec/fanoutRecord.c | 7 ++-- src/rec/histogramRecord.c | 3 +- src/rec/longinRecord.c | 3 +- src/rec/longoutRecord.c | 3 +- src/rec/mbbiDirectRecord.c | 3 +- src/rec/mbbiRecord.c | 3 +- src/rec/mbboDirectRecord.c | 3 +- src/rec/mbboRecord.c | 3 +- src/rec/permissiveRecord.c | 3 +- src/rec/selRecord.c | 3 +- src/rec/seqRecord.c | 3 +- src/rec/stateRecord.c | 3 +- src/rec/stringinRecord.c | 3 +- src/rec/stringoutRecord.c | 3 +- src/rec/subArrayRecord.c | 3 +- src/rec/subRecord.c | 3 +- src/rec/waveformRecord.c | 3 +- src/registry/registerRecordDeviceDriver.pl | 33 +++---------------- 35 files changed, 73 insertions(+), 62 deletions(-) diff --git a/src/dbStatic/dbToRecordtypeH.c b/src/dbStatic/dbToRecordtypeH.c index 8c3e14f54..072df1bd6 100644 --- a/src/dbStatic/dbToRecordtypeH.c +++ b/src/dbStatic/dbToRecordtypeH.c @@ -247,7 +247,7 @@ int main(int argc,char **argv) fprintf(outFile,"#endif\n"); pdbRecordType = (dbRecordType *)ellFirst(&pdbbase->recordTypeList); while(pdbRecordType) { - fprintf(outFile,"static int %sRecordSizeOffset(dbRecordType *pdbRecordType)\n{\n", + fprintf(outFile,"epicsShareFunc int %sRecordSizeOffset(dbRecordType *pdbRecordType)\n{\n", pdbRecordType->name); fprintf(outFile," %sRecord *prec = 0;\n",pdbRecordType->name); for(i=0; ino_fields; i++) { diff --git a/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c b/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c index 9a1dd87ba..d839e7e01 100644 --- a/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c +++ b/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c @@ -21,7 +21,7 @@ /*Create the dset for devXxxSoft */ static long init_record(); static long read_xxx(); -epicsShareExtern struct { +epicsShareDef struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/rec/aaiRecord.c b/src/rec/aaiRecord.c index 84b38c625..60ea2ac71 100644 --- a/src/rec/aaiRecord.c +++ b/src/rec/aaiRecord.c @@ -40,7 +40,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols +#define GEN_SIZE_OFFSET #include "aaiRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/aaoRecord.c b/src/rec/aaoRecord.c index 05e3be707..8c4615956 100644 --- a/src/rec/aaoRecord.c +++ b/src/rec/aaoRecord.c @@ -40,7 +40,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols +#define GEN_SIZE_OFFSET #include "aaoRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/aiRecord.c b/src/rec/aiRecord.c index cc9689c17..a64bed09b 100644 --- a/src/rec/aiRecord.c +++ b/src/rec/aiRecord.c @@ -37,7 +37,9 @@ #include "special.h" #include "menuConvert.h" #define epicsExportSharedSymbols +#define GEN_SIZE_OFFSET #include "aiRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/aoRecord.c b/src/rec/aoRecord.c index 9d3e910a2..588f4b7d2 100644 --- a/src/rec/aoRecord.c +++ b/src/rec/aoRecord.c @@ -38,7 +38,9 @@ #include "menuConvert.h" #include "menuOmsl.h" #define epicsExportSharedSymbols +#define GEN_SIZE_OFFSET #include "aoRecord.h" +#undef GEN_SIZE_OFFSET #include "menuIvoa.h" /* Create RSET - Record Support Entry Table*/ diff --git a/src/rec/biRecord.c b/src/rec/biRecord.c index 3eb4ffc49..ec956d1a4 100644 --- a/src/rec/biRecord.c +++ b/src/rec/biRecord.c @@ -36,8 +36,9 @@ #include "recGbl.h" #include "special.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "biRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL diff --git a/src/rec/boRecord.c b/src/rec/boRecord.c index dca74312a..ed0ce0d21 100644 --- a/src/rec/boRecord.c +++ b/src/rec/boRecord.c @@ -36,8 +36,9 @@ #include "recGbl.h" #include "special.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "boRecord.h" +#undef GEN_SIZE_OFFSET #include "menuIvoa.h" #include "menuOmsl.h" diff --git a/src/rec/calcRecord.c b/src/rec/calcRecord.c index 0a27646ec..befc5ce26 100644 --- a/src/rec/calcRecord.c +++ b/src/rec/calcRecord.c @@ -35,8 +35,9 @@ #include "recGbl.h" #include "special.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "calcRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/calcoutRecord.c b/src/rec/calcoutRecord.c index 7eedb4cd3..ea05d5a84 100644 --- a/src/rec/calcoutRecord.c +++ b/src/rec/calcoutRecord.c @@ -39,8 +39,9 @@ #include "postfix.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "calcoutRecord.h" +#undef GEN_SIZE_OFFSET #include "menuIvoa.h" /* Create RSET - Record Support Entry Table*/ diff --git a/src/rec/compressRecord.c b/src/rec/compressRecord.c index 8187b0942..f3fa33c2a 100644 --- a/src/rec/compressRecord.c +++ b/src/rec/compressRecord.c @@ -34,8 +34,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "compressRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/dfanoutRecord.c b/src/rec/dfanoutRecord.c index 3afb002f4..027ab8b15 100644 --- a/src/rec/dfanoutRecord.c +++ b/src/rec/dfanoutRecord.c @@ -40,8 +40,9 @@ #include "special.h" #include "menuOmsl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "dfanoutRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/egRecord.c b/src/rec/egRecord.c index e245a69cd..cd1b83154 100644 --- a/src/rec/egRecord.c +++ b/src/rec/egRecord.c @@ -30,9 +30,11 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" -#define epicsExportSharedSymbols +#define epicsExportSharedSymbols +#define GEN_SIZE_OFFSET #include "egRecord.h" +#undef GEN_SIZE_OFFSET #include "egDefs.h" #define STATIC static diff --git a/src/rec/egeventRecord.c b/src/rec/egeventRecord.c index 95ef891ee..9e9fb3aad 100644 --- a/src/rec/egeventRecord.c +++ b/src/rec/egeventRecord.c @@ -31,10 +31,10 @@ #include "recGbl.h" #define epicsExportSharedSymbols - - #include "egRecord.h" +#define GEN_SIZE_OFFSET #include "egeventRecord.h" +#undef GEN_SIZE_OFFSET #include "egDefs.h" #define STATIC static diff --git a/src/rec/erRecord.c b/src/rec/erRecord.c index 8701c610e..36d1addfa 100644 --- a/src/rec/erRecord.c +++ b/src/rec/erRecord.c @@ -32,8 +32,9 @@ #include "erDefs.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "erRecord.h" +#undef GEN_SIZE_OFFSET #define STATIC static diff --git a/src/rec/ereventRecord.c b/src/rec/ereventRecord.c index ac167385b..2661b3e2c 100644 --- a/src/rec/ereventRecord.c +++ b/src/rec/ereventRecord.c @@ -32,8 +32,9 @@ #include "ereventDefs.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "ereventRecord.h" +#undef GEN_SIZE_OFFSET #define STATIC static diff --git a/src/rec/eventRecord.c b/src/rec/eventRecord.c index 557789058..cd90e8f5c 100644 --- a/src/rec/eventRecord.c +++ b/src/rec/eventRecord.c @@ -34,8 +34,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "eventRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/fanoutRecord.c b/src/rec/fanoutRecord.c index ab562171c..d173e52ea 100644 --- a/src/rec/fanoutRecord.c +++ b/src/rec/fanoutRecord.c @@ -30,10 +30,11 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" -#define epicsExportSharedSymbols - -#include "fanoutRecord.h" #include "dbCommon.h" +#define epicsExportSharedSymbols +#define GEN_SIZE_OFFSET +#include "fanoutRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/histogramRecord.c b/src/rec/histogramRecord.c index 44cd65566..90baa52d5 100644 --- a/src/rec/histogramRecord.c +++ b/src/rec/histogramRecord.c @@ -38,8 +38,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "histogramRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/longinRecord.c b/src/rec/longinRecord.c index 8d815a8f0..2b33cbc7e 100644 --- a/src/rec/longinRecord.c +++ b/src/rec/longinRecord.c @@ -33,8 +33,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "longinRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/longoutRecord.c b/src/rec/longoutRecord.c index 973295127..881ba1b8a 100644 --- a/src/rec/longoutRecord.c +++ b/src/rec/longoutRecord.c @@ -30,8 +30,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "longoutRecord.h" +#undef GEN_SIZE_OFFSET #include "menuIvoa.h" #include "menuOmsl.h" diff --git a/src/rec/mbbiDirectRecord.c b/src/rec/mbbiDirectRecord.c index 2416d6234..5987e82ea 100644 --- a/src/rec/mbbiDirectRecord.c +++ b/src/rec/mbbiDirectRecord.c @@ -36,8 +36,9 @@ #include "recGbl.h" #include "special.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "mbbiDirectRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/mbbiRecord.c b/src/rec/mbbiRecord.c index 20234e02e..513e131dc 100644 --- a/src/rec/mbbiRecord.c +++ b/src/rec/mbbiRecord.c @@ -33,8 +33,9 @@ #include "recGbl.h" #include "special.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "mbbiRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL diff --git a/src/rec/mbboDirectRecord.c b/src/rec/mbboDirectRecord.c index 82d2c6760..5f54b240a 100644 --- a/src/rec/mbboDirectRecord.c +++ b/src/rec/mbboDirectRecord.c @@ -35,8 +35,9 @@ #include "recGbl.h" #include "special.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "mbboDirectRecord.h" +#undef GEN_SIZE_OFFSET #include "menuOmsl.h" #include "menuIvoa.h" diff --git a/src/rec/mbboRecord.c b/src/rec/mbboRecord.c index fbfba637e..b1b3deb15 100644 --- a/src/rec/mbboRecord.c +++ b/src/rec/mbboRecord.c @@ -35,8 +35,9 @@ #include "recGbl.h" #include "special.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "mbboRecord.h" +#undef GEN_SIZE_OFFSET #include "menuOmsl.h" #include "menuIvoa.h" diff --git a/src/rec/permissiveRecord.c b/src/rec/permissiveRecord.c index 174d0c45e..9c0bbfe00 100644 --- a/src/rec/permissiveRecord.c +++ b/src/rec/permissiveRecord.c @@ -32,8 +32,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "permissiveRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/selRecord.c b/src/rec/selRecord.c index bfd8be623..78c28b0c2 100644 --- a/src/rec/selRecord.c +++ b/src/rec/selRecord.c @@ -33,8 +33,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "selRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/seqRecord.c b/src/rec/seqRecord.c index db6480230..acdbb8834 100644 --- a/src/rec/seqRecord.c +++ b/src/rec/seqRecord.c @@ -33,8 +33,9 @@ #include "callback.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "seqRecord.h" +#undef GEN_SIZE_OFFSET int seqRecDebug = 0; diff --git a/src/rec/stateRecord.c b/src/rec/stateRecord.c index e875aa8a6..291255db1 100644 --- a/src/rec/stateRecord.c +++ b/src/rec/stateRecord.c @@ -33,8 +33,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "stateRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/stringinRecord.c b/src/rec/stringinRecord.c index 6d8dcb685..389d87d81 100644 --- a/src/rec/stringinRecord.c +++ b/src/rec/stringinRecord.c @@ -34,8 +34,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "stringinRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/stringoutRecord.c b/src/rec/stringoutRecord.c index a0ff8aeee..52d9034f6 100644 --- a/src/rec/stringoutRecord.c +++ b/src/rec/stringoutRecord.c @@ -34,8 +34,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "stringoutRecord.h" +#undef GEN_SIZE_OFFSET #include "menuOmsl.h" #include "menuIvoa.h" diff --git a/src/rec/subArrayRecord.c b/src/rec/subArrayRecord.c index ae615eea6..11b225969 100644 --- a/src/rec/subArrayRecord.c +++ b/src/rec/subArrayRecord.c @@ -36,8 +36,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "subArrayRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/subRecord.c b/src/rec/subRecord.c index eee6190a5..b727e903a 100644 --- a/src/rec/subRecord.c +++ b/src/rec/subRecord.c @@ -37,8 +37,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "subRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL diff --git a/src/rec/waveformRecord.c b/src/rec/waveformRecord.c index c85efe88f..1ffd2e5fc 100644 --- a/src/rec/waveformRecord.c +++ b/src/rec/waveformRecord.c @@ -35,8 +35,9 @@ #include "recSup.h" #include "recGbl.h" #define epicsExportSharedSymbols - +#define GEN_SIZE_OFFSET #include "waveformRecord.h" +#undef GEN_SIZE_OFFSET /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL diff --git a/src/registry/registerRecordDeviceDriver.pl b/src/registry/registerRecordDeviceDriver.pl index 89b961de2..da33499b4 100755 --- a/src/registry/registerRecordDeviceDriver.pl +++ b/src/registry/registerRecordDeviceDriver.pl @@ -61,26 +61,16 @@ print << "END" ; #include "registryDriverSupport.h" #include "iocsh.h" #include "shareLib.h" -#define GEN_SIZE_OFFSET END -if($numberRecordType>0) { - for ($i=0; $i<$numberRecordType; $i++) { - print "#include <$recordType[$i]Record.h>\n" - } -} -print "#undef GEN_SIZE_OFFSET\n"; + +print "extern \"C\" {\n"; #definitions for recordtype if($numberRecordType>0) { - print "#ifdef __cplusplus\n"; - print "extern \"C\" {\n"; - print "#endif\n"; for ($i=0; $i<$numberRecordType; $i++) { print "epicsShareExtern struct rset $recordType[$i]RSET;\n"; + print "epicsShareFunc int $recordType[$i]RecordSizeOffset(dbRecordType *pdbRecordType);\n" } - print "#ifdef __cplusplus\n"; - print "}\n"; - print "#endif\n"; print "\nstatic const char * const recordTypeNames[$numberRecordType] = {\n"; for ($i=0; $i<$numberRecordType; $i++) { print " \"$recordType[$i]\""; @@ -100,15 +90,9 @@ if($numberRecordType>0) { #definitions for device if($numberDeviceSupport>0) { - print "#ifdef __cplusplus\n"; - print "extern \"C\" {\n"; - print "#endif\n"; for ($i=0; $i<$numberDeviceSupport; $i++) { print "epicsShareExtern struct dset $deviceSupport[$i];\n"; } - print "#ifdef __cplusplus\n"; - print "}\n"; - print "#endif\n"; print "\nstatic const char * const deviceSupportNames[$numberDeviceSupport] = {\n"; for ($i=0; $i<$numberDeviceSupport; $i++) { print " \"$deviceSupport[$i]\""; @@ -128,15 +112,9 @@ if($numberDeviceSupport>0) { #definitions for driver if($numberDriverSupport>0) { - print "#ifdef __cplusplus\n"; - print "extern \"C\" {\n"; - print "#endif\n"; for ($i=0; $i<$numberDriverSupport; $i++) { print "epicsShareExtern struct drvet $driverSupport[$i];\n"; } - print "#ifdef __cplusplus\n"; - print "}\n"; - print "#endif\n"; print "\nstatic char *driverSupportNames[$numberDriverSupport] = {\n"; for ($i=0; $i<$numberDriverSupport; $i++) { print " \"$driverSupport[$i]\""; @@ -157,11 +135,9 @@ if($numberDriverSupport>0) { #definitions registrar if($numberRegistrar>0) { print "typedef void(*REGISTRARFUNC)(void);\n"; - print "extern \"C\" {\n"; for ($i=0; $i<$numberRegistrar; $i++) { print "epicsShareFunc void $registrar[$i](void);\n"; } - print "}\n\n"; } #Now actual registration code. @@ -237,13 +213,12 @@ static const iocshArg *registerRecordDeviceDriverArgs[1] = {®isterRecordDeviceDriverArg0}; static const iocshFuncDef registerRecordDeviceDriverFuncDef = {"registerRecordDeviceDriver",1,registerRecordDeviceDriverArgs}; -extern "C" { static void registerRecordDeviceDriverCallFunc(const iocshArgBuf *) { registerRecordDeviceDriver(pdbbase); } -} //extern "C" +} // ext C /* * Register commands on application startup */