_countof and swprintf fixes for VC6
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6045 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
34395604e8
commit
82d42b1159
13 changed files with 68 additions and 74 deletions
|
@ -27,22 +27,17 @@ int GetTLBVersion(tstring& filepath, DWORD& high, DWORD & low)
|
|||
{
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifndef _countof
|
||||
#ifndef __cplusplus
|
||||
#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
|
||||
#ifdef _countof
|
||||
#define COUNTOF _countof
|
||||
#else
|
||||
extern "C++" {
|
||||
template <typename _CountofType,size_t _SizeOfArray> char (*__countof_helper(UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
|
||||
#define _countof(_Array) sizeof(*__countof_helper(_Array))
|
||||
}
|
||||
#endif
|
||||
#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
|
||||
#endif
|
||||
|
||||
int found = 0;
|
||||
|
||||
TCHAR fullpath[1024];
|
||||
TCHAR *p;
|
||||
if (!GetFullPathName(filepath.c_str(), _countof(fullpath), fullpath, &p))
|
||||
if (!GetFullPathName(filepath.c_str(), COUNTOF(fullpath), fullpath, &p))
|
||||
return 0;
|
||||
|
||||
ITypeLib* typeLib;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue