xserver icon indicating copy to clipboard operation
xserver copied to clipboard

config: untwist config backend prototypes

Open metux opened this issue 3 months ago • 3 comments

  • split the prototypes of individual backends into separate headers
  • always define the functions (possibly empty) to cut down ifdef wood

Signed-off-by: Enrico Weigelt, metux IT consult [email protected]

metux avatar Sep 09 '25 15:09 metux

I’m not sure about this. With the old code it was clear that only one config will be active. With this change I’m not sure what will happen if more than one of the “CONFIG_…” symbols are defined (could this happen in practice?).

algrid avatar Sep 09 '25 22:09 algrid

I’m not sure about this. With the old code it was clear that only one config will be active. With this change I’m not sure what will happen if more than one of the “CONFIG_…” symbols are defined (could this happen in practice?).

Same here and I am not sure why the #else branches were introduced. To my understanding this defines functions which maybe should not be defined and could turn compile time errors into runtime errors, no?

callmetango avatar Sep 20 '25 14:09 callmetango

Same here and I am not sure why the #else branches were introduced. To my understanding this defines functions which maybe should not be defined and could turn compile time errors into runtime errors, no?

See the removed #ifdef's at the call sites. The idea here is that callers don't need to explicitly care anymore - just the callees. It's a common practise, eg. also used in the Linux kernel, in order to move config dependencies out of the callees.

metux avatar Nov 26 '25 17:11 metux