
19 May
2007
19 May
'07
12:32 a.m.
On 5/10/07, Wolfgang Denk wd@denx.de wrote:
+#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
gd->jt[XF_do_protect] = (void *) do_protect;
gd->jt[XF_do_flerase] = (void *) do_flerase;
+#endif }
This #ifdef maze is too much even for my standards. And that does mean something.
Is there anybody out there with an idea how to avoid that?
The cond_syscall() macro in the Linux kernel might be worth stealing. How about something like this?
#define cond_extern(name) asm(".weak\t" #name "\n\t.set\t" #name ", unimpl_extern")
static int unimpl_extern(void) { return -ENOSYS; /* or something more appropriate */ }
cond_extern(do_protect); cond_extern(do_flerase);
Haavard