diff --git a/src/dbStatic/dbToRecordtypeH.c b/src/dbStatic/dbToRecordtypeH.c index 5872b3361..410beea65 100644 --- a/src/dbStatic/dbToRecordtypeH.c +++ b/src/dbStatic/dbToRecordtypeH.c @@ -117,11 +117,21 @@ int main(int argc,char **argv) errPrintf(0,__FILE__,__LINE__,"Error opening %s\n",outFilename); exit(-1); } + fprintf(outFile,"#ifdef epicsExportSharedSymbols\n"); + fprintf(outFile,"# define INCrecH_epicsExportSharedSymbols\n"); + fprintf(outFile,"# undef epicsExportSharedSymbols\n"); + fprintf(outFile,"#endif\n"); + fprintf(outFile,"#include \"ellLib.h\"\n"); fprintf(outFile,"#include \"epicsMutex.h\"\n"); fprintf(outFile,"#include \"link.h\"\n"); fprintf(outFile,"#include \"epicsTime.h\"\n"); fprintf(outFile,"#include \"epicsTypes.h\"\n"); + + fprintf(outFile,"#ifdef INCrecH_epicsExportSharedSymbols\n"); + fprintf(outFile,"# define epicsExportSharedSymbols\n"); + fprintf(outFile,"#endif\n"); + fprintf(outFile,"#include \"shareLib.h\"\n"); pdbMenu = (dbMenu *)ellFirst(&pdbbase->menuList); while(pdbMenu) { fprintf(outFile,"\n#ifndef INC%sH\n",pdbMenu->name); @@ -140,6 +150,9 @@ int main(int argc,char **argv) while(pdbRecordType) { fprintf(outFile,"#ifndef INC%sH\n",pdbRecordType->name); fprintf(outFile,"#define INC%sH\n",pdbRecordType->name); + fprintf(outFile,"#ifdef epicsExportSharedSymbols\n"); + fprintf(outFile,"epicsShareExtern struct rset %sRSET;\n",pdbRecordType->name); + fprintf(outFile,"#endif\n"); fprintf(outFile,"typedef struct %s",pdbRecordType->name); if(!isdbCommonRecord) fprintf(outFile,"Record"); fprintf(outFile," {\n"); @@ -234,7 +247,10 @@ int main(int argc,char **argv) fprintf(outFile,"#endif\n"); pdbRecordType = (dbRecordType *)ellFirst(&pdbbase->recordTypeList); while(pdbRecordType) { - fprintf(outFile,"int %sRecordSizeOffset(dbRecordType *pdbRecordType)\n{\n", + fprintf(outFile,"#ifdef epicsExportSharedSymbols\n"); + fprintf(outFile,"epicsShareFunc \n"); + fprintf(outFile,"#endif\n"); + fprintf(outFile,"int epicsShareAPI %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/dev/softDev/Makefile b/src/dev/softDev/Makefile index 6e724252e..7a2746437 100644 --- a/src/dev/softDev/Makefile +++ b/src/dev/softDev/Makefile @@ -11,8 +11,6 @@ TOP=../../.. include $(TOP)/configure/CONFIG -SHARED_LIBRARIES = NO - SRCS += devAiSoft.c SRCS += devAiSoftRaw.c SRCS += devAoSoft.c @@ -39,6 +37,7 @@ SRCS += devSoSoft.c SRCS += devWfSoft.c LIBRARY_IOC += softDevIoc +softDevIoc_LIBS += dbIoc # For R3.13 compatability OBJS_vxWorks = $(SRCS:%.c=%) diff --git a/src/dev/softDev/devAiSoft.c b/src/dev/softDev/devAiSoft.c index 1e6ed02fe..2e8c0d06d 100644 --- a/src/dev/softDev/devAiSoft.c +++ b/src/dev/softDev/devAiSoft.c @@ -27,10 +27,13 @@ #include "devSup.h" #include "link.h" #include "aiRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devAiSoft */ static long init_record(); static long read_ai(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devAiSoftRaw.c b/src/dev/softDev/devAiSoftRaw.c index c8de36047..667c32975 100644 --- a/src/dev/softDev/devAiSoftRaw.c +++ b/src/dev/softDev/devAiSoftRaw.c @@ -28,10 +28,13 @@ #include "devSup.h" #include "link.h" #include "aiRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devAiSoftRaw */ static long init_record(aiRecord *pai); static long read_ai(aiRecord *pai); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devAoSoft.c b/src/dev/softDev/devAoSoft.c index 68391dfbe..55a252758 100644 --- a/src/dev/softDev/devAoSoft.c +++ b/src/dev/softDev/devAoSoft.c @@ -30,13 +30,15 @@ #include "link.h" #include "special.h" #include "aoRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* added for Channel Access Links */ static long init_record(); /* Create the dset for devAoSoft */ static long write_ao(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devAoSoftRaw.c b/src/dev/softDev/devAoSoftRaw.c index 2cc5b2afa..f3b2e553d 100644 --- a/src/dev/softDev/devAoSoftRaw.c +++ b/src/dev/softDev/devAoSoftRaw.c @@ -30,10 +30,12 @@ #include "link.h" #include "special.h" #include "aoRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devAoSoftRaw */ static long write_ao(aoRecord *pao); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devBiSoft.c b/src/dev/softDev/devBiSoft.c index 55292e6fa..f1058f46a 100644 --- a/src/dev/softDev/devBiSoft.c +++ b/src/dev/softDev/devBiSoft.c @@ -25,10 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "biRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devBiSoft */ static long init_record(); static long read_bi(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devBiSoftRaw.c b/src/dev/softDev/devBiSoftRaw.c index 425f9add1..a98ad93d6 100644 --- a/src/dev/softDev/devBiSoftRaw.c +++ b/src/dev/softDev/devBiSoftRaw.c @@ -25,10 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "biRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devBiSoftRaw */ static long init_record(); static long read_bi(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devBoSoft.c b/src/dev/softDev/devBoSoft.c index 8a1799bd6..f7ee97503 100644 --- a/src/dev/softDev/devBoSoft.c +++ b/src/dev/softDev/devBoSoft.c @@ -29,13 +29,16 @@ #include "recSup.h" #include "devSup.h" #include "boRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + static long init_record(); /* Create the dset for devBoSoft */ static long write_bo(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devBoSoftRaw.c b/src/dev/softDev/devBoSoftRaw.c index b042c6f00..920a8f0e5 100644 --- a/src/dev/softDev/devBoSoftRaw.c +++ b/src/dev/softDev/devBoSoftRaw.c @@ -28,6 +28,9 @@ #include "recSup.h" #include "devSup.h" #include "boRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* added for Channel Access Links */ static long init_record(); @@ -35,7 +38,7 @@ static long init_record(); /* Create the dset for devBoSoftRaw */ static long write_bo(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devEventSoft.c b/src/dev/softDev/devEventSoft.c index 2b61335e0..72edc0382 100644 --- a/src/dev/softDev/devEventSoft.c +++ b/src/dev/softDev/devEventSoft.c @@ -24,11 +24,14 @@ #include "recSup.h" #include "devSup.h" #include "eventRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devEventSoft */ static long init_record(); static long read_event(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devHistogramSoft.c b/src/dev/softDev/devHistogramSoft.c index 9b9116070..d36714faf 100644 --- a/src/dev/softDev/devHistogramSoft.c +++ b/src/dev/softDev/devHistogramSoft.c @@ -26,10 +26,13 @@ #include "devSup.h" #include "link.h" #include "histogramRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devHistogramSoft */ static long init_record(); static long read_histogram(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devLiSoft.c b/src/dev/softDev/devLiSoft.c index 67c0a40a7..1b4d6eb25 100644 --- a/src/dev/softDev/devLiSoft.c +++ b/src/dev/softDev/devLiSoft.c @@ -24,12 +24,15 @@ #include "recSup.h" #include "devSup.h" #include "longinRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devLiSoft */ static long init_record(); static long read_longin(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devLoSoft.c b/src/dev/softDev/devLoSoft.c index f98034887..6b07fdab5 100644 --- a/src/dev/softDev/devLoSoft.c +++ b/src/dev/softDev/devLoSoft.c @@ -24,10 +24,13 @@ #include "recSup.h" #include "devSup.h" #include "longoutRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devLoSoft */ static long init_record(); static long write_longout(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devMbbiDirectSoft.c b/src/dev/softDev/devMbbiDirectSoft.c index 2e290d821..7273bacc0 100644 --- a/src/dev/softDev/devMbbiDirectSoft.c +++ b/src/dev/softDev/devMbbiDirectSoft.c @@ -25,10 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "mbbiDirectRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devMbbiSoft */ static long init_record(); static long read_mbbi(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devMbbiDirectSoftRaw.c b/src/dev/softDev/devMbbiDirectSoftRaw.c index 2771cdf3b..3204e4b7d 100644 --- a/src/dev/softDev/devMbbiDirectSoftRaw.c +++ b/src/dev/softDev/devMbbiDirectSoftRaw.c @@ -25,10 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "mbbiDirectRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devMbbiDirectSoftRaw */ static long init_record(); static long read_mbbi(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devMbbiSoft.c b/src/dev/softDev/devMbbiSoft.c index 63d58251c..875f28638 100644 --- a/src/dev/softDev/devMbbiSoft.c +++ b/src/dev/softDev/devMbbiSoft.c @@ -25,10 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "mbbiRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devMbbiSoft */ static long init_record(); static long read_mbbi(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devMbbiSoftRaw.c b/src/dev/softDev/devMbbiSoftRaw.c index 55dcd6d11..64b220df3 100644 --- a/src/dev/softDev/devMbbiSoftRaw.c +++ b/src/dev/softDev/devMbbiSoftRaw.c @@ -25,10 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "mbbiRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devMbbiSoftRaw */ static long init_record(); static long read_mbbi(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devMbboDirectSoft.c b/src/dev/softDev/devMbboDirectSoft.c index 5293a25e3..0c8e859b7 100644 --- a/src/dev/softDev/devMbboDirectSoft.c +++ b/src/dev/softDev/devMbboDirectSoft.c @@ -25,10 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "mbboDirectRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devMbboSoft */ static long init_record(); static long write_mbbo(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devMbboDirectSoftRaw.c b/src/dev/softDev/devMbboDirectSoftRaw.c index 22d63a97a..da5e6bfa0 100644 --- a/src/dev/softDev/devMbboDirectSoftRaw.c +++ b/src/dev/softDev/devMbboDirectSoftRaw.c @@ -25,11 +25,14 @@ #include "recSup.h" #include "devSup.h" #include "mbboDirectRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devMbboDirectSoftRaw */ static long init_record(); static long write_mbbo(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devMbboSoft.c b/src/dev/softDev/devMbboSoft.c index e2eaf2e1b..8aff9d403 100644 --- a/src/dev/softDev/devMbboSoft.c +++ b/src/dev/softDev/devMbboSoft.c @@ -25,10 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "mbboRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devMbboSoft */ static long init_record(); static long write_mbbo(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devMbboSoftRaw.c b/src/dev/softDev/devMbboSoftRaw.c index b0c511115..9f07d63a4 100644 --- a/src/dev/softDev/devMbboSoftRaw.c +++ b/src/dev/softDev/devMbboSoftRaw.c @@ -24,10 +24,13 @@ #include "recSup.h" #include "devSup.h" #include "mbboRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devMbboSoftRaw */ static long init_record(); static long write_mbbo(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devSASoft.c b/src/dev/softDev/devSASoft.c index 44f1290c5..e14fca654 100644 --- a/src/dev/softDev/devSASoft.c +++ b/src/dev/softDev/devSASoft.c @@ -25,13 +25,15 @@ #include "devSup.h" #include "link.h" #include "subArrayRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" static int sizeofTypes[] = {MAX_STRING_SIZE,1,1,2,2,4,4,4,8,2}; /* Create the dset for devSASoft */ static long init_record(); static long read_sa(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devSiSoft.c b/src/dev/softDev/devSiSoft.c index a69335bf3..3cb40343c 100644 --- a/src/dev/softDev/devSiSoft.c +++ b/src/dev/softDev/devSiSoft.c @@ -26,11 +26,13 @@ #include "recSup.h" #include "devSup.h" #include "stringinRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devSiSoft */ static long init_record(); static long read_stringin(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devSoSoft.c b/src/dev/softDev/devSoSoft.c index 4896fa67c..9b347b8d5 100644 --- a/src/dev/softDev/devSoSoft.c +++ b/src/dev/softDev/devSoSoft.c @@ -25,11 +25,13 @@ #include "recSup.h" #include "devSup.h" #include "stringoutRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devSoSoft */ static long init_record(); static long write_stringout(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/softDev/devWfSoft.c b/src/dev/softDev/devWfSoft.c index 8e69ad5e1..d6da3276c 100644 --- a/src/dev/softDev/devWfSoft.c +++ b/src/dev/softDev/devWfSoft.c @@ -30,11 +30,13 @@ #include "devSup.h" #include "link.h" #include "waveformRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devWfSoft */ static long init_record(); static long read_wf(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/Makefile b/src/dev/testDev/Makefile index f9943dddb..b05bcd1b2 100644 --- a/src/dev/testDev/Makefile +++ b/src/dev/testDev/Makefile @@ -11,8 +11,6 @@ TOP=../../.. include $(TOP)/configure/CONFIG -SHARED_LIBRARIES = NO - SRCS += devAiTestAsyn.c SRCS += devAoTestAsyn.c SRCS += devBiTestAsyn.c @@ -26,6 +24,7 @@ SRCS += devSoTestAsyn.c SRCS += devWfTestAsyn.c LIBRARY_IOC = testDevIoc +testDevIoc_LIBS += dbIoc # For R3.13 compatability OBJS_vxWorks = $(SRCS:%.c=%) diff --git a/src/dev/testDev/devAiTestAsyn.c b/src/dev/testDev/devAiTestAsyn.c index 2f5d66016..d33e97309 100644 --- a/src/dev/testDev/devAiTestAsyn.c +++ b/src/dev/testDev/devAiTestAsyn.c @@ -33,11 +33,13 @@ #include "link.h" #include "dbCommon.h" #include "aiRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devAiTestAsyn */ static long init_record(); static long read_ai(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -54,6 +56,7 @@ struct { read_ai, NULL}; + static long init_record(pai) struct aiRecord *pai; { diff --git a/src/dev/testDev/devAoTestAsyn.c b/src/dev/testDev/devAoTestAsyn.c index 21affc1dd..e7b8ca20b 100644 --- a/src/dev/testDev/devAoTestAsyn.c +++ b/src/dev/testDev/devAoTestAsyn.c @@ -34,11 +34,13 @@ #include "link.h" #include "dbCommon.h" #include "aoRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devAoTestAsyn */ static long init_record(); static long write_ao(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devBiTestAsyn.c b/src/dev/testDev/devBiTestAsyn.c index 6bf85415a..0b2f129d4 100644 --- a/src/dev/testDev/devBiTestAsyn.c +++ b/src/dev/testDev/devBiTestAsyn.c @@ -33,11 +33,13 @@ #include "link.h" #include "dbCommon.h" #include "biRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devBiTestAsyn */ static long init_record(); static long read_bi(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devBoTestAsyn.c b/src/dev/testDev/devBoTestAsyn.c index b82a7b3fb..cd04b9417 100644 --- a/src/dev/testDev/devBoTestAsyn.c +++ b/src/dev/testDev/devBoTestAsyn.c @@ -34,11 +34,13 @@ #include "link.h" #include "dbCommon.h" #include "boRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devBoTestAsyn */ static long init_record(); static long write_bo(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devEventTestIoEvent.c b/src/dev/testDev/devEventTestIoEvent.c index 6a5726ee2..12d78eacc 100644 --- a/src/dev/testDev/devEventTestIoEvent.c +++ b/src/dev/testDev/devEventTestIoEvent.c @@ -27,11 +27,14 @@ #include "recSup.h" #include "devSup.h" #include "eventRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" + /* Create the dset for devEventTestIoEvent */ static long init_record(); static long get_ioint_info(); static long read_event(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devHistogramTestAsyn.c b/src/dev/testDev/devHistogramTestAsyn.c index 4df666dc2..8f4af3d83 100644 --- a/src/dev/testDev/devHistogramTestAsyn.c +++ b/src/dev/testDev/devHistogramTestAsyn.c @@ -29,11 +29,13 @@ #include "link.h" #include "dbCommon.h" #include "histogramRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devHistogramTestAsyn */ static long init_record(); static long read_histogram(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devMbbiTestAsyn.c b/src/dev/testDev/devMbbiTestAsyn.c index bfdd42e21..1433b0cc5 100644 --- a/src/dev/testDev/devMbbiTestAsyn.c +++ b/src/dev/testDev/devMbbiTestAsyn.c @@ -33,11 +33,13 @@ #include "link.h" #include "dbCommon.h" #include "mbbiRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devMbbiTestAsyn */ static long init_record(); static long read_mbbi(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devMbboTestAsyn.c b/src/dev/testDev/devMbboTestAsyn.c index 1d0eeedd0..904325578 100644 --- a/src/dev/testDev/devMbboTestAsyn.c +++ b/src/dev/testDev/devMbboTestAsyn.c @@ -34,11 +34,13 @@ #include "link.h" #include "dbCommon.h" #include "mbboRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devMbboTestAsyn */ static long init_record(); static long write_mbbo(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devSiTestAsyn.c b/src/dev/testDev/devSiTestAsyn.c index ef797d70f..ffa85afd2 100644 --- a/src/dev/testDev/devSiTestAsyn.c +++ b/src/dev/testDev/devSiTestAsyn.c @@ -32,11 +32,13 @@ #include "link.h" #include "dbCommon.h" #include "stringinRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devSiTestAsyn */ static long init_record(); static long read_stringin(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devSoTestAsyn.c b/src/dev/testDev/devSoTestAsyn.c index d2b8a2c0a..aa6e599f9 100644 --- a/src/dev/testDev/devSoTestAsyn.c +++ b/src/dev/testDev/devSoTestAsyn.c @@ -33,11 +33,13 @@ #include "link.h" #include "dbCommon.h" #include "stringoutRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devSoTestAsyn */ static long init_record(); static long write_stringout(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/dev/testDev/devWfTestAsyn.c b/src/dev/testDev/devWfTestAsyn.c index 6802a791d..d8296989c 100644 --- a/src/dev/testDev/devWfTestAsyn.c +++ b/src/dev/testDev/devWfTestAsyn.c @@ -33,11 +33,13 @@ #include "link.h" #include "dbCommon.h" #include "waveformRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /* Create the dset for devWfTestAsyn */ static long init_record(); static long read_wf(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/makeBaseApp/top/exampleApp/src/Makefile b/src/makeBaseApp/top/exampleApp/src/Makefile index dbd7143f4..ed30decc5 100644 --- a/src/makeBaseApp/top/exampleApp/src/Makefile +++ b/src/makeBaseApp/top/exampleApp/src/Makefile @@ -13,20 +13,29 @@ DBD += _APPNAME_.dbd #============================= -PROD_IOC = _APPNAME_ +LIBRARY_IOC += _APPNAME_Ioc -_APPNAME__SRCS += xxxRecord.c -_APPNAME__SRCS += devXxxSoft.c -_APPNAME__SRCS += dbSubExample.c +_APPNAME_Ioc_SRCS += xxxRecord.c +_APPNAME_Ioc_SRCS += devXxxSoft.c + +_APPNAME_Ioc_LIBS += $(EPICS_BASE_IOC_LIBRARIES) +_APPNAME_Ioc_SYS_LIBS_solaris += c + +#============================= + +PROD_IOC = _APPNAME_ # _registerRecordDeviceDriver.cpp will be created from .dbd _APPNAME__SRCS += _APPNAME__registerRecordDeviceDriver.cpp +_APPNAME__SRCS += dbSubExample.c _APPNAME__SRCS_DEFAULT += _APPNAME_Main.cpp _APPNAME__SRCS_vxWorks += -nil- #The following adds support from base/src/vxWorks _APPNAME__OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary +_APPNAME__LIBS += _APPNAME_Ioc + #NOTES: # 1)It is not possible to build sncExample both as a component of _APPNAME_ # and standalone. You must choose only one. @@ -36,46 +45,16 @@ _APPNAME__OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary #_APPNAME__SRCS += sncExample.stt #_APPNAME__LIBS += seq #_APPNAME__LIBS += pv -#seq_DIR = $(SNCSEQ_LIB) -#pv_DIR = $(SNCSEQ_LIB) + +_APPNAME__LIBS += $(EPICS_BASE_IOC_LIBRARIES) #The following builds sncExample as a standalone application #PROD_HOST += sncExample #sncExample_SNCFLAGS += +m #sncExample_SRCS += sncExample.stt -#seq_DIR = $(SNCSEQ_LIB) -#pv_DIR = $(SNCSEQ_LIB) #sncExample_LIBS += seq #sncExample_LIBS += pv -#sncExample_LIBS += iocsh -#sncExample_LIBS += miscIoc -#sncExample_LIBS += rsrvIoc -#sncExample_LIBS += dbtoolsIoc -#sncExample_LIBS += asIoc -#sncExample_LIBS += dbIoc -#sncExample_LIBS += registryIoc -#sncExample_LIBS += dbStaticIoc -#sncExample_LIBS += ca -#sncExample_LIBS += Com - -# Use win32 object libs for registered support -_APPNAME__LIBS_win32 += recIocObj -_APPNAME__LIBS_win32 += softDevIocObj -_APPNAME__LIBS_win32 += testDevIocObj -_APPNAME__LIBS_DEFAULT += recIoc -_APPNAME__LIBS_DEFAULT += softDevIoc -_APPNAME__LIBS_DEFAULT += testDevIoc - -_APPNAME__LIBS += iocsh -_APPNAME__LIBS += miscIoc -_APPNAME__LIBS += rsrvIoc -_APPNAME__LIBS += dbtoolsIoc -_APPNAME__LIBS += asIoc -_APPNAME__LIBS += dbIoc -_APPNAME__LIBS += registryIoc -_APPNAME__LIBS += dbStaticIoc -_APPNAME__LIBS += ca -_APPNAME__LIBS += Com +#sncExample_LIBS += $(EPICS_BASE_IOC_LIBRARIES) #=========================== diff --git a/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c b/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c index 23c9bb35f..9a1dd87ba 100644 --- a/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c +++ b/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c @@ -15,11 +15,13 @@ #include "devSup.h" #include "link.h" #include "xxxRecord.h" +#define epicsExportSharedSymbols +#include "shareLib.h" /*Create the dset for devXxxSoft */ static long init_record(); static long read_xxx(); -struct { +epicsShareExtern struct { long number; DEVSUPFUN report; DEVSUPFUN init; diff --git a/src/makeBaseApp/top/exampleApp/src/xxxRecord.c b/src/makeBaseApp/top/exampleApp/src/xxxRecord.c index 557496c32..a9def0c45 100644 --- a/src/makeBaseApp/top/exampleApp/src/xxxRecord.c +++ b/src/makeBaseApp/top/exampleApp/src/xxxRecord.c @@ -16,6 +16,7 @@ #include "errMdef.h" #include "recSup.h" #include "special.h" +#define epicsExportSharedSymbols #define GEN_SIZE_OFFSET #include "xxxRecord.h" #undef GEN_SIZE_OFFSET @@ -39,7 +40,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset xxxRSET={ +epicsShareDef struct rset xxxRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/Makefile b/src/rec/Makefile index c66f79e63..0bc2f172a 100644 --- a/src/rec/Makefile +++ b/src/rec/Makefile @@ -10,8 +10,6 @@ TOP=../.. include $(TOP)/configure/CONFIG -SHARED_LIBRARIES = NO - INC += egDefs.h INC += erDefs.h INC += ereventDefs.h @@ -84,6 +82,8 @@ LIBSRCS += waveformRecord.c LIBRARY_IOC += recIoc +recIoc_LIBS = dbStaticIoc registryIoc asIoc dbIoc ca Com + # For R3.13 compatability OBJS_vxWorks = $(LIBSRCS:%.c=%) diff --git a/src/rec/aaiRecord.c b/src/rec/aaiRecord.c index 493e8d3b4..60ea2ac71 100644 --- a/src/rec/aaiRecord.c +++ b/src/rec/aaiRecord.c @@ -39,6 +39,7 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols #define GEN_SIZE_OFFSET #include "aaiRecord.h" #undef GEN_SIZE_OFFSET @@ -62,7 +63,7 @@ static long get_graphic_double(); static long get_control_double(); #define get_alarm_double NULL -struct rset aaiRSET={ +epicsShareDef struct rset aaiRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/aaoRecord.c b/src/rec/aaoRecord.c index ca88fbe0a..8c4615956 100644 --- a/src/rec/aaoRecord.c +++ b/src/rec/aaoRecord.c @@ -39,6 +39,7 @@ #include "devSup.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols #define GEN_SIZE_OFFSET #include "aaoRecord.h" #undef GEN_SIZE_OFFSET @@ -62,7 +63,7 @@ static long get_graphic_double(); static long get_control_double(); #define get_alarm_double NULL -struct rset aaoRSET={ +epicsShareDef struct rset aaoRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/aiRecord.c b/src/rec/aiRecord.c index eaf6a3176..5ac3988c8 100644 --- a/src/rec/aiRecord.c +++ b/src/rec/aiRecord.c @@ -36,6 +36,7 @@ #include "recGbl.h" #include "special.h" #include "menuConvert.h" +#define epicsExportSharedSymbols #define GEN_SIZE_OFFSET #include "aiRecord.h" #undef GEN_SIZE_OFFSET @@ -59,7 +60,9 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset aiRSET={ +epicsShareDef int jbaint=88l; + +epicsShareDef struct rset aiRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/aoRecord.c b/src/rec/aoRecord.c index 402933875..588f4b7d2 100644 --- a/src/rec/aoRecord.c +++ b/src/rec/aoRecord.c @@ -37,6 +37,7 @@ #include "recGbl.h" #include "menuConvert.h" #include "menuOmsl.h" +#define epicsExportSharedSymbols #define GEN_SIZE_OFFSET #include "aoRecord.h" #undef GEN_SIZE_OFFSET @@ -61,7 +62,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset aoRSET={ +epicsShareDef struct rset aoRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/biRecord.c b/src/rec/biRecord.c index f5a76b14f..ee7e9e258 100644 --- a/src/rec/biRecord.c +++ b/src/rec/biRecord.c @@ -35,6 +35,8 @@ #include "recSup.h" #include "recGbl.h" #include "special.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "biRecord.h" #undef GEN_SIZE_OFFSET @@ -56,7 +58,7 @@ static long put_enum_str(); #define get_graphic_double NULL #define get_control_double NULL #define get_alarm_double NULL -struct rset biRSET={ +epicsShareDef struct rset biRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/boRecord.c b/src/rec/boRecord.c index 6ec84b7b5..77a426ffd 100644 --- a/src/rec/boRecord.c +++ b/src/rec/boRecord.c @@ -35,6 +35,8 @@ #include "recSup.h" #include "recGbl.h" #include "special.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "boRecord.h" #undef GEN_SIZE_OFFSET @@ -60,7 +62,7 @@ static long put_enum_str(); #define get_control_double NULL #define get_alarm_double NULL -struct rset boRSET={ +epicsShareDef struct rset boRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/calcRecord.c b/src/rec/calcRecord.c index 04e88a492..0b476a737 100644 --- a/src/rec/calcRecord.c +++ b/src/rec/calcRecord.c @@ -34,6 +34,8 @@ #include "recSup.h" #include "recGbl.h" #include "special.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "calcRecord.h" #undef GEN_SIZE_OFFSET @@ -57,7 +59,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset calcRSET={ +epicsShareDef struct rset calcRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/calcoutRecord.c b/src/rec/calcoutRecord.c index b4080d64a..dc6be7efb 100644 --- a/src/rec/calcoutRecord.c +++ b/src/rec/calcoutRecord.c @@ -38,6 +38,8 @@ #include "taskwd.h" #include "postfix.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "calcoutRecord.h" #undef GEN_SIZE_OFFSET @@ -62,7 +64,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset calcoutRSET={ +epicsShareDef struct rset calcoutRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/compressRecord.c b/src/rec/compressRecord.c index 86e4c38f7..b762085f2 100644 --- a/src/rec/compressRecord.c +++ b/src/rec/compressRecord.c @@ -33,6 +33,8 @@ #include "special.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "compressRecord.h" #undef GEN_SIZE_OFFSET @@ -56,7 +58,7 @@ static long get_graphic_double(); static long get_control_double(); #define get_alarm_double NULL -struct rset compressRSET={ +epicsShareDef struct rset compressRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/dfanoutRecord.c b/src/rec/dfanoutRecord.c index 6de051292..d004c43db 100644 --- a/src/rec/dfanoutRecord.c +++ b/src/rec/dfanoutRecord.c @@ -39,6 +39,8 @@ #include "recGbl.h" #include "special.h" #include "menuOmsl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "dfanoutRecord.h" #undef GEN_SIZE_OFFSET @@ -62,7 +64,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset dfanoutRSET={ +epicsShareDef struct rset dfanoutRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/egRecord.c b/src/rec/egRecord.c index 0e6eedc37..255788ba4 100644 --- a/src/rec/egRecord.c +++ b/src/rec/egRecord.c @@ -30,6 +30,7 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols #define GEN_SIZE_OFFSET #include "egRecord.h" @@ -59,7 +60,7 @@ STATIC long EgProc(struct egRecord *); #define get_control_double NULL #define get_alarm_double NULL -struct rset egRSET={ +epicsShareDef struct rset egRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/egeventRecord.c b/src/rec/egeventRecord.c index d3db68c85..5f73bf841 100644 --- a/src/rec/egeventRecord.c +++ b/src/rec/egeventRecord.c @@ -30,6 +30,9 @@ #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + + #include "egRecord.h" #define GEN_SIZE_OFFSET #include "egeventRecord.h" @@ -59,7 +62,7 @@ static long get_graphic_double(struct dbAddr *paddr, struct dbr_grDouble *pgd); static long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd); static long get_alarm_double(struct dbAddr *paddr, struct dbr_alDouble *pad); -struct rset egeventRSET={ +epicsShareDef struct rset egeventRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/erRecord.c b/src/rec/erRecord.c index 95d398cd1..9de495a70 100644 --- a/src/rec/erRecord.c +++ b/src/rec/erRecord.c @@ -31,6 +31,8 @@ #include "recGbl.h" #include "erDefs.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "erRecord.h" #undef GEN_SIZE_OFFSET @@ -58,7 +60,7 @@ static long get_graphic_double(struct dbAddr *paddr, struct dbr_grDouble *pgd); static long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd); static long get_alarm_double(struct dbAddr *paddr, struct dbr_alDouble *pad); -struct rset erRSET={ +epicsShareDef struct rset erRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/ereventRecord.c b/src/rec/ereventRecord.c index ebd83bfe4..243653315 100644 --- a/src/rec/ereventRecord.c +++ b/src/rec/ereventRecord.c @@ -31,6 +31,8 @@ #include "recGbl.h" #include "ereventDefs.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "ereventRecord.h" #undef GEN_SIZE_OFFSET @@ -58,7 +60,7 @@ STATIC long ErEventProc(struct ereventRecord *); #define get_control_double NULL #define get_alarm_double NULL -struct rset ereventRSET={ +epicsShareDef struct rset ereventRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/eventRecord.c b/src/rec/eventRecord.c index 5d473fea8..07616608a 100644 --- a/src/rec/eventRecord.c +++ b/src/rec/eventRecord.c @@ -33,6 +33,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "eventRecord.h" #undef GEN_SIZE_OFFSET @@ -56,7 +58,7 @@ static long get_value(); #define get_control_double NULL #define get_alarm_double NULL -struct rset eventRSET={ +epicsShareDef struct rset eventRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/fanoutRecord.c b/src/rec/fanoutRecord.c index b4a866f70..6fce37eeb 100644 --- a/src/rec/fanoutRecord.c +++ b/src/rec/fanoutRecord.c @@ -30,6 +30,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "fanoutRecord.h" #undef GEN_SIZE_OFFSET @@ -54,7 +56,7 @@ static long process(); #define get_control_double NULL #define get_alarm_double NULL -struct rset fanoutRSET={ +epicsShareDef struct rset fanoutRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/histogramRecord.c b/src/rec/histogramRecord.c index 5871ea17a..018b581d3 100644 --- a/src/rec/histogramRecord.c +++ b/src/rec/histogramRecord.c @@ -37,6 +37,8 @@ #include "special.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "histogramRecord.h" #undef GEN_SIZE_OFFSET @@ -60,7 +62,7 @@ static long get_precision(struct dbAddr *paddr,long *precision); static long get_graphic_double(struct dbAddr *paddr,struct dbr_grDouble *pgd); static long get_control_double(struct dbAddr *paddr,struct dbr_ctrlDouble *pcd); -struct rset histogramRSET={ +epicsShareDef struct rset histogramRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/longinRecord.c b/src/rec/longinRecord.c index ecea9b887..c15d0acec 100644 --- a/src/rec/longinRecord.c +++ b/src/rec/longinRecord.c @@ -32,6 +32,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "longinRecord.h" #undef GEN_SIZE_OFFSET @@ -55,7 +57,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset longinRSET={ +epicsShareDef struct rset longinRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/longoutRecord.c b/src/rec/longoutRecord.c index b10639d9c..892a4b3cf 100644 --- a/src/rec/longoutRecord.c +++ b/src/rec/longoutRecord.c @@ -29,6 +29,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "longoutRecord.h" #undef GEN_SIZE_OFFSET @@ -54,7 +56,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset longoutRSET={ +epicsShareDef struct rset longoutRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/mbbiDirectRecord.c b/src/rec/mbbiDirectRecord.c index ad7846c42..27c9f097a 100644 --- a/src/rec/mbbiDirectRecord.c +++ b/src/rec/mbbiDirectRecord.c @@ -35,6 +35,8 @@ #include "recSup.h" #include "recGbl.h" #include "special.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "mbbiDirectRecord.h" #undef GEN_SIZE_OFFSET @@ -58,7 +60,7 @@ static long process(); #define get_control_double NULL #define get_alarm_double NULL -struct rset mbbiDirectRSET={ +epicsShareDef struct rset mbbiDirectRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/mbbiRecord.c b/src/rec/mbbiRecord.c index ac9cbfd49..6bc1c00ec 100644 --- a/src/rec/mbbiRecord.c +++ b/src/rec/mbbiRecord.c @@ -32,6 +32,8 @@ #include "recSup.h" #include "recGbl.h" #include "special.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "mbbiRecord.h" #undef GEN_SIZE_OFFSET @@ -53,7 +55,7 @@ static long put_enum_str(); #define get_graphic_double NULL #define get_control_double NULL #define get_alarm_double NULL -struct rset mbbiRSET={ +epicsShareDef struct rset mbbiRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/mbboDirectRecord.c b/src/rec/mbboDirectRecord.c index e2c249c30..d7c717f44 100644 --- a/src/rec/mbboDirectRecord.c +++ b/src/rec/mbboDirectRecord.c @@ -34,6 +34,8 @@ #include "recSup.h" #include "recGbl.h" #include "special.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "mbboDirectRecord.h" #undef GEN_SIZE_OFFSET @@ -59,7 +61,7 @@ static long special(); #define get_control_double NULL #define get_alarm_double NULL -struct rset mbboDirectRSET={ +epicsShareDef struct rset mbboDirectRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/mbboRecord.c b/src/rec/mbboRecord.c index 8bf718eda..6e6a4f4ee 100644 --- a/src/rec/mbboRecord.c +++ b/src/rec/mbboRecord.c @@ -34,6 +34,8 @@ #include "recSup.h" #include "recGbl.h" #include "special.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "mbboRecord.h" #undef GEN_SIZE_OFFSET @@ -59,7 +61,7 @@ static long put_enum_str(); #define get_control_double NULL #define get_alarm_double NULL -struct rset mbboRSET={ +epicsShareDef struct rset mbboRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/permissiveRecord.c b/src/rec/permissiveRecord.c index 120eb2780..a9dc3e251 100644 --- a/src/rec/permissiveRecord.c +++ b/src/rec/permissiveRecord.c @@ -31,6 +31,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "permissiveRecord.h" #undef GEN_SIZE_OFFSET @@ -54,7 +56,7 @@ static long process(); #define get_control_double NULL #define get_alarm_double NULL -struct rset permissiveRSET={ +epicsShareDef struct rset permissiveRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/selRecord.c b/src/rec/selRecord.c index b4549c9ac..a199a088a 100644 --- a/src/rec/selRecord.c +++ b/src/rec/selRecord.c @@ -32,6 +32,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "selRecord.h" #undef GEN_SIZE_OFFSET @@ -55,7 +57,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset selRSET={ +epicsShareDef struct rset selRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/seqRecord.c b/src/rec/seqRecord.c index bf1f80407..f1b646fcf 100644 --- a/src/rec/seqRecord.c +++ b/src/rec/seqRecord.c @@ -32,6 +32,8 @@ #include "special.h" #include "callback.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "seqRecord.h" #undef GEN_SIZE_OFFSET @@ -42,7 +44,7 @@ int seqRecDebug = 0; static long init_record(), process(), asyncFinish(), get_precision(); static void processCallback(); -struct rset seqRSET={ +epicsShareDef struct rset seqRSET={ RSETNUMBER, NULL, /* report */ NULL, /* initialize */ diff --git a/src/rec/stateRecord.c b/src/rec/stateRecord.c index 9d1c4f819..82ba7e95d 100644 --- a/src/rec/stateRecord.c +++ b/src/rec/stateRecord.c @@ -32,6 +32,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "stateRecord.h" #undef GEN_SIZE_OFFSET @@ -55,7 +57,7 @@ static long process(); #define get_control_double NULL #define get_alarm_double NULL -struct rset stateRSET={ +epicsShareDef struct rset stateRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/stringinRecord.c b/src/rec/stringinRecord.c index aa2ecb52a..fbf00f52a 100644 --- a/src/rec/stringinRecord.c +++ b/src/rec/stringinRecord.c @@ -33,6 +33,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "stringinRecord.h" #undef GEN_SIZE_OFFSET @@ -56,7 +58,7 @@ static long process(); #define get_control_double NULL #define get_alarm_double NULL -struct rset stringinRSET={ +epicsShareDef struct rset stringinRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/stringoutRecord.c b/src/rec/stringoutRecord.c index 8c423054f..98c2becff 100644 --- a/src/rec/stringoutRecord.c +++ b/src/rec/stringoutRecord.c @@ -33,6 +33,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "stringoutRecord.h" #undef GEN_SIZE_OFFSET @@ -58,7 +60,7 @@ static long process(); #define get_control_double NULL #define get_alarm_double NULL -struct rset stringoutRSET={ +epicsShareDef struct rset stringoutRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/subArrayRecord.c b/src/rec/subArrayRecord.c index d9e5628a8..6ec99da6a 100644 --- a/src/rec/subArrayRecord.c +++ b/src/rec/subArrayRecord.c @@ -35,6 +35,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "subArrayRecord.h" #undef GEN_SIZE_OFFSET @@ -58,7 +60,7 @@ static long get_graphic_double(); static long get_control_double(); #define get_alarm_double NULL -struct rset subArrayRSET={ +epicsShareDef struct rset subArrayRSET={ RSETNUMBER, report, initialize, diff --git a/src/rec/subRecord.c b/src/rec/subRecord.c index fc363445f..d106e4ba2 100644 --- a/src/rec/subRecord.c +++ b/src/rec/subRecord.c @@ -36,6 +36,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "subRecord.h" #undef GEN_SIZE_OFFSET @@ -59,7 +61,7 @@ static long get_graphic_double(); static long get_control_double(); static long get_alarm_double(); -struct rset subRSET={ +epicsShareDef struct rset subRSET={ RSETNUMBER, report, initialize, @@ -85,7 +87,7 @@ static long fetch_values(); static void monitor(); #define ARG_MAX 12 -typedef long (*SUBFUNCPTR)(); +typedef long (epicsShareAPI *SUBFUNCPTR)(); static long init_record(psub,pass) struct subRecord *psub; diff --git a/src/rec/waveformRecord.c b/src/rec/waveformRecord.c index cc092683d..76f495337 100644 --- a/src/rec/waveformRecord.c +++ b/src/rec/waveformRecord.c @@ -34,6 +34,8 @@ #include "errMdef.h" #include "recSup.h" #include "recGbl.h" +#define epicsExportSharedSymbols + #define GEN_SIZE_OFFSET #include "waveformRecord.h" #undef GEN_SIZE_OFFSET @@ -55,7 +57,7 @@ static long get_precision(); static long get_graphic_double(); static long get_control_double(); #define get_alarm_double NULL -struct rset waveformRSET={ +epicsShareDef struct rset waveformRSET={ RSETNUMBER, report, initialize, diff --git a/src/registry/registerRecordDeviceDriver.pl b/src/registry/registerRecordDeviceDriver.pl index 247d3933f..ac8e3d7e5 100755 --- a/src/registry/registerRecordDeviceDriver.pl +++ b/src/registry/registerRecordDeviceDriver.pl @@ -61,16 +61,23 @@ print << "END" ; #include "registryDriverSupport.h" #include "registryFunction.h" #include "iocsh.h" +#include "shareLib.h" END #definitions for recordtype if($numberRecordType>0) { + print "#ifdef __cplusplus\n"; + print "extern \"C\" {\n"; + print "#endif\n"; for ($i=0; $i<$numberRecordType; $i++) { - print "extern \"C\" struct rset $recordType[$i]RSET;\n"; - print "extern \"C\" int $recordType[$i]RecordSizeOffset(dbRecordType *pdbRecordType);\n"; + print "epicsShareExtern struct rset $recordType[$i]RSET;\n"; + print "epicsShareFunc int epicsShareAPI $recordType[$i]RecordSizeOffset(dbRecordType *pdbRecordType);\n"; #NOTE the following caused a compiler error on vxWorks # print "extern computeSizeOffset $recordType[$i]RecordSizeOffset;\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]\""; @@ -90,9 +97,15 @@ 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 "extern \"C\" struct dset $deviceSupport[$i];\n"; + 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]\""; @@ -112,9 +125,15 @@ 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 "extern \"C\" struct drvet $driverSupport[$i];\n"; + 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]\""; diff --git a/src/registry/registryRecordType.h b/src/registry/registryRecordType.h index 25e668eb2..57de804e0 100644 --- a/src/registry/registryRecordType.h +++ b/src/registry/registryRecordType.h @@ -20,8 +20,7 @@ struct dbRecordType; struct rset; struct dbBase; -typedef int (*computeSizeOffset)(struct dbRecordType *pdbRecordType); - +typedef int (epicsShareAPI *computeSizeOffset)(struct dbRecordType *pdbRecordType); typedef struct recordTypeLocation { struct rset *prset;