I am trying to come up with a method for defining absolute (MMIO) addresses once in my universal .h file. DATAACT id defined in one .c file only UX* is xdata unsigned char My attempt:
#ifdef DATACT #define UXRG(name,addr) UX8 name _at_ addr; #else #define UXRG(name,addr) extern UX8 name; #endif used as UXRG (XRleds, 0xff00);
You say you need to change that trick for the case of _at_ --- but I don't see any reasons why you think it wouldn't just work, as it is. I'm not entirely positive on this (read: I haven't actually tried it), but as far as I can see, for an _at_ definition, the whole point of the separation between definition and declaration is moot anyway. I.e. I'd just have
type var _at_ addr;