[Lazarus] CustomDrawn, Android: Crash on Device

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Dec 2 21:21:53 CET 2011


On Fri, 2 Dec 2011 20:50:36 +0100
Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com> wrote:

> On Fri, Dec 2, 2011 at 8:00 PM, Mattias Gaertner
> <nc-gaertnma at netcologne.de> wrote:
> > The LCLBase must only contain widgetset independent IDFEFs.
> > That means the {$IF defined(Android)} must be replaced with some FPC
> > macros or the code must be moved to the widgetsets.
> 
> It cannot be moved to the widgetset because it does not simply add
> something. It also removes something. It removes the usage of Iconv
> and cwstring. If it is moved to the widgetsets, then we need to move
> the code which is using iconv in LCLBase to the widgetsets too.

Yes. Apparently this code depends on the widgetset, so it should be
there.

 
> The root of the problem is that lclbase is depending on iconv, while
> it should not IMHO.
> 
> > Is there is an FPC define to figure out if CWString can be used on arm?
> 
> No, and more: cwstring is never guaranteed to work. It depends on
> iconv to do the real work, so it is a dependency just like gtk2 or qt,
> which may or may not be installed or supported in a particular device.

With the important difference, that the iconv lib is only opened
if it is installed, using dlopen.

And btw, lconvencoding always defines DisableIconv, so it never uses
iconv.

I simplified the lconvencoding directives with a simple IFDEF
EnableIconvEnc.

Mattias




More information about the Lazarus mailing list