Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ulysses!hector!jss From: jss@hector.UUCP (Jerry Schwarz) Newsgroups: comp.lang.c++ Subject: Re: C --> C++ Message-ID: <11438@ulysses.homer.nj.att.com> Date: 16 Apr 89 03:01:07 GMT References: <6590096@hplsla.HP.COM> Sender: netnews@ulysses.homer.nj.att.com Reply-To: jss@hector.UUCP (Jerry Schwarz) Organization: AT&T Bell Laboratories Lines: 19 In article <6590096@hplsla.HP.COM> jima@hplsla.HP.COM (Jim Adcock) asks: >Say you want to write your routines in C++, but for >compatibility with old-world programmers your routines >need to be callable from C. Is there a clean way to do this? >IE a way that is not dependant on the latest and >greatest set of gyrations to encode C++ calling >conventions into C-compatible names? Can you >do a extern "C" like construct that goes the other >way? extern "C" actually goes both ways. extern "C" int f() { ... } does exactly what you want. (This is currently working in the internal version of cfront that will eventually become 2.0) Jerry Schwarz AT&T Bell Labs, Murray Hill