Overview
| Artifact ID: | e00e4ff3ab726438cbf9aa3f41b51acc587ab25e |
|---|---|
| Ticket: | 219224ffffffffffffffffffffffffffffffffff
expr and format comands should handle long long (int64) |
| User & Date: | hobbs on 2000-11-22 01:34:28 |
Changes
- icomment:
ANSI C (keyword *ANSI*) has 64 bit integer types as int64_t and uint64_t, but they aren't supported by all ANSI compilers - just those that want to provide 64bit int support. Windows has __int64. Where int64_t isn't yet supported, you might try simulating it with long long. An example that works on Windows, Linux (32-bit PIII) and Solaris (64-bit UltraSparc) is: <PRE> #ifdef _WIN32 #define int64_t __int64 #define uint64_t unsigned __int64 #else #include <sys/types.h> #endif #ifndef int64_t #define int64_t long long #define uint64_t unsigned long long #endif main() { uint64_t i = 0; printf("sizeof int64 = %d\n", sizeof(int64_t)); } </PRE> You can improve on that by actually checking along the way until you get an 8-byte wide integer type instead of making the assumptions. - login: "hobbs"
- mimetype: "text/plain"
- title changed to:
expr and format comands should handle long long (int64)
- username: "hobbs"