VirtualBox

Changeset 96057 in vbox


Ignore:
Timestamp:
Aug 5, 2022 11:07:45 AM (2 years ago)
Author:
vboxsync
Message:

IPRT/nocrt: Added strtoll and strtoul. [fixes] bugref:10261

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/nocrt-strtoul.cpp

    r96056 r96057  
    3434#include <iprt/nocrt/limits.h>
    3535#include <iprt/nocrt/errno.h>
     36#include <iprt/err.h>
    3637#include <iprt/string.h>
    3738
    3839
    3940#undef strtoul
    40 long RT_NOCRT(strtoul)(const char *psz, char **ppszNext, int iBase)
     41unsigned long RT_NOCRT(strtoul)(const char *psz, char **ppszNext, int iBase)
    4142{
    42 #if ULONG_BIT == 64
     43#if LONG_BIT == 64
    4344    uint64_t uValue = 0;
    44     int rc = RTStrToUInt64Ex(psz, ppszNext, (unsigned)iBase, &uiValue);
    45 #elif ULONG_BIT == 32
    46     int32_t uValue = 0;
    47     int rc = RTStrToUInt32Ex(psz, ppszNext, (unsigned)iBase, &uiValue);
     45    int rc = RTStrToUInt64Ex(psz, ppszNext, (unsigned)iBase, &uValue);
     46#elif LONG_BIT == 32
     47    uint32_t uValue = 0;
     48    int rc = RTStrToUInt32Ex(psz, ppszNext, (unsigned)iBase, &uValue);
    4849#else
    4950# error "Unsupported LONG_BIT value"
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette