PICK_ARG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, this is PICK_ARG(9) from the Kernel API Manual, and the whole vibe is simple: it returns the n-th argument. periodt πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

the signature is literally right here, no cap:

PICK_ARG (n , args... );

🌸 ARGUMENTS 🌸

  • n β€” the argument number to be returned, bestie β€” like, which one you want back.
  • args β€” the arguments themselves. the whole squad.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this helper macro is lowkey here to manipulate the argument list before passing it to the next level macro. no cap, that's the whole job. πŸ’–

like COUNT_ARGS, this macro supports n up to 12. and the specialized macros PICK_ARG1 to PICK_ARG12 are also available β€” iconic, honestly. ✨

🌟 EXAMPLE 🌟

the page lays out the definitions like this (yes, literally):

#define foo     X,Y,Z,Q #define bar     PICK_ARG(2, foo) #define buz
PICK_ARG3(foo)

with the above definitions, bar expands to Y and buz expands to Z. slay. πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/gpu/drm/xe/xe_args.h β€” and the whole bestie squad, iykyk:


okay that's the page, bestie. this one comes from ./drivers/gpu/drm/xe and is dated October 2026 β€” mwah, bye 🫢✨

πŸ“¦ where this page comes from