Fwd: building glib on win32 MSVC6

Sorry, Torsten got this twice, gmail seems not that intuitive when
replying to a list, after all. :/ Forwarding to the list.

---------- Forwarded message ----------
From: zgrim <zzgrim gmail com>
Date: Aug 17, 2006 12:43 PM
Subject: Re: building glib on win32 MSVC6
To: Torsten Schoenfeld <kaffeetisch gmx de>

On 7/2/06, Torsten Schoenfeld <kaffeetisch gmx de> wrote:
On Thu, 2006-06-29 at 11:53 +0700, Martin Hosken wrote:

> I've just managed to build glib-1.20 on windows with MS Visual C 6. I
> accept your commiserations. But it went pretty well. The only problem I
> found was with strtoll and strtoull for which I cannot find a MSVC6
> equivalent. So I patched GType.xs to drop back to 32-bit, which
> naturally causes the 64-bit tests to fail, but hey it could be a lot worse.

I read somewhere on the net that MSVC does know about strtoq and strtouq
instead of strtoll and strtoull.  Can you verify that?  Also, you check
for _MSC_VER < 1300 -- do later versions have strtoll and strtoull?

 Sorry to rebring this back, but i've just hit it myself with msvc6.
Msvc7 has strtoi64(__int64), but that's of no use on 6.

As msdn seemed unusable, i googled it and on http://tinyurl.com/jtuot
i've found this helpful code:

#if defined (CS_COMPILER_MSVC)
#  if defined(_MSC_VER) && (_MSC_VER < 1300)
#    include <assert.h>
static inline longlong strtoll(char const* s, char** sN, int base)
 assert(sN == 0);
 assert(base == 10);
 return _atoi64(s);
#  else
#   define strtoll _strtoi64
#  endif

which i adopted as:
static inline __int64 strtoll( etc ) { etc }
and the correspondent unsigned for strtoull.

I think it would be helpful if Gtk2-Perl would adopt this code or a
similar fix for those of us doomed with the need of porting our stuff
to Win32.

Thanks for your time.


perl -MLWP::Simple -e'print$_[rand(split(q|%%\n|,

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