Hello,

Yes, it looks like strtoll() is supported:

# ./test str 1234
strtoll() returned 42672981

I have compiled a quick example that is using strtoll(), the output is what
I have pasted above:

#include <stdlib.h>
#include <limits.h>
#include <stdio.h>
#include <errno.h>

int
main(int argc, char *argv[])
{
    int base;
    char *endptr, *str;
    long val;

   if (argc < 2) {
        fprintf(stderr, "Usage: %s str [base]\n", argv[0]);
        exit(EXIT_FAILURE);
    }

   str = argv[1];
    base = (argc > 2) ? atoi(argv[2]) : 10;

   errno = 0;    /* To distinguish success/failure after call */
    val = strtoll(str, &endptr, base);

   /* Check for various possible errors */

   if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN))
            || (errno != 0 && val == 0)) {
        perror("strtol");
        exit(EXIT_FAILURE);
    }

   if (endptr == str) {
        fprintf(stderr, "No digits were found\n");
        exit(EXIT_FAILURE);
    }

   /* If we got here, strtol() successfully parsed a number */

   printf("strtol() returned %ld\n", val);

   if (*endptr != '\0')        /* Not necessarily an error... */
        printf("Further characters after number: %s\n", endptr);

   exit(EXIT_SUCCESS);
}


-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Davide Libenzi
Sent: 26 février 2010 11:10
To: XMail Users Mailing List
Subject: Re: [xmail] XMail 1.27 released

On Fri, 26 Feb 2010, fred wrote:

> Hello Davide,
>
> Thanks for this new release.
>
> I have issues building this on FreeBSD-4.11 32bits, here is what happens:
>
> g++   -D_FILE_OFFSET_BITS=64 -I. -D__UNIX__ -D__BSD__ -D__FREEBSD__
> -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAS_SYSMACHINE -D_GNU_SOURCE
> -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -O2 -o bin/POP3Utils.o -c
> POP3Utils.cpp
> POP3Utils.cpp: In function `int UPopCheckMailboxSize(UserInfo *, SYS_OFF_T
*
> = 0)':
> POP3Utils.cpp:156: implicit declaration of function `int atoll(...)'
> gmake: *** [bin/POP3Utils.o] Error 1
>
>
> This refers to this line in POP3Utils.cpp:
>
> SYS_OFF_T llMaxMBSize = Sys_atoi64(pszMaxMBSize) * 1024;

Can you check if at least strtoll() is there?


- Davide


_______________________________________________
xmail mailing list
[email protected]
http://xmailserver.org/mailman/listinfo/xmail


_______________________________________________
xmail mailing list
[email protected]
http://xmailserver.org/mailman/listinfo/xmail

Reply via email to