On 2/27/07, Gareth <[EMAIL PROTECTED]> wrote:
This question may be more appropriate for tech@ but i thought i'd try here first just in case.lets say i have a bunch of #defines, for example (from sys/dev/wscons/wsconsio.h): /* Event type definitions. Comment for each is information in value. */ #define WSCONS_EVENT_KEY_UP 1 /* key code */ #define WSCONS_EVENT_KEY_DOWN 2 /* key code */ #define WSCONS_EVENT_ALL_KEYS_UP 3 /* void */ #define WSCONS_EVENT_MOUSE_UP 4 /* button # (leftmost = 0) */ #define WSCONS_EVENT_MOUSE_DOWN 5 /* button # (leftmost = 0) */ #define WSCONS_EVENT_MOUSE_DELTA_X 6 /* X delta amount */ #define WSCONS_EVENT_MOUSE_DELTA_Y 7 /* Y delta amount */ #define WSCONS_EVENT_MOUSE_ABSOLUTE_X 8 /* X location */ #define WSCONS_EVENT_MOUSE_ABSOLUTE_Y 9 /* Y location */ #define WSCONS_EVENT_MOUSE_DELTA_Z 10 /* Z delta amount */ #define WSCONS_EVENT_MOUSE_ABSOLUTE_Z 11 /* Z location */ /* * Following events are not real wscons_event but are used as parameters of the * WSDISPLAYIO_WSMOUSED ioctl */ #define WSCONS_EVENT_WSMOUSED_ON 12 /* wsmoused(8) active */ #define WSCONS_EVENT_WSMOUSED_OFF 13 /* wsmoused(8) inactive */ #define WSCONS_EVENT_WSMOUSED_SLEEP 14 /* wsmoused(8) sleeping */ #define WSCONS_EVENT_WSMOUSED_CLOSE 15 /* notify wsmoused(8) to close mouse device */ and I wanted to add some defines between WSCONS_EVENT_MOUSE_ABSOLUTE_Z and WSCONS_EVENT_WSMOUSED_ON, should i start them at 12 and change the definitions of the ones following,
Oh no, never do that. You would then be using different flags than code that is already compiled (using the original definitions). If you change this and then recompile *everything* you're safe, but only so long as you do that. It's not compatible outside of your world, so it's really just a bad idea.
or start them at 16?
This is the usual route taken, however why are you doing this? Mucking with kernel #defines is sort of priviliged, because everyone has to be kept in sync on them. -Nick

