I know that type "int" is not guaranteed to be a specific size, as well as all of the other primitives, but is there a quick and easy way to dynamically create custom data types that isn't going to break the program when switching to a non-standard platform?

For example, I like to define char, short, int, long int as int8, int16, int32, int64, respectively, and then only use the minimum type required for all possible values held in the variable (if I know the domain prior to defining it) to minimize wasted space. The problem lies in the fact that I may need a variable to hold 64 bits, and define it as int64, but this will be erroneous on a system that defines "long int" as only 32 bits.