VC6 cannot handle template class typedef of a template class with the same name (in a different namespace)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7047 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2018-11-07 16:58:43 +00:00
parent 3c6821f214
commit 5b09b32668
9 changed files with 10 additions and 22 deletions

View file

@ -1334,4 +1334,3 @@ void SetCompressor(NCOMPRESSOR compressor)
ResetObjects();
}
}

View file

@ -1135,4 +1135,4 @@ void EnableUICommand(UINT Id, INT_PTR Enabled)
{
EnableToolBarButton(Id, !!Enabled);
EnableMenuItem(g_sdata.menu, Id, Enabled ? MF_ENABLED : MF_GRAYED);
}
}

View file

@ -35,13 +35,7 @@ struct group
TCHAR *name;
};
// Jim Park: Moved this array from inside the func to the outside. While it
// was probably "safe" for this array to be inside because the strings are in
// the .data section and so the pointer to the string returned is probably
// safe, this is a bad practice to have as that's making an assumption on what
// the compiler will do. Besides which, other types of data returned would
// actually fail as the local vars would be popped off the stack.
struct group groups[] =
static const struct group groups[] =
{
{DOMAIN_ALIAS_RID_USERS, _T("User")},
// every user belongs to the users group, hence users come before guests

View file

@ -1097,9 +1097,9 @@ FORCEINLINE BOOL NoDepr_GetVersionExW(OSVERSIONINFOW*p) { __pragma(warning(push)
#ifdef __cplusplus
namespace STLHelpers
namespace STL
{
template<class M> struct mapped_type_helper { typedef typename M::value_type::second_type type; }; // VC6 uses referent_type and not mapped_type
template<class M> struct mapped_type { typedef typename M::value_type::second_type type; }; // VC6 uses referent_type and not mapped_type
}
#endif //~ __cplusplus

View file

@ -266,7 +266,7 @@ bool Plugins::IsPluginCallSyntax(const tstring& token)
struct PrintPluginDirsHelper {
template<class C> static void print(const C&c, const char*indent = "")
{
std::/*unordered_*/set<typename STLHelpers::mapped_type_helper<C>::type
std::/*unordered_*/set<NSIS_CXX_TYPENAME STL::mapped_type<C>::type
#ifdef _WIN32
, Plugins::strnocasecmp
#endif

View file

@ -22,7 +22,7 @@
#include <set>
#include "tstring.h"
namespace STLHelpers
namespace STL
{
template<class S, class C>
struct string_nocasecmpless : std::binary_function<S, S, bool>
@ -44,7 +44,7 @@ namespace STLHelpers
class Plugins
{
public:
typedef STLHelpers::string_nocasecmpless<tstring, tstring::value_type> strnocasecmp;
typedef STL::string_nocasecmpless<tstring, tstring::value_type> strnocasecmp;
Plugins() : m_initialized(false) {}

View file

@ -170,14 +170,13 @@ namespace MakensisAPI {
#define FLAG_OFFSET(flag) (FIELD_OFFSET(exec_flags_t, flag)/sizeof(int))
class DiagState {
template<class M> struct mapped_type_helper { typedef typename STLHelpers::mapped_type_helper<M>::type type; };
template<class C, class K, class V> void insert_or_assign(C&c, const K&k, V val)
{
typename C::value_type item(k, val);
std::pair<NSIS_CXX_TYPENAME C::iterator, bool> ret = c.insert(item);
if (!ret.second) ret.first->second = val;
}
template<class C, class K> typename mapped_type_helper<C>::type get_paired_value(const C&c, const K&k, typename mapped_type_helper<C>::type defval) const
template<class C, class K> typename STL::mapped_type<C>::type get_paired_value(const C&c, const K&k, typename STL::mapped_type<C>::type defval) const
{
typename C::const_iterator it = c.find(k);
return c.end() == it ? defval : it->second;

View file

@ -2291,18 +2291,14 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
manifest_sosl.deleteall();
if (2 == line.getnumtokens())
{
switch(line.gettoken_enum(1,_T("none\0all\0")))
{
case 0: return PS_OK;
case 1: return manifest_sosl.addall() ? PS_OK : PS_ERROR;
}
}
for(int argi = 1; argi < line.getnumtokens(); ++argi)
{
if (!manifest_sosl.append(line.gettoken_str(argi)))
PRINTHELP();
}
}
return PS_OK;
case TOK_MANIFEST_DISABLEWINDOWFILTERING:

View file

@ -1010,8 +1010,8 @@ int CEXEBuild::pp_define(LineParser&line)
int CEXEBuild::pp_undef(LineParser&line)
{
UINT noerr = false, stopswitch = false, ti = 1, handled = 0;
for (; ti < line.getnumtokens(); ++ti)
UINT noerr = false, stopswitch = false, handled = 0;
for (int ti = 1; ti < line.getnumtokens(); ++ti)
{
const TCHAR *name = line.gettoken_str(ti);
if (!stopswitch && !_tcsicmp(name, _T("/noerrors")))