Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: Build of seq-2.1.15 with VS 2010 fails.
From: Benjamin Franksen <benjamin.franksen@helmholtz-berlin.de>
To: <tech-talk@aps.anl.gov>
Date: Thu, 19 Dec 2013 22:30:42 +0100
Am Donnerstag, 19. Dezember 2013, 12:40:52 schrieb Andrew Johnson:
> On 12/19/2013 11:40 AM, Mark Rivers wrote:
> [...] if
> seq-2.1.15 has added the variable to a header file that declaration must
> be marked with epicsShareExtern which on Windows expands to either
> 
> #define epicsShareExtern __declspec(dllexport) extern
> 
> or
> 
> #define epicsShareExtern __declspec(dllimport) extern
> 
> depending on whether the header is being included by a file that will be
> part of the same DLL as seq_if.c or must be imported from that DLL.
> 
> I guess Ben's issue might be that he has no header file declaring this
> variable, so the compiler never gets told whether it's going to be an
> import or an export. The solution should thus be to add a suitably
> decorated declaration of the variable to an appropriate header file.

Hi Andrew

thanks for your input. I intentionally did not declare the variable in a 
header file because it is a crude hack I added for the tests and was never 
meant for public consumption.

Peter Heesterman reported that adding epicsShareExtern inside the C file 
solves the build problem so that is what I did. The code in 2.1.16 slightly 
differs from his proposed fix because gcc gave a warning about initializing a 
variable that was declared extern, so the code is now:

  epicsShareExtern double seq_sync_timeout;
  double seq_sync_timeout = 10.0;

> I suspect that just marking the definition as epicsShareExtern in the
> seq_if.c file may cause problems later.

I hope not ;-) At least, it seems that currently __declspec(dllimport) is not 
really needed. If it turns out later that there are cases where it is needed, 
I will add the necessary annotation in the code where the variable is used 
(inside the tests).

Let me repeat: if you intend your programs to work with future releases of the 
sequencer, you should *not* use this variable. I may remove it without further 
notice. A proper fix for the issue of configuring the timeout for the SYNC 
variants of pvPut and pvGet will appear in version 2.2 of the sequencer.

Cheers
Ben

Attachment: signature.asc
Description: This is a digitally signed message part.


References:
RE: Build of seq-2.1.15 with VS 2010 fails. Mark Rivers
Re: Build of seq-2.1.15 with VS 2010 fails. Andrew Johnson

Navigate by Date:
Prev: Re: Build of seq-2.1.15 with VS 2010 fails. Andrew Johnson
Next: RE: Design strategies for CSS BOY screens tom.cobb
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: Build of seq-2.1.15 with VS 2010 fails. Andrew Johnson
Next: notification server Pearson, Matthew R.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·