Why I cannot qualify a aliased type with "unsigned"?

Viewed 637

I'm migrating my code from windows to Linux. There is no type named "__int64" on Linux, so I tried to define it myself with alias. My code is as follows:

#include <cstdint>

#if !defined(__int64)
typedef int64_t __int64;
#endif

int main(int argc, char** argv)
{
    unsigned __int64 ii64 = 0; // Error
    return 0;
};

When I compiled it, I got the following error:

main.cpp: In function ‘int main(int, char**)’: main.cpp:10:20: error: expected initializer before ‘ii64’

I know that I can replace "unsigned __int64" with "uint64_t" or defining a new type, but why the preceding code cannot be compiled?

4 Answers
Related