www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2014/07/03/20:28:46

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Message-ID: <53B5F51A.1060902@zoot.drehmel.com>
Date: Fri, 04 Jul 2014 02:28:10 +0200
From: Robert Drehmel <robert AT zoot DOT drehmel DOT com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] VPI and Icarus
References: <CAFx0xxjWMZp2YBh7OCsqX2GdqWgMdMgvzCDB+0JL2vLhr_SnOg AT mail DOT gmail DOT com> <53B5E5A2 DOT 6040005 AT buffalo DOT edu>
In-Reply-To: <53B5E5A2.6040005@buffalo.edu>
X-Provags-ID: V02:K0:vkG0ZlUM+t992d4D6z4yi1LvMFD3z7N88lqfa+PMNjp
bVNOGLzRv2siPGeraubNzB3hyplPCmXbhhw44yaHi9bbA+4nGQ
NhPJ6OFuX4tMq/8DKe5se9b+o2sWfnMzAhwRRwojwAo/5RgEea
pR8nBRN85UQbcu1PG8Z7G0F2pa9/GItHSjfXZKxc99GMmjC82r
Prr22tT4xlBNuxXWzCK4BVfSxBXBaZdzHOF/sVL2Wg++Fcyn1u
lOASTrveSsjKk71BmyC7OAScumpuY7d7VAcurLcb0IVvEfxwyO
SJN5nbHb8p1q765xrywiaOOONOw/ZRcwOKes59K9qv00x/ELzg
ASRvw6PE1uNjx1V3KaS68NGu3Y28VLbUvP001EaIQ
Reply-To: geda-user AT delorie DOT com

On 07/04/2014 01:22 AM, Stephen R. Besch wrote:
 > I know of a few solutions. First, and this is really hard and I would not recommend it, rewrite the library so it will compile in c++ rather than C.  Second, write a wrapper library in C++ that calls all the functions in C format, or third, tell the C++ compiler that you are calling a "C" function so that it won't decorate the names.
 >
 > Alas, I am not sure exactly how to do this. I know that it involves either the use of Extern "C" and/or Cdecl, but the exact details for your case you will have to look up.

To be able to call C library functions both from C and C++ code, it's
customary to wrap the function declarations in the library header(s)
like that:

"""
#ifdef __cplusplus
extern "C" {
#endif

// function declarations
...

#ifdef __cplusplus
}
#endif
"""

Best regards,
Robert

- Raw text -


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