www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/08/10:20:27

From: Paul Shirley <Paul AT chocolat DOT obvious DOT fake DOT foobar DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Declaring external assembly procedures
Date: Fri, 6 Feb 1998 22:43:44 +0000
Organization: wot? me?
Message-ID: <E$1bOOAgI520EwK3@foobar.co.uk>
References: <25546cf8 DOT 34db5c14 AT aol DOT com>
NNTP-Posting-Host: chocolat.foobar.co.uk
Mime-Version: 1.0
Lines: 20
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <25546cf8 DOT 34db5c14 AT aol DOT com>, ChrHenz AT aol DOT com writes
>You can also declare the function correctly in the ASM source so it can be
>interfaced by C++ progs. I remember that you have to append a specification of
>the expected parameters to the name (something like GLOBAL _Test_V, V stands
>for void. Sorry, I don't know exactly anymore, but I guess the documentation
>should help you). 
>Christian.

It would be better to declare and import them as C interfaces. To link
with C++ simply wrap each C interface in a 'static inline' function.
That will generate the correct inline C name whilst also performing
compile time parameter checking.

The only disadvantage is losing link time parameter checking. During
development you would need to manually change the asm function names (or
use a tool to extract them from a C++ file) so it may not be worth
worrying about.

---
Paul Shirley: my email address is 'obvious'ly anti-spammed

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019