Hi,
On Wednesday 26 July 2006 06:00, [EMAIL PROTECTED] wrote:
> Dear listers,
>
> I thank you all for your responses.
>
> I have resolved my original problem. Now I am happily compiling using
> modular feature and make the best of it.
[...]
>     SYS.H
>     =====
>     #ifndef SYS_H
>     #define SYS_H
>      #ifdef SYS_C
>       volatile unsigned int  vTICKS;           // system ticks
>       volatile unsigned char vTIMEOUT;         // system timeout flag
>      #else
>       extern volatile unsigned int  vTICKS;           // system ticks
>       extern volatile unsigned char vTIMEOUT;         // system timeout
> flag #endif /* SYS_C */
>     #endif /* SYS_H */

Just out of curiosity: Why don't you do that the "usual" way?

SYS.H:
 #ifndef SYS_H
 #define SYS_H
    extern void somefunction(void);
    extern volatile unsigned int  vTICKS;
 #endif

SYS.C:
  #include "sys.h"
  void somefunction(void) {
  }
  volatile unsigned int  vTICKS;

...?

You can have as many "extern" forward declarations for a single 
variable/function as you want in a compilation unit, as long as there's only 
one actual "implementation" for it, that is one decl without "extern".

Greetings,
/Ernst

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to