mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
cpp: Fixed for stdlibc++ from GCC 4.9
git-svn-id: svn://ultimatepp.org/upp/trunk@9004 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
15aa8b430b
commit
6063771495
2 changed files with 73 additions and 45 deletions
|
|
@ -404,57 +404,62 @@ void Parser::CheckKey(int c)
|
|||
|
||||
String Parser::TemplateParams(String& param)
|
||||
{
|
||||
const char *pos = lex.Pos();
|
||||
CheckKey('<');
|
||||
int level = 1;
|
||||
String id;
|
||||
bool gp = true;
|
||||
while(lex != t_eof) {
|
||||
if(lex.IsId() && gp)
|
||||
id = lex.GetId();
|
||||
else
|
||||
if(Key(',')) {
|
||||
ScAdd(param, id);
|
||||
id.Clear();
|
||||
gp = true;
|
||||
}
|
||||
else
|
||||
if(Key('=')) {
|
||||
if(!id.IsEmpty()) {
|
||||
String r;
|
||||
do {
|
||||
const char *pos = lex.Pos();
|
||||
CheckKey('<');
|
||||
int level = 1;
|
||||
String id;
|
||||
bool gp = true;
|
||||
while(lex != t_eof) {
|
||||
if(lex.IsId() && gp)
|
||||
id = lex.GetId();
|
||||
else
|
||||
if(Key(',')) {
|
||||
ScAdd(param, id);
|
||||
id.Clear();
|
||||
gp = true;
|
||||
}
|
||||
gp = false;
|
||||
}
|
||||
else
|
||||
if(Key('>')) {
|
||||
level--;
|
||||
if(level <= 0) {
|
||||
ScAdd(param, id);
|
||||
break;
|
||||
else
|
||||
if(Key('=')) {
|
||||
if(!id.IsEmpty()) {
|
||||
ScAdd(param, id);
|
||||
id.Clear();
|
||||
}
|
||||
gp = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(Key(t_shr) && level >= 2) {
|
||||
level -= 2;
|
||||
if(level <= 0) {
|
||||
ScAdd(param, id);
|
||||
break;
|
||||
else
|
||||
if(Key('>')) {
|
||||
level--;
|
||||
if(level <= 0) {
|
||||
ScAdd(param, id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(Key(t_shr) && level >= 2) {
|
||||
level -= 2;
|
||||
if(level <= 0) {
|
||||
ScAdd(param, id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(Key('<'))
|
||||
level++;
|
||||
else
|
||||
if(Key('('))
|
||||
level++;
|
||||
else
|
||||
if(Key(')'))
|
||||
level--;
|
||||
else
|
||||
++lex;
|
||||
}
|
||||
else
|
||||
if(Key('<'))
|
||||
level++;
|
||||
else
|
||||
if(Key('('))
|
||||
level++;
|
||||
else
|
||||
if(Key(')'))
|
||||
level--;
|
||||
else
|
||||
++lex;
|
||||
MergeWith(r, ",", String(pos, lex.Pos()));
|
||||
}
|
||||
return String(pos, lex.Pos());
|
||||
while(Key(tk_template));
|
||||
return r;
|
||||
}
|
||||
|
||||
String Parser::TemplateParams()
|
||||
|
|
@ -1576,6 +1581,16 @@ void Parser::Do()
|
|||
if(Key(';')) // 'empty' declaration, result of some ignores
|
||||
;
|
||||
else
|
||||
if(lex == tk_extern && lex[1] == tk_template) { // skip 'extern template void Foo<char>();'
|
||||
while(lex != t_eof) {
|
||||
if(lex == ';') {
|
||||
++lex;
|
||||
break;
|
||||
}
|
||||
++lex;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(Key(tk_extern) && lex == t_string) { // extern "C++" kind
|
||||
++lex;
|
||||
DoNamespace();
|
||||
|
|
|
|||
|
|
@ -133,7 +133,20 @@ String AndroidNDK::GetCppIncludeDir(const String& cppRuntime) const
|
|||
// TODO: implement selection of library version
|
||||
String versionsDir = nest + "gnu-libstdc++";
|
||||
|
||||
return nest + "gnu-libstdc++" + DIR_SEPS + "4.9" + DIR_SEPS + "include";
|
||||
FindFile ff(nest + "gnu-libstdc++/*.*");
|
||||
String inc;
|
||||
double ver = 0;
|
||||
while(ff) {
|
||||
if(ff.IsFolder()) {
|
||||
double h = atof(ff.GetName());
|
||||
if(h > ver) {
|
||||
ver = h;
|
||||
inc = ff.GetPath();
|
||||
}
|
||||
}
|
||||
ff.Next();
|
||||
}
|
||||
return inc + '/' + "include";
|
||||
}
|
||||
else
|
||||
if(cppRuntime.StartsWith("c++")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue