From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8398 invoked by alias); 30 May 2007 17:58:30 -0000 Received: (qmail 8344 invoked by uid 22791); 30 May 2007 17:58:29 -0000 X-Spam-Check-By: sourceware.org Received: from mail.cipher.com (HELO cipher.com) (198.107.56.73) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 May 2007 17:58:25 +0000 Received: from [10.0.0.98] ([10.0.0.98]) by cipher.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 May 2007 10:58:22 -0700 Message-ID: <465DBB45.3070802@cipher.com> Date: Wed, 30 May 2007 18:04:00 -0000 From: Jim Seymour User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] CDL define_proc: Unable to put "extern" in an include files X-SW-Source: 2007-05/txt/msg00185.txt.bz2 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