Ignore:
Timestamp:
2019-05-27T12:38:26Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0d14c25
Parents:
4d51c60
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-13 16:06:49)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-05-27 12:38:26)
Message:

Make some libc and libposix headers usable in C++

These headers either get included from standard C++ headers,
or are standard themselves, which means any unnamespaced nonstandard
identifiers are a problem. This commit attempts to fix those
issues, and removes hacks previously used in libcpp to work around it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/__bits/locale/num_get.hpp

    r4d51c60 rbc56f30  
    301301                if (size > 0)
    302302                {
    303                     int ret{};
     303                    int olderrno{errno};
     304                    errno = EOK;
     305
    304306                    if constexpr (is_signed<BaseType>::value)
    305                         ret = std::hel::str_int64_t(base.buffer_, nullptr, num_base, false, &res);
    306                     else
    307                         ret = std::hel::str_uint64_t(base.buffer_, nullptr, num_base, false, &res);
    308 
    309                     if (ret != EOK)
    310                     {
     307                        res = ::strtoll(base.buffer_, nullptr, num_base);
     308                    else
     309                        res = ::strtoull(base.buffer_, nullptr, num_base);
     310
     311                    if (errno != EOK)
    311312                        err |= ios_base::failbit;
    312                         v = 0;
    313                     }
    314                     else if (res > static_cast<BaseType>(numeric_limits<T>::max()))
     313
     314                    errno = olderrno;
     315
     316                    if (res > static_cast<BaseType>(numeric_limits<T>::max()))
    315317                    {
    316318                        err |= ios_base::failbit;
Note: See TracChangeset for help on using the changeset viewer.