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]

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


> >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


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