-
Notifications
You must be signed in to change notification settings - Fork 2
Add support for castxml and MSVC #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
17c1272
51e1aab
909e5d0
8e81b7b
392d816
d7bf39f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
|
||
// Visual C++ for-loop scoping hack. We can use this inside the CABLE | ||
// application without interfering with user code. | ||
#ifdef _MSC_VER | ||
#if defined(_MSC_VER) && _MSC_VER < 1700 | ||
#ifndef for | ||
#define for if(false) {} else for | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was back from the VS 6 days ( |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -579,6 +579,14 @@ bool XMLSourceParser::SetupNamed(XMLSourceElement* element, Named* named) | |
{ | ||
named->SetName("{anonymous-constructor}"); | ||
} | ||
else if (Destructor::SafeDownCast(named)) | ||
{ | ||
named->SetName("{anonymous-destructor}"); | ||
} | ||
else if (Converter::SafeDownCast(named)) | ||
{ | ||
named->SetName("{operator}"); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please match the existing indentation scheme (2 spaces instead of a TAB). |
||
else | ||
{ | ||
cableErrorMacro("No name on Named object " << named->GetNameOfClass()); | ||
|
@@ -700,13 +708,24 @@ bool XMLSourceParser::SetupFunctionType(XMLSourceElement* element, | |
XMLSourceElement* argElement = element->GetNestedElement(i); | ||
if(String(argElement->GetName()) == "Argument") | ||
{ | ||
const char* typeId = argElement->GetAttribute("type"); | ||
if(!typeId) | ||
{ | ||
cableErrorMacro("No type attribute on Argument " << i << " in " | ||
<< element->GetName() << " " << element->GetId()); | ||
return false; | ||
} | ||
const char* typeId; | ||
const char* originaltypeId = argElement->GetAttribute("original_type"); | ||
if (originaltypeId) | ||
{ | ||
//when arrays and functions decay to a pointer type, then swap the type for the original | ||
typeId = originaltypeId; | ||
} | ||
else | ||
{ | ||
typeId = argElement->GetAttribute("type"); | ||
if (!typeId) | ||
{ | ||
cableErrorMacro("No type attribute on Argument " << i << " in " | ||
<< element->GetName() << " " << element->GetId()); | ||
return false; | ||
} | ||
} | ||
|
||
Type* argType = this->GetTypeFromId(typeId); | ||
if(!argType) | ||
{ | ||
|
@@ -1348,9 +1367,15 @@ SourceObject* XMLSourceParser::AddMethod(XMLSourceElement* element) | |
bool isStatic = false; | ||
bool isVirtual = false; | ||
bool isPureVirtual = false; | ||
bool isOverride = false; | ||
|
||
const char* virtualAttr = element->GetAttribute("virtual"); | ||
if(virtualAttr && (String(virtualAttr) == "1")) { isVirtual = true; } | ||
if (isVirtual) | ||
{ | ||
const char* overridesAttr = element->GetAttribute("overrides"); | ||
if (overridesAttr && (String(overridesAttr) != "")) { isOverride = true; } | ||
} | ||
const char* pureVirtualAttr = element->GetAttribute("pure_virtual"); | ||
if(pureVirtualAttr && (String(pureVirtualAttr) == "1")) { isPureVirtual = true; } | ||
|
||
|
@@ -1381,6 +1406,7 @@ SourceObject* XMLSourceParser::AddMethod(XMLSourceElement* element) | |
m->SetStatic(isStatic); | ||
m->SetVirtual(isVirtual); | ||
m->SetPureVirtual(isPureVirtual); | ||
m->SetOverride(isOverride); | ||
|
||
// Add the FunctionType element with a dummy id. | ||
String fid = element->GetId(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was back from the VS 6 days (
_MSC_VER < 1300
). We can drop the whole block.