This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: HP-UX libstdc++ patch for 64 bit mode.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: bkoz at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Tue, 12 Mar 2002 15:19:45 -0800 (PST)
- Subject: Re: HP-UX libstdc++ patch for 64 bit mode.
> > This is a patch for 64 bit mode on HP-UX. HP-UX does not provide
> > strtoll or strtoull functions in libc in 64 bit mode since they are the
> > same as strtol and strtoul so we define the libstdc++ functions to call
> > strtol and strtoul.
>
> This has come up before, also by somebody from HP. The thought was to try
> and use libibery, but no response on this was forthcoming from HP.
>
> See this thread:
> http://gcc.gnu.org/ml/libstdc++/2002-02/msg00241.html
>
> Can you at least comment, or try this approach?
>
> thanks,
> benjamin
I can't believe I forgot that Jessica had sent this in and that you had
replied to it. I tried the patch refered to in msg00241.html. I think
it works OK, I completely removed the strtoll and strtoull definitions
from config/os/hpux/bits/os_defines.h and applied that patch and built.
I am having some problems creating a test program though, I tried:
#include <cstdlib>
int main()
{
long long i;
long j;
i = std::strtoll("123",(char **) 0, 10);
j = std::strtol("123",(char **) 0, 10);
exit(0);
}
and got:
str.cc: In function `int main()':
str.cc:6: `strtoll' undeclared in namespace `std'
I think this is OK since strtoll in cstdlib is under
#if _GLIBCPP_USE_C99
but I don't know how to write a program that uses it
though. I tried --std=c99 but that created more errors.
I did verify that strtoll and strtoull were created in libiberty and
called from libstdc++.
Where do we go from here?
Steve Ellcey
sje@cup.hp.com