I have code I try to compile on 64 bit MacOS with clang.
#include <cstdint>
int main(){
static_assert(std::is_same<long, int64_t>::value, "");
}
I did some checks and both long and int64_t are signed integers and sizeof() reports they are 8 byte long.
Both types must be same type, however, when I check with typeid().name() gives result "l" for long and "x" for int64_t.
Whats going on here?
How to rewrite static_assert so it will be portable between 64 bit Linux and 64 bit MacOS?
Update
I think the proposed duplicate is not answering my question.
I checked "stdint.h" on MacOS, and it mention 40, 48 and 56 bit integers too. I believe it is related to that, since pointer distance_type on the MacOS is "long".
Please reopen :)