Re: [avr-gcc-list] C Preprocessor question

2005-09-11 Thread Dave Hylands
Hi Richard, > Another possibility to play with: > > #define mymacro (foo, somenumber) \ > struct {Fifo fifo; uint8_t buf[somenumber]} foo;\ > const uint8_t *foo##ptr = (uint8_t*)&foo; const uint8_t *foo; uint8_t const *foo; both create a pointer to a constant uint8_t. You can modify foo (i.e.

Re: [avr-gcc-list] C Preprocessor question

2005-09-11 Thread Richard Urwin
On Sunday 11 Sep 2005 01:17, Larry Barello wrote: > Can I define a macro that defines some stuff? I cannot get the > following to work > > #define mymacro(foo, somenumber) \ > #define foo (*(pFifo)foo##bar) \ > Static uint8_t foo##bar[somenumber + sizeof(Fifo)] > > The goal (maybe there is a better

[avr-gcc-list] C Preprocessor question

2005-09-10 Thread Larry Barello
Can I define a macro that defines some stuff? I cannot get the following to work #define mymacro(foo, somenumber) \ #define foo (*(pFifo)foo##bar) \ Static uint8_t foo##bar[somenumber + sizeof(Fifo)] The goal (maybe there is a better way...) is to have a variable length buffer with some defined s