Re: [Vala] inline C
- From: Conrad Steenberg <conrad steenberg caltech edu>
- To: Yu Feng <rainwoodman gmail com>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] inline C
- Date: Mon, 15 Dec 2008 09:30:23 -0800
On Mon, 2008-12-15 at 12:21 -0500, Yu Feng wrote:
On Mon, 2008-12-15 at 09:18 -0800, Conrad Steenberg wrote:
On Sat, 2008-12-13 at 13:00 -0500, Jamie McCracken wrote:
The disadvantage to inlining is it destroys the platform independence -
IE you would not be able to create a gcc front end for vala nor would
you be able to have vala->c++ or vala->jvm/clr.
jamie
Is it generally possible to use in C C++ libraries at all?
If I understand your question correctly, the canonical answer is that 'C
is a strict subset of C++', so yes you can use C in C++ libraries.
In practice there are a few things you need to do to make it work, e.g.
C header files should have an extern "C++" {} block to tell the C++
compiler to use C calling conventions and name mangling for linking to
existing C-compiled libraries. And there are a few corner cases where
the C and C++ specs differ.
Cheers,
Conrad
Hmmm, I would love to be able to use C++ libraries from Vala (or Genie,
since it's a natural jump from Numeric Python which I currently use).
Any ideas on how to do that? Compile the vala/genie-produced C code with
a C++ compiler?
Cheers,
Conrad
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]