I have a .cpp file that I'd like to use in many projects. It uses
some dsp/bios objects, so I'd like to have something like this: #include "projectnamecfg.h" in the file, where projectnamecfg would be filled in by some preprocessor directive. Is there a way to do this? Can I create a second CDB file and only put the stuff in it? TIA, Carl Chipman Carl Chipman Nomadics, Inc. http://www.nomadics.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.313 / Virus Database: 174 - Release Date: 1/2/2002 |
|
Stupid include question.
Started by ●January 11, 2002
Reply by ●January 14, 20022002-01-14
Yeah, but having 50 of the #ifdef PROJECT1 #include "project1.cfg" etc at the top of a file is pretty darn silly. Carl Chipman Nomadics, Inc. http://www.nomadics.com > -----Original Message----- > From: Jeff Brower [mailto:] > Sent: Monday, January 14, 2002 7:47 AM > To: Carl Chipman > Cc: > Subject: Re: [c54x] Stupid include question. > > Carl- > > >I have a .cpp file that I'd like to use in many projects. It uses some > >dsp/bios objects, so I'd like to have something like this: > > > >#include "projectnamecfg.h" > > > >in the file, where projectnamecfg would be filled in by some > >preprocessor directive. Is there a way to do this? Can I create a > >second CDB file and only put the stuff in it? > > In my opinion, that seems fancy and not readable to the next engineer. I > would > never let my engineers do that. Why not try this: > > #ifdef PROJECT1 > #include "projectcfg1.h" > #elif PROJECT2 > #include "projectcfg2.h" > #elif PROJECT3 > #include "projectcfg3.h" > #endif > > Just because it's DSP code doesn't mean good software documentation > standards > should not be followed. Sorry to be such a manager this morning. ;-) > > Jeff Brower > DSP sw/hw engineer > Signalogic > > _____________________________________ > Note: If you do a simple "reply" with your email client, only the author > of this message will receive your answer. You need to do a "reply all" if > you want your answer to be distributed to the entire group. > > _____________________________________ > About this discussion group: > > To Join: Send an email to > > To Post: Send an email to > > To Leave: Send an email to > > Archives: http://www.yahoogroups.com/group/c54x > > Other Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.314 / Virus Database: 175 - Release Date: 1/11/2002 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.314 / Virus Database: 175 - Release Date: 1/11/2002 |
Reply by ●January 14, 20022002-01-14
Carl- >I have a .cpp file that I'd like to use in many projects. It uses some >dsp/bios objects, so I'd like to have something like this: > >#include "projectnamecfg.h" > >in the file, where projectnamecfg would be filled in by some >preprocessor directive. Is there a way to do this? Can I create a >second CDB file and only put the stuff in it? In my opinion, that seems fancy and not readable to the next engineer. I would never let my engineers do that. Why not try this: #ifdef PROJECT1 #include "projectcfg1.h" #elif PROJECT2 #include "projectcfg2.h" #elif PROJECT3 #include "projectcfg3.h" #endif Just because it's DSP code doesn't mean good software documentation standards should not be followed. Sorry to be such a manager this morning. ;-) Jeff Brower DSP sw/hw engineer Signalogic |
|