Changeset de53138 in mainline for uspace/lib/cpp/include/impl


Ignore:
Timestamp:
2018-07-05T21:41:21Z (7 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c71c171
Parents:
6d8a63a
git-author:
Dzejrou <dzejrou@…> (2018-04-20 00:11:54)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:21)
Message:

cpp: revamped c header wrappers, now only include standard symbols, others are in std::hel, fixed some bugs

Location:
uspace/lib/cpp/include/impl
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/impl/chrono.hpp

    r6d8a63a rde53138  
    611611            static time_point now()
    612612            {
    613                 std::timeval tv{};
    614                 std::gettimeofday(&tv, nullptr);
     613                hel::timeval tv{};
     614                hel::gettimeofday(&tv, nullptr);
    615615
    616616                rep time = tv.tv_usec;
     
    654654            static time_point now()
    655655            {
    656                 std::timeval tv{};
    657                 std::getuptime(&tv);
     656                hel::timeval tv{};
     657                hel::getuptime(&tv);
    658658
    659659                rep time = tv.tv_usec;
  • uspace/lib/cpp/include/impl/ios.hpp

    r6d8a63a rde53138  
    4141{
    4242    using streamoff = long long;
    43     using streamsize = ssize_t;
     43    using streamsize = hel::ssize_t;
    4444
    4545    /**
  • uspace/lib/cpp/include/impl/iterator.hpp

    r6d8a63a rde53138  
    530530        >
    531531        {
    532             using type = remove_reference_t<typename iterator_traits<Iterator>::reference>;
     532            using type = remove_reference_t<typename iterator_traits<Iterator>::reference>&&;
    533533        };
    534534    }
  • uspace/lib/cpp/include/impl/stack.hpp

    r6d8a63a rde53138  
    4848            using container_type  = Container;
    4949            using value_type      = typename container_type::value_type;
    50             using reference       = typename constainer_type::reference;
     50            using reference       = typename container_type::reference;
    5151            using const_reference = typename container_type::const_reference;
    5252            using size_type       = typename container_type::size_type;
     
    132132
    133133            void swap(stack& other)
    134                 noexcept(noexcept(swap(c, other.c)))
     134                /* noexcept(noexcept(swap(c, other.c))) */
    135135            {
    136136                std::swap(c, other.c);
  • uspace/lib/cpp/include/impl/string.hpp

    r6d8a63a rde53138  
    4444namespace std
    4545{
    46 
    4746    /**
    4847     * 21.2, char_traits:
     
    8281        static int compare(const char_type* s1, const char_type* s2, size_t n)
    8382        {
    84             return std::str_lcmp(s1, s2, n);
     83            return hel::str_lcmp(s1, s2, n);
    8584        }
    8685
    8786        static size_t length(const char_type* s)
    8887        {
    89             return std::str_size(s);
     88            return hel::str_size(s);
    9089        }
    9190
     
    354353        {
    355354            // TODO: This function does not exits...
    356             //return std::wstr_lcmp(s1, s2, n);
     355            //return hel::wstr_lcmp(s1, s2, n);
    357356            return 0;
    358357        }
     
    360359        static size_t length(const char_type* s)
    361360        {
    362             return std::wstr_size(s);
     361            return hel::wstr_size(s);
    363362        }
    364363
     
    448447            /**
    449448             * 21.4.2, construct/copy/destroy:
     449             * TODO: tagged constructor that moves the char*
     450             *       and use that with asprintf in to_string
    450451             */
     452
    451453            basic_string() noexcept
    452454                : basic_string(allocator_type{})
  • uspace/lib/cpp/include/impl/thread.hpp

    r6d8a63a rde53138  
    248248            { /* DUMMY BODY */ }
    249249
    250             fid_t id_; // For testing atm public.
    251250        private:
    252             id(fid_t id)
     251            aux::thread_t id_;
     252
     253            id(aux::thread_t id)
    253254                : id_{id}
    254255            { /* DUMMY BODY */ }
  • uspace/lib/cpp/include/impl/utility.hpp

    r6d8a63a rde53138  
    3030#define LIBCPP_UTILITY
    3131
     32#include <cstdint>
    3233#include <type_traits>
    3334
     
    7879    constexpr T&& forward(remove_reference_t<T>&& t) noexcept
    7980    {
    80         // TODO: check if t is lvalue reference, if it is, the program
    81         //       is ill-formed according to the standard
    8281        return static_cast<T&&>(t);
    8382    }
     
    236235    namespace aux
    237236    {
    238         template<class T, std::uintmax_t N>
     237        template<class T, uintmax_t N>
    239238        struct make_integer_sequence
    240239        {
Note: See TracChangeset for help on using the changeset viewer.