cpu_family(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– cpu_family(3) πŸ’–

okay bestie, so this is a page from the Allegro manual β€” the Allegro game programming library, no cap β€” and today we're talking about cpu_family(3), aka the little variable that knows what kinda brain your processor has. it's giving "who am I" but for silicon. let's go πŸ¦‹


✨ NAME ✨

cpu_family β€” contains the CPU type. part of the Allegro game programming library, obviously πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

extern int cpu_family;

literally that's it. one #include, one extern int. iconic behaviour.


πŸŽ€ DESCRIPTION πŸŽ€

so cpu_family holds the Intel type, where applicable. and Allegro has these whole CPU family types defined for you, bestie, here's the full roster β€” every single one, don't skip:

  • CPU_FAMILY_UNKNOWN β€” the type of processor is unknown (mystery machine energy, we don't know her πŸ™ˆ)
  • CPU_FAMILY_I386 β€” the processor is an Intel-compatible 386
  • CPU_FAMILY_I486 β€” the processor is an Intel-compatible 486
  • CPU_FAMILY_I586 β€” the processor is a Pentium or equivalent
  • CPU_FAMILY_I686 β€” the processor is a Pentium Pro, II, III or equivalent
  • CPU_FAMILY_ITANIUM β€” the processor is an Itanium processor
  • CPU_FAMILY_POWERPC β€” the processor is a PowerPC processor
  • CPU_FAMILY_EXTENDED β€” the processor type needs to be read from the cpu_model πŸ‘€
⚠️ important queen: you can only read this variable after you've called check_cpu(). and good news β€” check_cpu() is automatically called by allegro_init(), so if you did the init thing you're already covered. don't read it before, it will not have your back fr fr 😭

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie, you ate it πŸ’… this was Allegro, version 4.4.3 β€” cpu_family(3), the CPU-type lore, delivered with love from the Allegro manual. go read your cpu's mind, but only after check_cpu(). periodt πŸ«Άβœ¨πŸŒΈπŸ’–

πŸ“¦ where this page comes from