aka-demik / superobject

Automatically exported from https://code.google.com/p/superobject/
0 stars 1 forks source link

Compile with BDS2006 brings trouble due to wrong header conversion (Keyword "this" is used in source) #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start Borland Developer Studio 2006
2. Create Project, add superobject.pas and superxmlparser.pas
3. Use it in the source, like

TSuperObject *obj = new TSuperObject(__classid(TSuperObject));

What is the expected output? What do you see instead?

Expected: Compiling without problems.
Instead: Compile error, missing close bracket ")".

What version of the product are you using? On what operating system?
BDS2006, Windows Vista Business, 32bit.

Please provide any additional information below.

The problem happens due to "wrong" conversion/creation of the
superobject.hpp file which is auto-created due to compilation.

The problematic code happens here when the word "this" is used:
------------------------------------------------------------------
    /*         class method */ static _di_ISuperObject __fastcall
ParseString(TMetaClass* vmt, WideChar * s, bool strict, bool partial =
true, const _di_ISuperObject thisIsMe = (void *)(0x0), TSuperFindOptions
options = Set<TSuperFindOption, foCreatePath, foCallMethod> () , const
_di_ISuperObject put = (void *)(0x0), TSuperType dt = (TSuperType)(0x0));
    /*         class method */ static _di_ISuperObject __fastcall
ParseStream(TMetaClass* vmt, Classes::TStream* stream, bool strict, bool
partial = true, const _di_ISuperObject thisIsMe = (void *)(0x0),
TSuperFindOptions options = Set<TSuperFindOption, foCreatePath,
foCallMethod> () , const _di_ISuperObject put = (void *)(0x0), TSuperType
dt = (TSuperType)(0x0));
    /*         class method */ static _di_ISuperObject __fastcall
ParseFile(TMetaClass* vmt, const AnsiString FileName, bool strict, bool
partial = true, const _di_ISuperObject thisIsMe = (void *)(0x0),
TSuperFindOptions options = Set<TSuperFindOption, foCreatePath,
foCallMethod> () , const _di_ISuperObject put = (void *)(0x0), TSuperType
dt = (TSuperType)(0x0));
    /*         class method */ static _di_ISuperObject __fastcall
ParseEx(TMetaClass* vmt, TSuperTokenizer* tok, WideChar * str, int len,
bool strict, const _di_ISuperObject thisIsMe = (void *)(0x0),
TSuperFindOptions options = Set<TSuperFindOption, foCreatePath,
foCallMethod> () , const _di_ISuperObject put = (void *)(0x0), TSuperType
dt = (TSuperType)(0x0));

---------------------------------------

Search for:
const _di_ISuperObject this = (void *)(0x0)

in the lines.

That stuff brakes compilation. Possible reason: "this" is a reserved
keyword in c++.
Please rename every word "this" to something different, like "thisIsMe" or
something like that. I tried that for the 4 functions ParseString,
ParseStream, ParseFile and ParseEx. 

I attached a "fixed" Version which compiles also on BDS2006/C++ Builder.

Original issue reported on code.google.com by terminar on 27 May 2010 at 5:44

Attachments:

GoogleCodeExporter commented 9 years ago
please help with BC++ please example in BC++

thank you

Original comment by radomi...@gmail.com on 7 Apr 2011 at 11:20