Original Post
🔒 Locked
long long
Advertisement
long long isn''t a part of C++, it''s a gcc addin. You can #ifdef for GCC in your code and use long long or __int64 depending on platform. Or since you''re using visual studio just ctrl-h all references before you submit it.
I don''t think there''s an easy way to perform a typedef with a space through any preprocessor.
I don''t think there''s an easy way to perform a typedef with a space through any preprocessor.
#if defined(_MSC_VER) || defined(__LCC__) || defined(__INTEL_COMPILER)
#if defined(WIN32)
typedef unsigned long DWORD;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned __int64 QWORD;
#include <basetsd.h>
#else
typedef unsigned __int8 BYTE;
typedef unsigned __int16 WORD;
typedef unsigned __int32 DWORD;
typedef unsigned __int64 QWORD;
typedef signed __int8 INT8;
typedef signed __int16 INT16;
typedef signed __int32 INT32;
typedef signed __int64 INT64;
typedef unsigned __int32 UINT32;
#endif
#elif defined(__GNUC__) || defined(__MWERKS__) || defined(__SUNPRO_C) || defined(__DMC__)
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned long long QWORD;
typedef signed char INT8;
typedef signed short INT16;
typedef signed int INT32;
typedef signed long long INT64;
typedef unsigned int UINT32;
#else
//im just guessing here! - these are not going to be right.
//#error Dont know word sizes for these machines/compilers
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef struct {DWORD a, b;} QWORD;
typedef signed char INT8;
typedef signed short INT16;
typedef signed int INT32;
typedef unsigned int UINT32;
#endif
there was a template solution on flipcode that ensured you got the correct sized integers iirc. Search for that.
[edited by - aboeing on November 25, 2003 11:23:43 PM]
If you need to guess for sizes, "unsigned int" is very likely 32 bits, and "unsigned long" can be 32 or 64, depending on programming model. The 16-bit model is luckily 10 years in the past for all but 0.001% of us :-)
(lp64 == long and pointer are 64 bits == The One True Way)
(lp64 == long and pointer are 64 bits == The One True Way)
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement