cpu_vendor(3)

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

✨ cpu_vendor(3) ✨ β€” the Allegro manual πŸ’–

okay bestie, gather round, because this one is a tiny little global variable with main character energy and i am obsessed. it's part of the Allegro game programming library, and it's basically your CPU's little name tag at the function-call party. πŸŽ€


NAME πŸ¦‹

cpu_vendor β€” contains the CPU vendor name, fr fr. Allegro game programming library energy. πŸ’…


SYNOPSIS 🌸

#include <allegro.h>

extern char cpu_vendor[];

like, that's it. that's the whole vibe. two lines and a dream. ✨


DESCRIPTION πŸ‘‘

so here's the tea, bestie πŸ«–:

  • On Intel PCs, this lil variable contains the CPU vendor name if known. (emphasis on if known, she's not gonna make stuff up for you πŸ™ˆ)
  • On Mac OSX systems, this contains the PPC subtype name. iconic platform-specific behaviour, we love to see it. πŸ’–
  • On other platforms, this may be an empty string. not every CPU wants to introduce itself, and that's valid. πŸ’€

and the important part β€” the when:

You can read this variable after you have called check_cpu() (which is automatically called by allegro_init()).

so like, don't go reading cpu_vendor before allegro_init() has done its thing, because you'll be reading uninitialised chaos and that is not the vibe check you want. call allegro_init() first, then read away. periodt. πŸ’…


SEE ALSO 🌈

the whole friend group, obviously:

go read check_cpu(3) next if you wanna know who actually fills this variable in. iykyk. 🧚


mwah πŸ’‹ that's the page! this little cutie comes to you from Allegro, version 4.4.3 β€” thanks for reading, bestie, now go initialise something. πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from