Re: [Vala] What is the internal access specification (Re: A couple of Vala questions)
- From: Al Thomas <astavale yahoo co uk>
- To: vala-list gnome org, Manish Jain <jude obscure yandex com>
- Subject: Re: [Vala] What is the internal access specification (Re: A couple of Vala questions)
- Date: Mon, 29 Jan 2018 10:56:43 +0000 (UTC)
> On Monday, 29 January 2018, 07:26:22 GMT, Manish Jain <jude obscure yandex com> wrote:
Does 'internal' hook into the Vala package system, meaning internal > members cannot be accessed from a
different package ?
A simple library like:
[CCode (gir_namespace = "libexample", gir_version = "0.1")]
namespace ExampleLib {
public void test () {
WhateverNameYouLikeForInternalUse.do_some_work ();
}
}
namespace WhateverNameYouLikeForInternalUse {
internal void do_some_work () {
print( "Internal test function called\n" );
}
}
compiled with the --hide-internal option like:valac demo.vala -X -fPIC -X -shared --hide-internal --library
libexample --header libexample.h --gir libexample-0.1.gir --output libexample.so
will not show the internal function in the symbol table of the library. To see the symbols use:readelf
--dyn-syms --wide libexample.so
If you look at the C code produced you should see the G_GNUCINTERNAL_MACRO being
used:https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html#G-GNUC-INTERNAL:CAPS
I understand DLLs compiled for Windows with MSVC using a different arrangement - the symbols are hiddenby
default. Vala doesn't currently do anything about that.
Regards,
Al
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]