public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] CDL define_proc: Unable to put "extern" in an include files
@ 2007-05-30 18:04 Jim Seymour
  2007-05-30 19:02 ` Andrew Lunn
  2007-06-01  8:54 ` Nick Garnett
  0 siblings, 2 replies; 6+ messages in thread
From: Jim Seymour @ 2007-05-30 18:04 UTC (permalink / raw)
  To: ecos-discuss

I have a desire to inject an "extern" statement into an include file
generated by one of our CDL files - so I added a "define_proc" block.

Worked like a champ - until the build got to the rule to create
"heapgeninc.tcl" out of heapgen.cpp.

This file is run through the preprocessor and the output is then fed to
Tcl.  My "extern" statement is passed through the preprocessor intact,
so when it gets to Tcl, I get this error:

    invalid command name "extern"

The same problem exists when the target.ld file is built.  My "extern"
statement gets stuffed into that file, so ld fails with a "parse error".

I fixed both problems with a horrible kludge: adding a #define to
heapgen.cpp and then bracketing my extern with a #ifndef.  However, I
hate changing standard eCos files unless it's absolutely necessary.

Anyone know how (or if) I can safely add an "extern" to the generated
include files?

Going back a step...

What I'm trying to do is allow for our system clock speed to be a
run-time variable, instead of a fixed constant.  This means that the
#define's that get generated for CYGNUM_RTC_PERIOD (and the like) will
refer to a global variable.  Without an "extern" statement, these
references will cause a compiler error.

-- 
Jim Seymour, Cipher Systems, Inc., http://www.cipher.com


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-01  8:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-30 18:04 [ECOS] CDL define_proc: Unable to put "extern" in an include files Jim Seymour
2007-05-30 19:02 ` Andrew Lunn
2007-05-31 19:43   ` Jim Seymour
2007-05-31 21:44     ` Andrew Lunn
2007-05-31 22:20       ` Jim Seymour
2007-06-01  8:54 ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).