EPICS Controls 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  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Different behavior on dbdToRecordTypeH - include guard
From: "Kim, Kukhee" <[email protected]>
To: Andrew Johnson <[email protected]>, "[email protected] Talk" <[email protected]>
Date: Thu, 11 Dec 2014 01:19:58 +0000
Hi Andrew,

Thank you for your advice.
I will follow your advice.

Best regards,
Kukhee
--------------------------------------------
Kukhee Kim
SLAC National Accelerator Laboratory
2575 Sand Hill Rd, MS 64
Menlo Park, CA 94025
Email: [email protected]
Phone: (650)926-4912
Fax:   (650)926-3800


-----Original Message-----
From: Andrew Johnson [mailto:[email protected]] 
Sent: Wednesday, December 10, 2014 4:01 PM
To: Kim, Kukhee; [email protected] Talk
Subject: Re: Different behavior on dbdToRecordTypeH - include guard

Hi Kukhee,

On 12/10/2014 05:26 PM, Kim, Kukhee wrote:
> Some of my DBD files which define new record type, have the include 
> statements to bring other DBD files (netsting other DBD).
> Usually, the nesting DBD has new menu types.
> Previous tool puts the include guard for each "typedef" statements, 
> but the new one doesn't do.

Ahh, menu definitions in record types, now I understand your problem: In
3.14 each menu got a separate include guard in the generated *Record.h file, e.g. the aoRecord.h file starts with:

> #ifndef INCaoOIFH
> #define INCaoOIFH
> typedef enum {
> 	aoOIF_Full,
> 	aoOIF_Incremental
> }aoOIF;
> #endif /*INCaoOIFH*/
> #ifndef INCaoH
> #define INCaoH
> #include "epicsTypes.h"

Note that if you tried to create a menu named 'ao' in the aoRecord.dbd file the include guard generated for the menu would prevent you from loading the record type since the names would be the same.

> It brings me duplicated declaration issue when I try to compile 
> existing code for the new epics base.
> I can change my side to avoid it, but we also need to think about 
> backward compatibility.

You should not include your external *Menu.dbd file from within your *Record.dbd file. Either keep it as a separate file (which must still be loaded by the IOCs) or move the menu definition into the Record.dbd file entirely (and rename the menu, the usual convention is for record-specific menus to be named beginning with the name of the record type, such as the menu aoOIF shown above). That solution can be made to compile for both versions of Base.

HTH,

- Andrew
--
People everywhere confuse what they read in newspapers with news.
-- A. J. Liebling


References:
Different behavior on dbdToRecordTypeH - include guard Kim, Kukhee
Re: Different behavior on dbdToRecordTypeH - include guard Andrew Johnson
RE: Different behavior on dbdToRecordTypeH - include guard Kim, Kukhee
Re: Different behavior on dbdToRecordTypeH - include guard Andrew Johnson

Navigate by Date:
Prev: Re: Different behavior on dbdToRecordTypeH - include guard Andrew Johnson
Next: Changing the Timeout for drvAsynSerialPort? Franklin Fuller
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Different behavior on dbdToRecordTypeH - include guard Andrew Johnson
Next: EPICS V4 Vikram Bhagat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·