I do not argue with you, I have understood that it is impossible after very few first posts, so I have just hardcoded the constants needed
const
UI_SET_EVBIT = $40045564;
UI_SET_KEYBIT = $40045565;
UI_DEV_CREATE = $00005501;
UI_DEV_DESTROY = $00005502;
UI_DEV_SETUP = $405C5503;
But.
When one says "it is very simple" and "for real programmer", it sounds like a challenge.
I just want him to show the muscles.
That's certainly one way of doing it, but you're at risk of getting screwed by changes in word size etc.: I speak from experience.
Look, I agree that Pascal's got a deficiency here. However in the case of FPC it's something that's baked in at a fairly low level: use the forum search facility to find previous discussion of parameterised macros and you'll find an explanation of e.g. why it's not really realistic for the compiler- as implemented- to call an external macro processor (there have been some written for Pascal, but they're pretty weird).
However the bottom line is that if you want to work at that level, the only really robust way to do it is to work in C: and not just any old C, but the same C that's being used to build the kernel. Saying that risks making me unpopular with certain other members of the community but it's a fact, and it's why so many low-level libraries are provided as an integral part of a Linux distro rather than being built on an ad-hoc basis.
Rust, IMO and provided that I understand things correctly, gets it more or less right: provide one kind of macro for text substitution (which is what C tries to do), and another for parameterised substitution where the type of each parameter must be defined in terms of the implementation of the language (i.e. a parameter can be a block of code, but it has to be a consistent and balanced block of code).
MarkMLl