bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Missing glib function in cygwin


From: Michael Petch
Subject: Re: [Bug-gnubg] Missing glib function in cygwin
Date: Thu, 13 Aug 2009 23:07:00 -0600
User-agent: Microsoft-Entourage/12.20.0.090605

On 13/08/09 10:52 PM, "Ingo Macherius" <address@hidden> wrote:

> The first version to support the function is
> http://library.gnome.org/devel/glib/2.12/glib-String-Utility-Functions.html
> 
> However, it was buggy unless 2.12.5 and up
> http://www.mail-archive.com/address@hidden/msg195198.ht
> ml
> 
> Plain strtoll works just fine, thus a simple patch would be
> 
> #ifdef GLIB_CHECK_VERSION(2,12,5)
> while ((n = (int)g_ascii_strtoll(sz, &sz, 10)) != 0) {
> #else
> while ((n = (int)strtoll(sz, &sz, 10)) != 0) {
> #endif
> 

Although this hack works, and may suffice for now - one problem is that it
is not thread safe ( g_ascii_strtoll is thread safe ) . One option may be to
backport a version of g_ascii_strtoll from a later glib as a proper
solution. If I get a chance I'll review that code.

For now, I am putting away a copy of this change into CVS however it really
isn't the most ideal solution (unless you are running without threads)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]