[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Patch: shel_write() did not call the PureC patcher



Eero Tamminen wrote:

> Hi,
>
> On keskiviikko 21 maaliskuu 2012, Jo Even Skarstein wrote:
> > Coldfire: Programs compiled with PureC is now patched also when launched
> > with XaAES shel_write().
>
> Btw. why the external prototype is define in the C-file instead
> of some common header?
>
> I would also suggest using something similar as what Linux kernel does
> to make code cleaner:
> ----header-----
> #ifdef COLDFIRE
> extern void   patch_memset_purec(BASEPAGE *b);
> #else
> #define patch_memset_purec(b)
> #endif
> ----c-files----
>     patch_memset_purec(b);
> ---------------
>
> This way the ifdef stuff is localized to appropriate headers and
> C-files are clean.

I don't agree, when the #if is inside the code it's easy to see that it does nothing when COLDFIRE is not defined,
else you whould have to tag to the definition first.

But the prototype belongs into a header, that't true.

-Helmut