Re: glib on Symbian
- From: Biswajeet Dash symbian com
- Cc: Behdad Esfahbod <behdad esfahbod gmail com>, Tor Lillqvist <tml iki fi>, gtk+ dev <gtk-devel-list gnome org>
- Subject: Re: glib on Symbian
- Date: Tue, 9 Sep 2008 10:21:57 +0530
>Kalle Vahlman
wrote :-
>>Wrong. Symbian does not support static data
in DLL:s in all versions out there:
Please refer to the following link
for the updated latest version of the document :-
http://developer.symbian.com/main/downloads/papers/static_data/SupportForWriteableStaticDataInDLLs.pdf
The SYMBIAN OS EKA2 emulator only
allows a DLL with WSD to load into a single process
Hence for Support for emulator WSD
Symbian OS v9.4 provides emulator WSD
(EWSD library), a mechanism to allow DLLs
with WSD to be able to load into multiple
processes. The support is not transparent to the DLL writer;
they have to wrap the WSD in a data
structure and pass it to the EWSD library.
This library maintains the relationship
between the library, and its WSD values in each process.
The DLL writer has to make emulator-conditional
changes to the source code to:
• wrap all the WSD in
the DLL into a single “wrapper” data structure
• change code to refer
to the wrapper data member rather than directly
• prevent EPOCALLOWDLLDATA
being declared in the emulator build
For example, consider a DLL with a function
foo() that uses WSD iState as shown:
// source for foo.cpp
int iState;
void foo()
{
if (iState == ESomeState)
{
//do something
}
else
{
//do something else
}
}
You would change as shown:
// source for foo.cpp
struct MyWSD
{
int iState;
};
void foo()
{
#ifdef _USE_EWSD_
MyWSD *MyWSDPtr = Pls<MyWSD>(ThisLibUid);
// Pls is an API provided by the ewsd
- it fetches the ptr for this
// (process,libuid) tuple.
// You can also pass an initialisation
function to Pls() to initialise the WSD
// – initialisation is only done the
1st time the templated function is called
#endif
10
if (MyWSDPtr->iState == ESomeState)
{
//do something
}
else
{
//do something else
}
}
The MMP file of that DLL must not have
EPOCALLOWDLLDATA for the emulator build,
so you would make its specification
conditional on use of EWSD in the MMP file:
#ifndef _USE_EWSD_
EPOCALLOWDLLDATA
#endif
WSD in DLLs is not, and never will be,
supported on EKA1 based versions of Symbian OS. However WSD in DLLs is
supported on EKA2.(versions 9.x)
Hence for the port of GLIB to work on
EKA2 version of Symbian OS emulator we had to do these changes.
Regards
Biswajeet Dash|
Symbian Software India Private Limited |
biswajeet dash symbian com
Behdad Esfahbod <behdad behdad org>
Sent by: Behdad Esfahbod <behdad esfahbod gmail com>
09/06/2008 02:14 AM
|
To
| sparkymat <csy0013 googlemail com>
|
cc
| Tor Lillqvist <tml iki fi>, Biswajeet Dash symbian com,
gtk+ dev <gtk-devel-list gnome org>
|
Subject
| Re: glib on Symbian |
|
sparkymat wrote:
> We are doing what you have mentioned above, i.e. defining name of
global
> variables as function calls returning a pointer.
So, this limitation is *only* for the simulator, not the actual Symbian
running on mobile hardware, right? If that's the case I believe the
simulator
should be fixed instead.
behdad
> For example, in gdate.c,
>
> static gboolean using_twodigit_years = FALSE;
>
> would become
>
> #if defined(__SYMBIAN32__) && defined(EMULATOR)
> PLS(using_twodigit_years,gdate, gboolean)
> #define using_twodigit_years
> (*FUNCTION_NAME(using_twodigit_years ,gdate)()
> #else
> static gboolean using_twodigit_years =
FALSE;
> #endif
>
> where the PLS() macro will add the specified variable to the Process
> Local Storage, and the define will map it to a function pointer.
>
> This is repeated for all write-able static data (WSD).
Experience innovation in action - visit the Smartphone Show, 21-22 October 2008, Earls Court 2, London
**********************************************************************
Symbian Software Ltd is a company registered in England and Wales with registered number 4190020 and registered office at 2-6 Boundary Row, Southwark, London, SE1 8HP, UK. This message is intended only for use by the named addressee and may contain privileged and/or confidential information. If you are not the named addressee you should not disseminate, copy or take any action in reliance on it. If you have received this message in error please notify postmaster symbian com and delete the message and any attachments accompanying it immediately. Neither Symbian nor any of its Affiliates accepts liability for any corruption, interception, amendment, tampering or viruses occurring to this message in transit or for any message sent by its employees which is not in compliance with Symbian corporate policy.
**********************************************************************
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]