Commit Graph

326 Commits

Author SHA1 Message Date
1a153b835c BAN: Nullterminate encoded UTF8 data 2025-04-01 22:39:56 +03:00
73c292c4e9 BAN: Fix negative floating point value printing 2025-04-01 22:39:21 +03:00
cbe3f2a4ac BuildSystem: Cleanup and fix cmake files
I now set library SONAME so i don't have to build them in build root.

Creating font now makes sure the install directory exists. This allows
building using make files.

LibC now links agains ligcc
2025-01-28 17:11:21 +02:00
8b312a47e6 BAN: Allow MUST and TRY to contain commas 2024-12-16 17:22:40 +02:00
90820f24a4 BAN: Make HashMap::{insert,emplace}{,_or_assign} return an iterator
This reduces the number of lookups done into the hash map :)
2024-12-09 03:37:13 +02:00
6f118c1be1 BAN: Make HashMap key move constructible
This allows using non-copyable types as keys
2024-11-26 00:57:11 +02:00
7316eb87b8 BAN: Add requires expression for BAN::Formatter
This allows seeing syntax errors before compilation :)
2024-11-26 00:55:58 +02:00
5376236ab6 BAN: Make ErrorOr non-copyable
This makes avoiding accidentals copies easier :)
2024-11-26 00:55:12 +02:00
0af80d48ee BAN: Mark ByteSpan::slice as [[nodiscard]] 2024-11-26 00:54:35 +02:00
31d2a39540 BAN: Add default constructors for BAN::{Little,Big}Endian 2024-11-21 13:34:12 +02:00
f8ef11b4d2 BAN: Make PlacementNew.h only include <new> if it exists
Otherwise it will define the functions itself. This allows compiling
toolchain as stdlibc++ depends on BAN.
2024-11-19 00:16:44 +02:00
4417268ecc BAN: only include <new> in PlacementNew.h
I was getting annoying multiple definitions for placement new and my
build system requires that c++ libraries are compiled. I guess this is
the easiest and cleanest solution
2024-11-08 02:48:07 +02:00
346853ee55 BAN: Implement sincos to math
This function calculates both sin and cos fast (hopefully)
2024-11-04 17:42:01 +02:00
a82f00cb70 BAN: Fix HashMap::{insert,emplace}_or_assign to actually assing value
I seemed to completely forgotten to do the assignment itself :D
2024-11-04 15:42:04 +02:00
f4be37700f Kernel/userspace: rework floating point math
SSE is now unconditionally enabled any where and most of math.h is now
actually implemented. using __builtin_<func> lead to many hangs where
the builtin function would just call itself.
2024-11-03 20:28:15 +02:00
07275ecb5f BAN: Implement floating point constants in Numbers.h 2024-11-03 20:19:45 +02:00
ddd3b4c093 BAN: Implement is_pod type traits 2024-10-17 01:35:42 +03:00
3a6fc4c197 BAN: Add proper error messages for MUST() in userspace 2024-10-17 01:32:55 +03:00
dab6e5a60f BAN: Cleanup HashMap implementation and add {insert,emplace}_or_assign 2024-10-13 22:00:16 +03:00
0b05e9827b BAN: Use memmove instead of memcpy on overlapping data
I was accidentally using memcpy where memmove was needed
2024-10-13 22:00:16 +03:00
1c1a76d6d7 BAN: Member function pointers now use references instead of pointers
This seems cleaner as class pointer cannot be null anymore
2024-10-13 22:00:16 +03:00
df4f37d68d BAN: only define placement new operators for banan-os targets
This allows building and using BAN library outside of banan-os!
2024-10-10 21:55:25 +03:00
44629ba5dd BAN: Allow userspace to use string literals with BAN::Error 2024-10-10 21:54:52 +03:00
2da6776451 BAN: Update {Byte}Span API with better constness
const BAN::Span<int> is now allowed to modify its underlying data, but
the container itself is const.

BAN::Span<const int> can be used for spans over constant data.
2024-10-10 21:53:23 +03:00
a68f411024 BAN: Add requires clauses for Container::emplace{,_back} functions
This allows syntax highlighters to report errors!
2024-10-10 21:51:44 +03:00
f432d3fcf8 BAN: Cleanup Optional casting for value getters 2024-10-07 01:44:44 +03:00
6f90974896 BAN: Fix StringView::starts_with
I have no idea what i had been thinking when writing this code :D
2024-10-06 06:23:25 +03:00
dce2436b2c BAN: Implement Vector::reverse() 2024-09-14 19:44:20 +03:00
f30947336a BuildSystem: Cleanup cmake files 2024-09-05 12:52:25 +03:00
c4dadd27ac BAN: Fix refenrece -> reference typo 2024-09-03 16:39:21 +03:00
8a2a444f33 BAN: Make formatting functions inline 2024-08-14 20:26:55 +03:00
fd018b32d0 BAN: Implement GUID::to_string 2024-08-14 13:23:27 +03:00
e000c7d818 BAN: Use static_cast instead of C-style cast in RefPtr deletion 2024-08-14 13:23:27 +03:00
819c130366 BAN: If format string is started with space, numbers are padded with it 2024-07-19 21:39:31 +03:00
fd8dc03ae9 BAN: Default initialize optional storage
This removes maybe uninitialized warning when using default initialized
optionals.
2024-07-16 11:19:16 +03:00
442ea8a692 BAN: Remove Optional emplace constructor
This was kind breaking some initializations. Emplacing is still possible
through Optional::emplace
2024-07-14 01:53:50 +03:00
110a45bee6 BAN: Implement Variant::has_value() and Variant::operator bool() 2024-07-12 20:37:56 +03:00
62003d96f3 BAN: Implement Optional::value_or
This will return value specified in the argument if optional is not
storing any value.
2024-07-12 11:22:10 +03:00
010c2c934b BAN: Write RefPtr and WeakPtr to be thread safe 2024-06-28 22:00:29 +03:00
48a76426e7 BAN: Add more APIs for Atomic and make compare_exchage take a reference 2024-06-28 21:47:47 +03:00
44c7fde2f7 BAN: Fix Function requires clause argument forwariding 2024-06-27 00:33:50 +03:00
3c57e05a65 BAN: Implement hash for StringView 2024-06-25 19:28:45 +03:00
1ac7629459 BAN: Implement StringView::rfind() 2024-06-25 11:04:03 +03:00
67dfe0bcf3 BAN: Allow String::formatted to fail 2024-06-25 11:04:03 +03:00
b1869bced4 BAN: Implement StringView::starts_with() 2024-06-25 11:04:03 +03:00
9e1b5cbaab BuildSystem: Cleanup CMake code to allow libc only installation
There was no way to just install libc which is required for stdlibc++
2024-06-21 01:45:14 +03:00
30fdc2198f BAN: Add exchage() to Atomic<T> 2024-06-20 13:24:42 +03:00
ad6d95ba52 BuildSystem: Rework the whole cmake build system
Now files are installed using the install() command instead of manually
copying files to their destinations. This allows automatic recompilation
of headers that did not work previously
2024-06-19 09:40:03 +03:00
318ce5dec8 All: Fix a lot of compiler warnings from header files
While reworking build system, header files started to report warnings.
2024-06-18 23:02:10 +03:00
f233715b70 BAN: Add d{print,want,error}ln_if macros for userspace 2024-06-18 02:35:45 +03:00