Re: Is KDe coming to Win32



Hans-Peter Diettrich wrote:
I wonder what would be needed for Delphi to "understand natively" code compiled by C++.

That's near impossible, as long as every C++ compiler can implement a different object model.

I don't mean to have it before someone writes a new compiler, but to interface with VC, GCC and obviously CG's own compilers.

> When the C++ code compiles in CBuilder or the
C++ personality, you can provide a Delphi-compatible interface there.

"You" is me or CG? I didn't know that can be done now. If you mean that CG could write it for CB, it wouldn't be enough, because popular projects are mostly compiled with other compilers.

> Time ago I learnt something about "name mangling" that
made C++ binaries incompatible with everything else.

Name mangling also is specific to a compiler, and therefore incompatible.

At least GCC is open source so the algorithms for NM must be public. Also IIRC Borland had a broad deal with Microsoft that provides access to much technical specifications. Add CB to the list. With something like that, Delphi would be more compatible with C++ than C++ compilers themselves :-)

Most compatible is everthing that goes into an 'extern "C" {...}' section, for which unmangled names are created.

Unfortunately there are a lot of interesting code to interface with that is not there. Mozilla and Qt/KDE are good examples.
.



Relevant Pages

  • Re: g++: using fstat on an already open stream
    ... standard IO features in C++. ... C++ is very nice when you are writing an algorithm. ... But if it comes to interfaces, be it filesystem interface as in orginal ... Only thing you can do if you have to support multiple compilers, ...
    (comp.unix.programmer)
  • Re: Type, bind(c) and gfortran
    ... I think your code is correct and gfortran has a bug in its C interop ... three other compilers do not fail to compile ... I'm trying to interface gsl to a fortran program. ...
    (comp.lang.fortran)
  • Re: object system...
    ... which potentially breaks all contracts. ... this assumes that a linking takes place between the objects' physical layout ... the contract refers to the public interface. ... well, yes, in my compilers and such, 128 bit ints and similar are built in ...
    (comp.object)
  • Re: Best Language for .Net?
    ... early compilers. ... Interface section is what allows Pascal to have a fast ... Delphi (the language). ... I agree, most languages tend to boil down to your preference in syntax, ...
    (borland.public.delphi.non-technical)
  • MS equivalent of GCCs -fno-common
    ... The above code compiles and links with MS c compiler 13.10. ... GCC and MS compilers dont show this problem in C++ mode though. ...
    (microsoft.public.vc.language)