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>
2018
2019
2020
2021
2022
2023
2024
- 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>
2018
2019
2020
2021
2022
2023
2024
|