This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

CDL define_proc: Unable to put "extern" in an include files


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]