From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30326 invoked by alias); 31 May 2007 21:07:37 -0000 Received: (qmail 30318 invoked by uid 22791); 31 May 2007 21:07:36 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 31 May 2007 21:07:34 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1Htrrf-0007ti-00; Thu, 31 May 2007 23:07:23 +0200 Date: Thu, 31 May 2007 21:44:00 -0000 To: Jim Seymour Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20070531210723.GB5944@lunn.ch> Mail-Followup-To: Jim Seymour , ecos-discuss@ecos.sourceware.org References: <465DBB45.3070802@cipher.com> <20070530181445.GE32489@lunn.ch> <465F1B6E.4090007@cipher.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <465F1B6E.4090007@cipher.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn 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: Re: [ECOS] CDL define_proc: Unable to put "extern" in an include files X-SW-Source: 2007-05/txt/msg00222.txt.bz2 > >Take a look at the output of: > > > >gcc -v -E -dD empty.c > >gcc -v -E -dD empty.cpp > > > >and see if there is something defined when compiling real code which > >is not defined when using CPP for building the .ld file etc. Then use > >#ifdef so that the extern is only present for real code generation > >compilation. > > If I'm understanding you here, it sounds like I want some way for the > preprocessor to detect the presence of the -E option. No, that is not what i was meaning. However i did a little testing, and what i was suggesting does not work:-( When gcc calls cpp for a C++ file, the symbol __cplusplus is defined. When gcc calls cpp for a C file the symbol __STDC__ is defined. I was hoping that if you call cpp without telling which language it is, it would not define/define some other symbol. You can then #ifdef on that. Unfortunately, if not told otherwise cpp defaults to plain old C. May you are attacking the problem from the wrong end. Could the extern be placed somewhere else? Code which is using the symbol CYGNUM_HAL_RTC_PERIOD probably has include hal_platform_ints.h or plf_io.h. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss