Changeset de53138 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:21Z (6 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
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/cassert

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <assert.h>
     38    }
     39}
     40
    3441namespace std
    3542{
    36 
    37 extern "C" {
    38 #include <assert.h>
    39 }
    40 
     43    // Note: The only thing imported is assert
     44    //       and that is a macro.
    4145}
    4246
  • uspace/lib/cpp/include/cctype

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <ctype.h>
     38    }
     39}
     40
    3441namespace std
    3542{
    36 
    37 extern "C" {
    38 #include <ctype.h>
    39 }
    40 
     43    using std::hel::isalnum;
     44    using std::hel::isalpha;
     45    using std::hel::islower;
     46    using std::hel::isupper;
     47    using std::hel::isdigit;
     48    /* using std::hel::isxdigit; */
     49    /* using std::hel::iscntrl; */
     50    /* using std::hel::isgraph; */
     51    using std::hel::isspace;
     52    /* using std::hel::isblank; */
     53    /* using std::hel::isprint; */
     54    /* using std::hel::ispunct; */
     55    using std::hel::tolower;
     56    using std::hel::toupper;
    4157}
    4258
  • uspace/lib/cpp/include/cerrno

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <errno.h>
     38    }
     39}
     40
    3441namespace std
    3542{
    36 
    37 extern "C" {
    38 #include <errno.h>
    39 }
    40 
     43    // Note: Only macros are imported here.
    4144}
    4245
  • uspace/lib/cpp/include/cinttypes

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
    5  * Redistribution and use in source and binary forms, with or without
     5 * Redistribution and using in source and binary forms, with or without
    66 * modification, are permitted provided that the following conditions
    77 * are met:
     
    1212 *   notice, this list of conditions and the following disclaimer in the
    1313 *   documentation and/or other materials provided with the distribution.
    14  * - The name of the author may not be used to endorse or promote products
     14 * - The name of the author may not be usingd to endorse or promote products
    1515 *   derived from this software without specific prior written permission.
    1616 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <inttypes.h>
     38    }
     39}
     40
    3441namespace std
    3542{
    36 
    37 extern "C" {
    38 #include <inttypes.h>
     43    using std::hel::imaxdiv_t;
     44    /* using std::hel::abs; */
     45    /* using std::hel::div; */
     46    /* using std::hel::imaxabs; */
     47    /* using std::hel::imaxdiv; */
     48    /* using std::hel::strtoimax; */
     49    /* using std::hel::strtoumax; */
     50    /* using std::hel::wcstoimax; */
     51    /* using std::hel::wcstoumax; */
    3952}
    4053
    41 }
     54using std::hel::imaxdiv_t;
     55/* using std::hel::abs; */
     56/* using std::hel::div; */
     57/* using std::hel::imaxabs; */
     58/* using std::hel::imaxdiv; */
     59/* using std::hel::strtoimax; */
     60/* using std::hel::strtoumax; */
     61/* using std::hel::wcstoimax; */
     62/* using std::hel::wcstoumax; */
     63
     64#include <cstdint>
    4265
    4366#endif
  • uspace/lib/cpp/include/climits

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <limits.h>
     38    }
     39}
     40
    3441namespace std
    3542{
    36 
    37 extern "C" {
    38 #include <limits.h>
    39 }
    40 
     43    // Note: Only macros imported here.
    4144}
    4245
  • uspace/lib/cpp/include/csetjmp

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <setjmp.h>
     38    }
     39}
     40
    3441namespace std
    3542{
    36 
    37 extern "C" {
    38 #include <setjmp.h>
     43    using std::hel::jmp_buf;
     44    using std::hel::longjmp;
    3945}
    4046
    41 }
     47using std::hel::jmp_buf;
     48using std::hel::longjmp;
    4249
    4350#endif
  • uspace/lib/cpp/include/cstdarg

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <stdarg.h>
     38    }
     39}
     40
    3441namespace std
    3542{
    36 
    37 extern "C" {
    38 #include <stdarg.h>
     43    using std::hel::va_list;
    3944}
    4045
    41 }
     46using std::hel::va_list;
    4247
    4348#endif
  • uspace/lib/cpp/include/cstddef

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <stddef.h>
     38    }
     39}
     40
     41
    3442namespace std
    3543{
     44    using nullptr_t = decltype(nullptr);
    3645
    37 extern "C" {
    38 #include <stddef.h>
     46    using std::hel::size_t;
     47    using std::hel::ptrdiff_t;
     48    /* using std::hel::max_align_t; */
    3949}
    4050
    41 using nullptr_t = decltype(nullptr);
    42 
    43 }
     51using std::nullptr_t;
     52using std::hel::size_t;
     53using std::hel::ptrdiff_t;
     54/* using std::hel::max_align_t; */
    4455
    4556#endif
  • uspace/lib/cpp/include/cstdint

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <stdint.h>
     38    }
     39}
     40
    3441namespace std
    3542{
     43    using int8_t  = std::hel::int8_t;
     44    using int16_t = std::hel::int16_t;
     45    using int32_t = std::hel::int32_t;
     46    using int64_t = std::hel::int64_t;
    3647
    37 extern "C" {
    38 #include <stdint.h>
    39 }
     48    using intmax_t = std::hel::intmax_t;
     49    using intptr_t = std::hel::intptr_t;
    4050
    41 using int_fast8_t  = int8_t;
    42 using int_fast16_t = int16_t;
    43 using int_fast32_t = int32_t;
    44 using int_fast64_t = int64_t;
     51    using int_fast8_t  = std::hel::int8_t;
     52    using int_fast16_t = std::hel::int16_t;
     53    using int_fast32_t = std::hel::int32_t;
     54    using int_fast64_t = std::hel::int64_t;
    4555
    46 using int_least8_t  = int8_t;
    47 using int_least16_t = int16_t;
    48 using int_least32_t = int32_t;
    49 using int_least64_t = int64_t;
     56    using int_least8_t  = std::hel::int8_t;
     57    using int_least16_t = std::hel::int16_t;
     58    using int_least32_t = std::hel::int32_t;
     59    using int_least64_t = std::hel::int64_t;
    5060
    51 using uint_fast8_t  = uint8_t;
    52 using uint_fast16_t = uint16_t;
    53 using uint_fast32_t = uint32_t;
    54 using uint_fast64_t = uint64_t;
     61    using uint8_t  = std::hel::uint8_t;
     62    using uint16_t = std::hel::uint16_t;
     63    using uint32_t = std::hel::uint32_t;
     64    using uint64_t = std::hel::uint64_t;
    5565
    56 using uint_least8_t  = uint8_t;
    57 using uint_least16_t = uint16_t;
    58 using uint_least32_t = uint32_t;
    59 using uint_least64_t = uint64_t;
     66    using uintmax_t = std::hel::uintmax_t;
     67    using uintptr_t = std::hel::uintptr_t;
    6068
     69    using uint_fast8_t  = std::hel::uint8_t;
     70    using uint_fast16_t = std::hel::uint16_t;
     71    using uint_fast32_t = std::hel::uint32_t;
     72    using uint_fast64_t = std::hel::uint64_t;
     73
     74    using uint_least8_t  = std::hel::uint8_t;
     75    using uint_least16_t = std::hel::uint16_t;
     76    using uint_least32_t = std::hel::uint32_t;
     77    using uint_least64_t = std::hel::uint64_t;
    6178}
    6279
  • uspace/lib/cpp/include/cstdio

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <stdio.h>
     38    }
     39}
     40
    3441namespace std
    3542{
     43    using std::hel::FILE;
     44    /* using std::hel::fpos_t */
     45    using std::hel::size_t;
    3646
    37 extern "C" {
    38 #include <stdio.h>
     47    using std::hel::clearerr;
     48    using std::hel::fclose;
     49    using std::hel::feof;
     50    using std::hel::ferror;
     51    using std::hel::fflush;
     52    using std::hel::fgetc;
     53    /* using std::hel::fgetpos; */
     54    using std::hel::fgets;
     55    using std::hel::fopen;
     56    using std::hel::fprintf;
     57    using std::hel::fputc;
     58    using std::hel::fputs;
     59    using std::hel::fread;
     60    using std::hel::freopen;
     61    /* using std::hel::fscanf; */
     62    using std::hel::fseek;
     63    /* using std::hel::fsetpos; */
     64    using std::hel::ftell;
     65    using std::hel::fwrite;
     66    /* using std::hel::getc; */
     67    using std::hel::getchar;
     68    /* using std::hel::perror; */
     69    using std::hel::printf;
     70    /* using std::hel::putc; */
     71    using std::hel::putchar;
     72    using std::hel::puts;
     73    using std::hel::remove;
     74    using std::hel::rename;
     75    using std::hel::rewind;
     76    /* using std::hel::scanf; */
     77    using std::hel::setbuf;
     78    using std::hel::setvbuf;
     79    using std::hel::snprintf;
     80    /* using std::hel::sprintf; */
     81    /* using std::hel::sscanf; */
     82    /* using std::hel::tmpfile; */
     83    /* using std::hel::tmpnam; */
     84    using std::hel::ungetc;
     85    using std::hel::vfprintf;
     86    using std::hel::vprintf;
     87    /* using std::hel::vscanf; */
     88    using std::hel::vsnprintf;
     89    /* using std::hel::vsprintf; */
     90    /* using std::hel::vsscanf; */
    3991}
    4092
    41 }
     93using std::hel::FILE;
     94/* using std::hel::fpos_t */
     95using std::hel::size_t;
     96
     97using std::hel::clearerr;
     98using std::hel::fclose;
     99using std::hel::feof;
     100using std::hel::ferror;
     101using std::hel::fflush;
     102using std::hel::fgetc;
     103/* using std::hel::fgetpos; */
     104using std::hel::fgets;
     105using std::hel::fopen;
     106using std::hel::fprintf;
     107using std::hel::fputc;
     108using std::hel::fputs;
     109using std::hel::fread;
     110using std::hel::freopen;
     111/* using std::hel::fscanf; */
     112using std::hel::fseek;
     113/* using std::hel::fsetpos; */
     114using std::hel::ftell;
     115using std::hel::fwrite;
     116/* using std::hel::getc; */
     117using std::hel::getchar;
     118/* using std::hel::perror; */
     119using std::hel::printf;
     120/* using std::hel::putc; */
     121using std::hel::putchar;
     122using std::hel::puts;
     123using std::hel::remove;
     124using std::hel::rename;
     125using std::hel::rewind;
     126/* using std::hel::scanf; */
     127using std::hel::setbuf;
     128using std::hel::setvbuf;
     129using std::hel::snprintf;
     130/* using std::hel::sprintf; */
     131/* using std::hel::sscanf; */
     132/* using std::hel::tmpfile; */
     133/* using std::hel::tmpnam; */
     134using std::hel::ungetc;
     135using std::hel::vfprintf;
     136using std::hel::vprintf;
     137/* using std::hel::vscanf; */
     138using std::hel::vsnprintf;
     139/* using std::hel::vsprintf; */
     140/* using std::hel::vsscanf; */
    42141
    43142#endif
  • uspace/lib/cpp/include/cstdlib

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <stdlib.h>
     38    }
     39}
     40
    3441namespace std
    3542{
     43    /* using std::hel::div_t; */
     44    /* using std::hel::ldiv_t; */
     45    /* using std::hel::lldiv_t; */
     46    using std::hel::size_t;
    3647
    37 extern "C" {
    38 #include <stdlib.h>
     48    using std::hel::abort;
     49    using std::hel::exit;
     50    /* using std::hel::quick_exit; */
     51    /* using std::hel::_Exit; */
     52    using std::hel::atexit;
     53    /* using std::hel::at_quick_exit; */
     54    /* using std::hel::system; */
     55    /* using std::hel::getenv; */
     56
     57    using std::hel::malloc;
     58    using std::hel::calloc;
     59    using std::hel::realloc;
     60    using std::hel::free;
     61
     62    /* using std::hel::atof; */
     63    /* using std::hel::atoi; */
     64    /* using std::hel::atol; */
     65    /* using std::hel::atoll; */
     66    /* using std::hel::strtol; */
     67    /* using std::hel::strtoll; */
     68    /* using std::hel::strtoul; */
     69    /* using std::hel::strtoull; */
     70    /* using std::hel::strtof; */
     71    /* using std::hel::strtod; */
     72    /* using std::hel::strtold; */
     73
     74    /* using std::hel::mblen; */
     75    /* using std::hel::mbtowc; */
     76    /* using std::hel::wctomb; */
     77    /* using std::hel::mbstowcs; */
     78    /* using std::hel::wcstombs; */
     79
     80    using std::hel::random; // Supposed to be rand.
     81    using std::hel::srandom; // Supposed to be srand.
     82    using std::hel::qsort;
     83    /* using std::hel::bsearch; */
     84    /* using std::hel::abs; */
     85    /* using std::hel::labs; */
     86    /* using std::hel::llabs; */
     87    /* using std::hel::div; */
     88    /* using std::hel::ldiv; */
     89    /* using std::hel::lldiv; */
    3990}
    4091
    41 }
     92/* using std::hel::div_t; */
     93/* using std::hel::ldiv_t; */
     94/* using std::hel::lldiv_t; */
     95using std::hel::size_t;
     96
     97using std::hel::abort;
     98using std::hel::exit;
     99/* using std::hel::quick_exit; */
     100/* using std::hel::_Exit; */
     101using std::hel::atexit;
     102/* using std::hel::at_quick_exit; */
     103/* using std::hel::system; */
     104/* using std::hel::getenv; */
     105
     106using std::hel::malloc;
     107using std::hel::calloc;
     108using std::hel::realloc;
     109using std::hel::free;
     110
     111/* using std::hel::atof; */
     112/* using std::hel::atoi; */
     113/* using std::hel::atol; */
     114/* using std::hel::atoll; */
     115/* using std::hel::strtol; */
     116/* using std::hel::strtoll; */
     117/* using std::hel::strtoul; */
     118/* using std::hel::strtoull; */
     119/* using std::hel::strtof; */
     120/* using std::hel::strtod; */
     121/* using std::hel::strtold; */
     122
     123/* using std::hel::mblen; */
     124/* using std::hel::mbtowc; */
     125/* using std::hel::wctomb; */
     126/* using std::hel::mbstowcs; */
     127/* using std::hel::wcstombs; */
     128
     129using std::hel::random; // Supposed to be rand.
     130using std::hel::srandom; // Supposed to be srand.
     131using std::hel::qsort;
     132/* using std::hel::bsearch; */
     133/* using std::hel::abs; */
     134/* using std::hel::labs; */
     135/* using std::hel::llabs; */
     136/* using std::hel::div; */
     137/* using std::hel::ldiv; */
     138/* using std::hel::lldiv; */
    42139
    43140#endif
  • uspace/lib/cpp/include/cstring

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <str.h>
     38    }
     39}
     40
    3441namespace std
    3542{
     43    using std::hel::size_t;
    3644
    37 extern "C" {
    38 #include <str.h>
     45    /* using std::hel::strcpy; */
     46    /* using std::hel::strncpy; */
     47    /* using std::hel::strcat; */
     48    /* using std::hel::strncat; */
     49    /* using std::hel::strxfrm; */
     50
     51    /* using std::hel::strlen; */
     52    /* using std::hel::strcmp; */
     53    /* using std::hel::strncmp; */
     54    /* using std::hel::strcoll; */
     55    /* using std::hel::strchr; */
     56    /* using std::hel::strrchr; */
     57    /* using std::hel::strspn; */
     58    /* using std::hel::strcspn; */
     59    /* using std::hel::strpbrk; */
     60    /* using std::hel::strstr; */
     61    /* using std::hel::strok; */
     62
     63    /* using std::hel::memchr; */
     64    using std::hel::memcmp;
     65    using std::hel::memset;
     66    using std::hel::memcpy;
     67    using std::hel::memmove;
     68
     69    /* using std::hel::strerror; */
    3970}
    4071
    41 }
     72using std::hel::size_t;
     73
     74/* using std::hel::strcpy; */
     75/* using std::hel::strncpy; */
     76/* using std::hel::strcat; */
     77/* using std::hel::strncat; */
     78/* using std::hel::strxfrm; */
     79
     80/* using std::hel::strlen; */
     81/* using std::hel::strcmp; */
     82/* using std::hel::strncmp; */
     83/* using std::hel::strcoll; */
     84/* using std::hel::strchr; */
     85/* using std::hel::strrchr; */
     86/* using std::hel::strspn; */
     87/* using std::hel::strcspn; */
     88/* using std::hel::strpbrk; */
     89/* using std::hel::strstr; */
     90/* using std::hel::strok; */
     91
     92/* using std::hel::memchr; */
     93using std::hel::memcmp;
     94using std::hel::memset;
     95using std::hel::memcpy;
     96using std::hel::memmove;
     97
     98/* using std::hel::strerror; */
    4299
    43100#endif
  • uspace/lib/cpp/include/ctime

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <time.h>
     38    }
     39}
     40
    3441namespace std
    3542{
     43    /* using std::hel::clock_t; */
     44    using std::hel::size_t;
     45    using std::hel::time_t;
     46    using std::hel::tm;
     47    /* using std::hel::timespec; */
    3648
    37 extern "C" {
    38 #include <time.h>
     49    /* using std::hel::clock; */
     50    using std::hel::time;
     51    using std::hel::difftime;
     52
     53    /* using std::hel::ctime; */
     54    /* using std::hel::asctime; */
     55    using std::hel::strftime;
     56    /* using std::hel::wcsftime; */
     57    /* using std::hel::gmtime; */
     58    /* using std::hel::localtime; */
     59    using std::hel::mktime;
    3960}
    4061
    41 }
     62/* using std::hel::clock_t; */
     63using std::hel::size_t;
     64using std::hel::time_t;
     65using std::hel::tm;
     66/* using std::hel::timespec; */
     67
     68/* using std::hel::clock; */
     69using std::hel::time;
     70using std::hel::difftime;
     71
     72/* using std::hel::ctime; */
     73/* using std::hel::asctime; */
     74using std::hel::strftime;
     75/* using std::hel::wcsftime; */
     76/* using std::hel::gmtime; */
     77/* using std::hel::localtime; */
     78using std::hel::mktime;
    4279
    4380#endif
  • uspace/lib/cpp/include/cwchar

    r6d8a63a rde53138  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include "internal/common.hpp"
    3333
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <wchar.h>
     38        #include <time.h>
     39    }
     40}
     41
    3442namespace std
    3543{
     44    /* using std::hel::mbstate_t; */
     45    using std::hel::size_t;
     46    using std::hel::wint_t;
     47    using std::hel::tm;
    3648
    37 extern "C" {
    38 #include <wchar.h>
     49    /* using std::hel::wcscpy; */
     50    /* using std::hel::wcsncpy; */
     51    /* using std::hel::wcscat; */
     52    /* using std::hel::wcsncat; */
     53    /* using std::hel::wcsnxfrm; */
     54
     55    /* using std::hel::wcslen; */
     56    /* using std::hel::wcscmp; */
     57    /* using std::hel::wcsncmp; */
     58    /* using std::hel::wcscoll; */
     59    /* using std::hel::wcschr; */
     60    /* using std::hel::wcsrchr; */
     61    /* using std::hel::wcsspn; */
     62    /* using std::hel::wcscspn; */
     63    /* using std::hel::wcspbrk; */
     64    /* using std::hel::wcsstr; */
     65    /* using std::hel::wcstok; */
     66
     67    /* using std::hel::wmemcpy; */
     68    /* using std::hel::wmemmove; */
     69    /* using std::hel::wmemcmp; */
     70    /* using std::hel::wmemchr; */
     71    /* using std::hel::wmemset; */
     72
     73    /* using std::hel::msbinit; */
     74    /* using std::hel::btowc; */
     75    /* using std::hel::wctob; */
     76    /* using std::hel::mbrlen; */
     77    /* using std::hel::mbrtowc; */
     78    /* using std::hel::wctomb; */
     79    /* using std::hel::mbsrtowcs; */
     80    /* using std::hel::wcsrtombs; */
     81
     82    /* using std::hel::fgetwc; */
     83    /* using std::hel::getwc; */
     84    /* using std::hel::fgetws; */
     85    /* using std::hel::fputwc; */
     86    /* using std::hel::putwc; */
     87    /* using std::hel::fputws; */
     88    /* using std::hel::getwchar; */
     89    /* using std::hel::putwchar; */
     90    /* using std::hel::ungetwc; */
     91    /* using std::hel::fwide; */
     92    /* using std::hel::wscanf; */
     93    /* using std::hel::fwscanf; */
     94    /* using std::hel::swscanf; */
     95    /* using std::hel::vwscanf; */
     96    /* using std::hel::vfwscanf; */
     97    /* using std::hel::vswscanf; */
     98    /* using std::hel::wprintf; */
     99    /* using std::hel::fwprintf; */
     100    /* using std::hel::swprintf; */
     101
     102    /* using std::hel::wcsftime; */
     103    /* using std::hel::wcstol; */
     104    /* using std::hel::wcstoll; */
     105    /* using std::hel::wcstoul; */
     106    /* using std::hel::wcstoull; */
     107    /* using std::hel::wcstof; */
     108    /* using std::hel::wcstod; */
     109    /* using std::hel::wcstold; */
    39110}
    40111
    41 }
     112/* using std::hel::mbstate_t; */
     113using std::hel::size_t;
     114using std::hel::wint_t;
     115using std::hel::tm;
     116
     117/* using std::hel::wcscpy; */
     118/* using std::hel::wcsncpy; */
     119/* using std::hel::wcscat; */
     120/* using std::hel::wcsncat; */
     121/* using std::hel::wcsnxfrm; */
     122
     123/* using std::hel::wcslen; */
     124/* using std::hel::wcscmp; */
     125/* using std::hel::wcsncmp; */
     126/* using std::hel::wcscoll; */
     127/* using std::hel::wcschr; */
     128/* using std::hel::wcsrchr; */
     129/* using std::hel::wcsspn; */
     130/* using std::hel::wcscspn; */
     131/* using std::hel::wcspbrk; */
     132/* using std::hel::wcsstr; */
     133/* using std::hel::wcstok; */
     134
     135/* using std::hel::wmemcpy; */
     136/* using std::hel::wmemmove; */
     137/* using std::hel::wmemcmp; */
     138/* using std::hel::wmemchr; */
     139/* using std::hel::wmemset; */
     140
     141/* using std::hel::msbinit; */
     142/* using std::hel::btowc; */
     143/* using std::hel::wctob; */
     144/* using std::hel::mbrlen; */
     145/* using std::hel::mbrtowc; */
     146/* using std::hel::wctomb; */
     147/* using std::hel::mbsrtowcs; */
     148/* using std::hel::wcsrtombs; */
     149
     150/* using std::hel::fgetwc; */
     151/* using std::hel::getwc; */
     152/* using std::hel::fgetws; */
     153/* using std::hel::fputwc; */
     154/* using std::hel::putwc; */
     155/* using std::hel::fputws; */
     156/* using std::hel::getwchar; */
     157/* using std::hel::putwchar; */
     158/* using std::hel::ungetwc; */
     159/* using std::hel::fwide; */
     160/* using std::hel::wscanf; */
     161/* using std::hel::fwscanf; */
     162/* using std::hel::swscanf; */
     163/* using std::hel::vwscanf; */
     164/* using std::hel::vfwscanf; */
     165/* using std::hel::vswscanf; */
     166/* using std::hel::wprintf; */
     167/* using std::hel::fwprintf; */
     168/* using std::hel::swprintf; */
     169
     170/* using std::hel::wcsftime; */
     171/* using std::hel::wcstol; */
     172/* using std::hel::wcstoll; */
     173/* using std::hel::wcstoul; */
     174/* using std::hel::wcstoull; */
     175/* using std::hel::wcstof; */
     176/* using std::hel::wcstod; */
     177/* using std::hel::wcstold; */
    42178
    43179#endif
  • 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        {
  • uspace/lib/cpp/include/internal/thread.hpp

    r6d8a63a rde53138  
    3030#define LIBCPP_INTERNAL_THREAD
    3131
    32 namespace std
    33 { // TODO: fix cheaders
     32namespace std::hel
     33{
    3434    extern "C" {
    3535        #include <fibril.h>
     
    5454    struct threading_policy<fibril_tag>
    5555    {
    56         using mutex_type        = fibril_mutex_t;
    57         using thread_type       = fid_t;
    58         using condvar_type      = fibril_condvar_t;
    59         using time_unit         = suseconds_t;
    60         using shared_mutex_type = fibril_rwlock_t;
     56        using mutex_type        = hel::fibril_mutex_t;
     57        using thread_type       = hel::fid_t;
     58        using condvar_type      = hel::fibril_condvar_t;
     59        using time_unit         = hel::suseconds_t;
     60        using shared_mutex_type = hel::fibril_rwlock_t;
    6161
    6262        struct thread
     
    6565            static thread_type create(Callable clbl, Payload& pld)
    6666            {
    67                 return fibril_create(clbl, (void*)&pld);
     67                return hel::fibril_create(clbl, (void*)&pld);
    6868            }
    6969
    7070            static void start(thread_type thr)
    7171            {
    72                 fibril_add_ready(thr);
     72                hel::fibril_add_ready(thr);
    7373            }
    7474
    7575            static thread_type this_thread()
    7676            {
    77                 return fibril_get_id();
     77                return hel::fibril_get_id();
    7878            }
    7979
    8080            static void yield()
    8181            {
    82                 fibril_yield();
     82                hel::fibril_yield();
    8383            }
    8484
     
    9494            static void init(mutex_type& mtx)
    9595            {
    96                 fibril_mutex_initialize(&mtx);
     96                hel::fibril_mutex_initialize(&mtx);
    9797            }
    9898
    9999            static void lock(mutex_type& mtx)
    100100            {
    101                 fibril_mutex_lock(&mtx);
     101                hel::fibril_mutex_lock(&mtx);
    102102            }
    103103
    104104            static void unlock(mutex_type& mtx)
    105105            {
    106                 fibril_mutex_unlock(&mtx);
     106                hel::fibril_mutex_unlock(&mtx);
    107107            }
    108108
    109109            static bool try_lock(mutex_type& mtx)
    110110            {
    111                 return fibril_mutex_trylock(&mtx);
     111                return hel::fibril_mutex_trylock(&mtx);
    112112            }
    113113
     
    123123            static void init(condvar_type& cv)
    124124            {
    125                 fibril_condvar_initialize(&cv);
     125                hel::fibril_condvar_initialize(&cv);
    126126            }
    127127
    128128            static void wait(condvar_type& cv, mutex_type& mtx)
    129129            {
    130                 fibril_condvar_wait(&cv, &mtx);
     130                hel::fibril_condvar_wait(&cv, &mtx);
    131131            }
    132132
    133133            static int wait_for(condvar_type& cv, mutex_type& mtx, time_unit timeout)
    134134            {
    135                 return fibril_condvar_wait_timeout(&cv, &mtx, timeout);
     135                return hel::fibril_condvar_wait_timeout(&cv, &mtx, timeout);
    136136            }
    137137
    138138            static void signal(condvar_type& cv)
    139139            {
    140                 fibril_condvar_signal(&cv);
     140                hel::fibril_condvar_signal(&cv);
    141141            }
    142142
    143143            static void broadcast(condvar_type& cv)
    144144            {
    145                 fibril_condvar_broadcast(&cv);
     145                hel::fibril_condvar_broadcast(&cv);
    146146            }
    147147        };
     
    157157            static void sleep(time_unit time)
    158158            {
    159                 fibril_usleep(time);
     159                hel::fibril_usleep(time);
    160160            }
    161161        };
     
    165165            static void init(shared_mutex_type& mtx)
    166166            {
    167                 fibril_rwlock_initialize(&mtx);
     167                hel::fibril_rwlock_initialize(&mtx);
    168168            }
    169169
    170170            static void lock(shared_mutex_type& mtx)
    171171            {
    172                 fibril_rwlock_write_lock(&mtx);
     172                hel::fibril_rwlock_write_lock(&mtx);
    173173            }
    174174
    175175            static void unlock(shared_mutex_type& mtx)
    176176            {
    177                 fibril_rwlock_write_unlock(&mtx);
     177                hel::fibril_rwlock_write_unlock(&mtx);
    178178            }
    179179
    180180            static void lock_shared(shared_mutex_type& mtx)
    181181            {
    182                 fibril_rwlock_read_lock(&mtx);
     182                hel::fibril_rwlock_read_lock(&mtx);
    183183            }
    184184
    185185            static void unlock_shared(shared_mutex_type& mtx)
    186186            {
    187                 fibril_rwlock_read_unlock(&mtx);
     187                hel::fibril_rwlock_read_unlock(&mtx);
    188188            }
    189189
Note: See TracChangeset for help on using the changeset viewer.