www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - MCVC++ Compatibility.

↑ ↓ ← Ilya Minkov <webmaster midiclub.de.vu> writes:
Hello.

I intend to (try to) write a plug-in for Jeskola BUZZ sound machines 
system, and i wanted to know whether there's any way to avoid using 
Microsoft compilers.

The Plug-in interface consists out of few functions, which get packaged 
into a DLL, and simply deliver some objects to the host application. So, 
it would requiere, that:

  - an (C++) object from a DLL must have exactly the same format, VTable 
structure, calling conventions as MSVC code;
  - the key functions are __fastcall, so a corresponding calling 
convention must exist.

I found the CTG not really clear on these subjects.
Thanks beforehand.

-eye
Aug 31 2003
↑ ↓ "Walter" <walter digitalmars.com> writes:
The DMC++ compiler is compatible for object layout and vtables. It is
compatible with the C++ calling convention, stdcall, and pascal conventions.
It does not support the fastcall convention, though you could deal with that
by writing a small shim.

"Ilya Minkov" <webmaster midiclub.de.vu> wrote in message
news:bitu98$2978$1 digitaldaemon.com...
 Hello.

 I intend to (try to) write a plug-in for Jeskola BUZZ sound machines
 system, and i wanted to know whether there's any way to avoid using
 Microsoft compilers.

 The Plug-in interface consists out of few functions, which get packaged
 into a DLL, and simply deliver some objects to the host application. So,
 it would requiere, that:

   - an (C++) object from a DLL must have exactly the same format, VTable
 structure, calling conventions as MSVC code;
   - the key functions are __fastcall, so a corresponding calling
 convention must exist.

 I found the CTG not really clear on these subjects.
 Thanks beforehand.

 -eye

Aug 31 2003
↑ ↓ Ilya Minkov <webmaster midiclub.de.vu> writes:
Walter wrote:
 The DMC++ compiler is compatible for object layout and vtables. It is
 compatible with the C++ calling convention[...]

Thanks.
 It does not support the fastcall convention, though you could deal with that
 by writing a small shim.

How? Dig up the calling conventions info and go assembly? Do you have any pointers handy? Thanks. -eye
Sep 02 2003
↑ ↓ → "Walter" <walter digitalmars.com> writes:
"Ilya Minkov" <webmaster midiclub.de.vu> wrote in message
news:bj38oi$m1b$1 digitaldaemon.com...
 Walter wrote:
 The DMC++ compiler is compatible for object layout and vtables. It is
 compatible with the C++ calling convention[...]

Thanks.
 It does not support the fastcall convention, though you could deal with


 by writing a small shim.

How? Dig up the calling conventions info and go assembly? Do you have any pointers handy?

A shim would look like this: int __fastcall theirfoo(int a, int b); extern "C" { int __cdecl myfoo(int a, int b) { return theirfoo(a, b); } } It's probably easiest to compile it in MSVC++, since they support the fastcall convention. Otherwise, it'll have to be done with a bit of inline assembler to do the call to theirfoo(). One way to do that is to compile it in MSVC++, disassemble it, and plug the assembler into DMC++'s inline assembler.
Sep 03 2003