Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: epicsExport.h on Windows
From: Michael Davidsaver <mdavidsaver@gmail.com>
To: Ralph Lange <ralph.lange@gmx.de>, EPICS Core Talk <core-talk@aps.anl.gov>
Date: Tue, 21 Mar 2017 09:15:58 -0400
extern "C" is always needed for export from C++ due to name mangling.  I
don't think there is anything windows/msvc specific here.

The first definition is never used and imo. should be removed.

>> extern statements in epicsExport.h are ignored by VS compiler

They are not ignored.  They just don't have the same effect. 'extern'
and 'extern "C"' behave differently despite using the same keyword.


On 03/21/2017 08:16 AM, Ralph Lange wrote:
> Dear Core-Talkers,
> 
> For a device support partly written in C++, we have been getting a pull
> request for Windows builds that adds extern "C" declarations around
> EPICS exports, e.g.
> 
>     -epicsExportAddress(double, connectInterval);
>     +extern "C" {
>     +    epicsExportAddress(double, connectInterval);
>     +}
> 
> 
> with the comment
> 
>     I am afraid that the extern statements in epicsExport.h are ignored
>     by VS compiler when expanding the epicsRegisterFunction macro.
>     Therefore they need to be repeated here otherwise we get a linking
>     failure when building test IOC.
> 
> 
> As my Windows experience is very limited - is there a better way to
> handle that?
> 
> Thanks,
> ~Ralph


Replies:
RE: epicsExport.h on Windows Mark Rivers
References:
epicsExport.h on Windows Ralph Lange

Navigate by Date:
Prev: RE: epicsExport.h on Windows Mark Rivers
Next: RE: epicsExport.h on Windows Mark Rivers
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: RE: epicsExport.h on Windows Mark Rivers
Next: RE: epicsExport.h on Windows Mark Rivers
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 21 Mar 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·