From: Danny S. <dan...@cl...> - 2004-03-20 06:55:56
|
Any ideas on a macro name and constants for distinguishing different runtime libraries (msvcrt vs msvcr70 bs msvcr71); I have some structures & function prototypes to be added to headers but would like to guard with something like: Set default in _mingw.h #ifndef __MSVCRT_VER__ # define __MSVCRT_VER__ 0x0600 #endif then in, eg, io.h /* These require newer versions of msvcrt.dll (6.1 or higher). */ #if __MSVCRT_VER__ >= 0x0601 /* dont confuse this with _finddatai64 struct __finddata64_t { unsigned attrib; __time64_t time_create; __time64_t time_access; __time64_t time_write; _fsize_t size; char name[260]; }; intptr_t __cdecl _findfirst64(const char*, struct __finddata64_t*); etc. Question is, should we (1) use the 0x0601 MAKEWORD type of constant to have the high byte contain the major version and low byte the minor, like _WIN32_IE and friends or do something simpler like #if __MSVCRT_VER__ >= 61 or 3) explicitly use major and minor versions in tests. #if (__MSVCRT_VER_MAJOR__ > 6 \ || ( __MSVCRT_VER_MAJOR__ == 6 \ && __MSVCRT_VER_MINOR__ >= 1) I prefer 1 or 2 since it makes easy for user to overide the default. Danny |