[gdal-dev] Problems building gdal for win ce

godofredo contreras frdcn at hotmail.com
Thu Jul 3 12:11:22 EDT 2008


Hi:

Thank you for the patch, it works correctly. I applied to my working copy of
trunk and It compiles without problem.

One more question, I had a problem with function VSI_STAT64
being undefined. I added the following define in src/port/cpl_config.h 

#define VSI_STAT64 stat

it compiles, but I am not sure if this is correct or it can
cause some problems later.

Regards
Godofredo Contreras



> From: even.rouault at mines-paris.org
> To: frdcn at hotmail.com
> Subject: Re: [gdal-dev] Problems building gdal for win ce
> Date: Wed, 2 Jul 2008 23:10:26 +0200
> CC: gdal-dev at lists.osgeo.org
> 
> Try the attached patch. Please confirm if it works (I've no WINCE available) 
> and I'll commit that
> 
> Index: port/cpl_strtod.cpp
> ===================================================================
> --- port/cpl_strtod.cpp (révision 14798)
> +++ port/cpl_strtod.cpp (copie de travail)
> @@ -145,6 +145,56 @@
>  /*                          CPLStrtodDelim()                            */
>  /************************************************************************/
> 
> +static void CPLReplacePointByLocalePoint(char* pszNumber, char point)
> +{
> +#if defined(WIN32CE)
> +    static char byPoint = 0;
> +    if (byPoint == 0)
> +    {
> +        char szBuf[16];
> +        sprintf(szBuf, "%.1f", 1.0);
> +        byPoint = szBuf[1];
> +    }
> +    if (point != byPoint)
> +    {
> +        int     i = 0;
> +
> +        while ( pszNumber[i] )
> +        {
> +            if ( pszNumber[i] == point )
> +            {
> +                pszNumber[i] = byPoint;
> +                break;
> +            }
> +            i++;
> +        }
> +    }
> +#else
> +    struct lconv *poLconv = localeconv();
> +    if ( poLconv
> +         && poLconv->decimal_point
> +         && strlen(poLconv->decimal_point) > 0 )
> +    {
> +        int     i = 0;
> +        char    byPoint = poLconv->decimal_point[0];
> +
> +        if (point != byPoint)
> +        {
> +            while ( pszNumber[i] )
> +            {
> +                if ( pszNumber[i] == point )
> +                {
> +                    pszNumber[i] = byPoint;
> +                    break;
> +                }
> +                i++;
> +            }
> +        }
> +    }
> +#endif
> +}
> +
> +
>  /**
>   * Converts ASCII string to floating point number using specified delimiter.
>   *
> @@ -170,30 +220,12 @@
>  /*  with the one, taken from locale settings and use standard strtod()  */
>  /*  on that buffer.                                                     */
>  /* -------------------------------------------------------------------- */
> -
> -    struct lconv *poLconv = localeconv();
>      char        *pszNumber = CPLStrdup( nptr );
>      double      dfValue;
>      int         nError;
> 
> -    if ( poLconv
> -         && poLconv->decimal_point
> -         && strlen(poLconv->decimal_point) > 0 )
> -    {
> -        int     i = 0;
> -        char    byPoint = poLconv->decimal_point[0];
> +    CPLReplacePointByLocalePoint(pszNumber, point);
> 
> -        while ( pszNumber[i] )
> -        {
> -            if ( pszNumber[i] == point )
> -            {
> -                pszNumber[i] = byPoint;
> -                break;
> -            }
> -            i++;
> -        }
> -    }
> -
>      dfValue = strtod( pszNumber, endptr );
>      nError = errno;
> 
> @@ -263,29 +295,12 @@
>  /*  on that buffer.                                                     */
>  /* -------------------------------------------------------------------- */
> 
> -    struct lconv *poLconv = localeconv();
>      char        *pszNumber = CPLStrdup( nptr );
>      double      dfValue;
>      int         nError;
> 
> -    if ( poLconv
> -         && poLconv->decimal_point
> -         && strlen(poLconv->decimal_point) > 0 )
> -    {
> -        int     i = 0;
> -        char    byPoint = poLconv->decimal_point[0];
> +    CPLReplacePointByLocalePoint(pszNumber, point);
> 
> -        while ( pszNumber[i] )
> -        {
> -            if ( pszNumber[i] == point )
> -            {
> -                pszNumber[i] = byPoint;
> -                break;
> -            }
> -            i++;
> -        }
> -    }
> -
>      dfValue = strtof( pszNumber, endptr );
>      nError = errno;
> 
> 
> Le Wednesday 02 July 2008 22:27:31 godofredo contreras, vous avez écrit :
> > Hi:
> >
> > I´m trying to compile gdal for windows mobile, using windows mobile 5 sdk
> > and visual studio 2005 but  I´m getting an undefined reference to
> > localeconv in method  CPLStrtodDelim and undefined reference to
> > GDALWarpCutlineMasker in method GDALWarpOperation::WarpRegionToBuffer.
> >
> > Have someone had this problems, any idea to solve them?
> >
> > Thanks in advance
> > Godofredo Contreras
> >
> > _________________________________________________________________
> > Don't get caught with egg on your face. Play chicktionary!
> > http://club.live.com/chicktionary.aspx?icid=chick_wlhmtextlink1_feb
> 
> 

_________________________________________________________________
Windows Live Hotmail is giving away Zunes. Enter for your chance to win.
http://www.windowslive-hotmail.com/ZuneADay/?locale=en-US&ocid=TXT_TAGLM_Mobile_Zune_V3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080703/689dd272/attachment.html


More information about the gdal-dev mailing list