Comments (8)
Related to epics-modules/sscan#3 which will have a pull request soon.
from mca.
How does EPICS 3.15.4 define epicsShareAPI? It seems like it would be simpler to fix the problem in base than in all of synApps? These are the occurances of the string epicsShareAPI in my synApps tree in .h files:
corvette:~/devel>find_ . -name "*.h" -exec grep -H epicsShareAPI {} \;
./seq-2-2-3/include/seqCom.h:epicsShareFunc void epicsShareAPI seqShow(epicsThreadId);
./seq-2-2-3/include/seqCom.h:epicsShareFunc void epicsShareAPI seqChanShow(epicsThreadId, const char *);
./seq-2-2-3/include/seqCom.h:epicsShareFunc void epicsShareAPI seqcar(int level);
./seq-2-2-3/include/seqCom.h:epicsShareFunc void epicsShareAPI seqQueueShow(epicsThreadId);
./seq-2-2-3/include/seqCom.h:epicsShareFunc void epicsShareAPI seqStop(epicsThreadId);
./seq-2-2-3/include/seqCom.h:epicsShareFunc epicsThreadId epicsShareAPI seq(seqProgram *, const char *, unsigned);
./seq-2-2-3/src/seq/seqCom.h:epicsShareFunc void epicsShareAPI seqShow(epicsThreadId);
./seq-2-2-3/src/seq/seqCom.h:epicsShareFunc void epicsShareAPI seqChanShow(epicsThreadId, const char *);
./seq-2-2-3/src/seq/seqCom.h:epicsShareFunc void epicsShareAPI seqcar(int level);
./seq-2-2-3/src/seq/seqCom.h:epicsShareFunc void epicsShareAPI seqQueueShow(epicsThreadId);
./seq-2-2-3/src/seq/seqCom.h:epicsShareFunc void epicsShareAPI seqStop(epicsThreadId);
./seq-2-2-3/src/seq/seqCom.h:epicsShareFunc epicsThreadId epicsShareAPI seq(seqProgram *, const char *, unsigned);
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkAddInput(recDynLink *precDynLink,char *pvname,
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkAddOutput(recDynLink *precDynLink,char *pvname,
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkClear(recDynLink *precDynLink);
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkConnectionStatus(recDynLink *precDynLink);
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetNelem(recDynLink *precDynLink,size_t *nelem);
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetControlLimits(recDynLink *precDynLink,
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetGraphicLimits(recDynLink *precDynLink,
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetPrecision(recDynLink *precDynLink,int *prec);
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetUnits(recDynLink *precDynLink,char *units,int maxlen);
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGet(recDynLink *precDynLink, void *pbuffer, size_t *nRequest,
./sscan-2-10-2/include/recDynLink.h:long epicsShareAPI recDynLinkGetCallback(recDynLink *precDynLink, size_t *nRequest, recDynCallback userGetCallback);
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkPut(recDynLink *precDynLink,void *pbuffer,size_t nRequest);
./sscan-2-10-2/include/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkPutCallback(recDynLink *precDynLink,void *pbuffer,size_t nRequest, recDynCallback notifyCallback);
./sscan-2-10-2/include/recDynLink.h:int epicsShareAPI recDynLinkCheckReadWriteAccess(recDynLink *precDynLink);
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkAddInput(recDynLink *precDynLink,char *pvname,
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkAddOutput(recDynLink *precDynLink,char *pvname,
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkClear(recDynLink *precDynLink);
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkConnectionStatus(recDynLink *precDynLink);
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetNelem(recDynLink *precDynLink,size_t *nelem);
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetControlLimits(recDynLink *precDynLink,
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetGraphicLimits(recDynLink *precDynLink,
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetPrecision(recDynLink *precDynLink,int *prec);
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGetUnits(recDynLink *precDynLink,char *units,int maxlen);
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkGet(recDynLink *precDynLink, void *pbuffer, size_t *nRequest,
./sscan-2-10-2/sscanApp/src/recDynLink.h:long epicsShareAPI recDynLinkGetCallback(recDynLink *precDynLink, size_t *nRequest, recDynCallback userGetCallback);
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkPut(recDynLink *precDynLink,void *pbuffer,size_t nRequest);
./sscan-2-10-2/sscanApp/src/recDynLink.h:epicsShareFunc long epicsShareAPI recDynLinkPutCallback(recDynLink *precDynLink,void *pbuffer,size_t nRequest, recDynCallback notifyCallback);
./sscan-2-10-2/sscanApp/src/recDynLink.h:int epicsShareAPI recDynLinkCheckReadWriteAccess(recDynLink *precDynLink);
And .c* files
./stream-2-6c/streamDevice/src/StreamEpics.cc:epicsShareFunc int epicsShareAPI iocshCmd(const char *command);
./seq-2-2-3/src/seq/seq_task.c:epicsShareFunc void epicsShareAPI seqStop(epicsThreadId tid)
./seq-2-2-3/src/seq/seq_qry.c:epicsShareFunc void epicsShareAPI seqShow(epicsThreadId tid)
./seq-2-2-3/src/seq/seq_qry.c:epicsShareFunc void epicsShareAPI seqChanShow(epicsThreadId tid, const char *str)
./seq-2-2-3/src/seq/seq_qry.c:epicsShareFunc void epicsShareAPI seqcar(int level)
./seq-2-2-3/src/seq/seq_qry.c:epicsShareFunc void epicsShareAPI seqQueueShow(epicsThreadId tid)
./seq-2-2-3/src/seq/seq_main.c:epicsShareFunc epicsThreadId epicsShareAPI seq(
./sscan-2-10-2/sscanApp/src/recDynLink.c:epicsShareFunc long epicsShareAPI dbNameToAddr(const char *pname,struct dbAddr *);
./sscan-2-10-2/sscanApp/src/recDynLink.c:int epicsShareAPI recDynLinkCheckReadWriteAccess(recDynLink *precDynLink) {
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkAddInput(recDynLink *precDynLink,char *pvname,
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkAddOutput(recDynLink *precDynLink,char *pvname,
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkClear(recDynLink *precDynLink)
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkConnectionStatus(recDynLink *precDynLink)
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkGetNelem(recDynLink *precDynLink,size_t *nelem)
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkGetControlLimits(recDynLink *precDynLink,
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkGetGraphicLimits(recDynLink *precDynLink,
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkGetPrecision(recDynLink *precDynLink,int *prec)
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkGetUnits(recDynLink *precDynLink,char *units,int maxlen)
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkGet(recDynLink *precDynLink,void *pbuffer,size_t *nRequest,
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkGetCallback(recDynLink *precDynLink, size_t *nRequest,
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkPut(recDynLink *precDynLink,void *pbuffer,size_t nRequest)
./sscan-2-10-2/sscanApp/src/recDynLink.c:long epicsShareAPI recDynLinkPutCallback(recDynLink *precDynLink,void *pbuffer,size_t nRequest,
./ipac-2-13/drvIpac/drvTvme200.c:static void epicsShareAPI tvme200Registrar(void) {
./ipac-2-13/drvIpac/drvHyLinuxCarrier.c:static void epicsShareAPI HyLinux9010Registrar(void) {
./ipac-2-13/drvIpac/drvIpMv162.c:static void epicsShareAPI mv162ipRegistrar(void) {
./ipac-2-13/drvIpac/drvXy9660.c:static void epicsShareAPI xy9660Registrar(void) {
./ipac-2-13/drvIpac/drvVipc616.c:static void epicsShareAPI vipc616Registrar(void) {
./ipac-2-13/drvIpac/drvHyLinuxCarrier.c.orig:static void epicsShareAPI HyLinux9010Registrar(void) {
./ipac-2-13/drvIpac/drvVipc310.c:static void epicsShareAPI vipc310Registrar(void) {
./ipac-2-13/drvIpac/drvVipc610.c:static void epicsShareAPI vipc610Registrar(void) {
./ipac-2-13/drvIpac/drvAtc40.c:static void epicsShareAPI atc40Registrar(void) {
./ipac-2-13/drvIpac/drvHy8002.c:static void epicsShareAPI Hy8002Registrar(void) {
from mca.
The definition epicsShareAPI hasn't changed for the Windows architectures. What has changed is that the epicsShareAPI calls have been removed from everything in base except libCom and ca.
The "Changes between 3.14.x and 3.15.0.1" section of the base 3.15.4 release notes has this bullet point under the "Reworked the epicsEvent C & C++ APIs" item:
* Win32: Removed all epicsShareAPI decorations
I don't understand why this was done. Maybe @anjohnson can enlighten us.
from mca.
Tim fixed the problem in the sscan module, so this error should go away if I update sscan and rebuild:
sscan.lib(recDynLink.obj) : error LNK2001: unresolved external symbol _dbNameToAddr@8
from mca.
epicsShareAPI
tells the MS compiler to use a different subroutine calling convention for this routine. This was necessary with earlier versions of the Microsoft tools; it actually requests the Pascal calling convention, which queues subroutine arguments on the stack in the reverse order and doesn't support C's variable argument feature at all. For example at one point Visual Basic could only make calls to DLLs using that calling convention, so it was important for EPICS client application support that the libCom and CA APIs at least make use of this.
For C code calling C code the result is slightly less efficient though, and there was never really a need to use it on our internal interfaces, but I think people got used to adding it anyway because they didn't understand what it was for. I removed it from many internal interfaces in the 3.15 development time-frame.
from mca.
The epicsShareAPI defines the function linkage to be __stdcall. It changes the stack cleanup on function calls so the callee does the cleanup, rather than the caller. It is really only needed for functions that are going to be called from other languages like Visual Basic, IDL, etc. that may use the stdcall convention. It is really only Com and ca that are likely to be called from such languages. IDL uses stdcall by default, but there is a /cdecl flag to call_external that allows specifying that the DLL uses _cdecl rather than __stdcall. Python has a similar mechanism to specify what calling convention the DLL uses.
I think this is a reasonable change to simplify the code needed 99% of the time.
The only reason it is a problem in recDynLink.c is that Tim is using a function defined in EPICS base (dbNaemToAddr) but which is not designed to be exported by any header file in base. So he needed to define it in recDynLink.c, which leads to future compatibility issues if the definition in base changes.
My previous post about other occurences of epicsShareAPI in synApps is wrong. Those will not be a problem, because epicsShareAPI is still supported, its use is just discouraged.
from mca.
For completeness, recDynLink defines dbNameToAddr by hand because it uses both database access and channel access, which have conflicting definitions (e.g., DBR_GR_LONG). Because it #includes db_access.h, recDynLink can't also include dbAccessDefs.h, in which dbNameToAddr is defined.
from mca.
Tim fixed sscan. Anyone building mca with base-3.15.4 should use epics-modules/sscan@07cc4d2 or later. This issue can be closed.
from mca.
Related Issues (12)
- Test issue
- IOC errors for Amptek DP5G devices HOT 16
- DP5G HV value taken from status packet HOT 1
- Amptek USB driver fails to connect HOT 2
- Can't control multiple Amptek via USB on single IOC HOT 2
- Another test issue
- make error reported:Can't find 'scalerSupport.dbd' HOT 2
- make error:'getNumParams' was not declared in this scope HOT 2
- iocAmptek HOT 11
- $(P)PresetReal defined twice in SIS38XX.template HOT 1
- mcaCanberra, mcaAIM, and nmcDemo are built unconditionally on OS X HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mca.