Detecting if computer has <cstdint> types

Jul 16, 2014 at 12:00am
I'm trying to read byte-by-byte data. If my understanding is correct, not all computers support the types defined in http://www.cplusplus.com/reference/cstdint/.

What is the most pleasant way, if any, for the program to be able to detect at run-time if the computer it's being run on does not support these types? Or does it not matter once it's successfully compiled (As in, I would compile the program on my computer, but my friend, or anyone else using the same OS, might want to use the program too if we are both using it for the same goal)?
Last edited on Jul 16, 2014 at 12:02am
Jul 16, 2014 at 12:23am
Remember that types exist only at compile time. As far as cstdint is concerned, if the program compiles for the target architecture, it'll run on any particular instance of that architecture. If an architecture doesn't support the types in cstdint, you'll just get compiler errors when you try to target that architecture.

In any case, the architectures that don't support cstdint are quite exotic and rare nowadays. You're unlikely to ever stumble upon them, and you certainly won't find them on the desktop of an end user. I'm talking about 12-bit machines and similar abortions of technology. Legacy software is the only reason they still exist.
Jul 16, 2014 at 1:44am
Thanks for clearing that up.
Topic archived. No new replies allowed.