diff options
Diffstat (limited to 'zap/source/any')
-rw-r--r-- | zap/source/any/bs/trap.c | 2 | ||||
-rw-r--r-- | zap/source/any/math/abs.cc | 13 | ||||
-rw-r--r-- | zap/source/any/math/divmod.cc | 12 | ||||
-rw-r--r-- | zap/source/any/mem/cp.c | 2 | ||||
-rw-r--r-- | zap/source/any/str/fmt.cc | 4 | ||||
-rw-r--r-- | zap/source/any/str/fmtlen.cc | 6 | ||||
-rw-r--r-- | zap/source/any/str/numdig.hh | 2 | ||||
-rw-r--r-- | zap/source/any/sys/syscall.c | 11 |
8 files changed, 38 insertions, 14 deletions
diff --git a/zap/source/any/bs/trap.c b/zap/source/any/bs/trap.c index 552572d..307a7f0 100644 --- a/zap/source/any/bs/trap.c +++ b/zap/source/any/bs/trap.c @@ -6,7 +6,7 @@ #include <zap/bs.h> -void zap_priv_trap(void) { +void zap_trap(void) { #if zap_priv_hasbuiltin(__builtin_trap) __builtin_trap(); #endif diff --git a/zap/source/any/math/abs.cc b/zap/source/any/math/abs.cc new file mode 100644 index 0000000..65e5a22 --- /dev/null +++ b/zap/source/any/math/abs.cc @@ -0,0 +1,13 @@ +/* + Copyright 2022-2023 Gabriel Jensen. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. +*/ + +#include <zap/math.hh> + +extern "C" { + zap_attr_nthrw float zap_absf( float const val) {return ::zap::abs(val);} + zap_attr_nthrw double zap_absd( double const val) {return ::zap::abs(val);} + zap_attr_nthrw long double zap_absld(long double const val) {return ::zap::abs(val);} +} diff --git a/zap/source/any/math/divmod.cc b/zap/source/any/math/divmod.cc index 77523f8..f117013 100644 --- a/zap/source/any/math/divmod.cc +++ b/zap/source/any/math/divmod.cc @@ -4,12 +4,12 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zap/math.h> +#include <zap/math.hh> extern "C" { - zap_priv_nothrw auto zap_divmodsc(signed char const num,signed char const den) -> ::zap_pairsc {return ::zap::divmod(num,den).cpair();} - zap_priv_nothrw auto zap_divmods( short const num,short const den) -> ::zap_pairs {return ::zap::divmod(num,den).cpair();} - zap_priv_nothrw auto zap_divmodi( int const num,int const den) -> ::zap_pairi {return ::zap::divmod(num,den).cpair();} - zap_priv_nothrw auto zap_divmodl( long const num,long const den) -> ::zap_pairl {return ::zap::divmod(num,den).cpair();} - zap_priv_nothrw auto zap_divmodll(long long const num,long long const den) -> ::zap_pairll {return ::zap::divmod(num,den).cpair();} + zap_attr_nthrw auto zap_divmodsc(signed char const num,signed char const den) -> ::zap_pairsc {return ::zap::divmod(num,den).cpair();} + zap_attr_nthrw auto zap_divmods( short const num,short const den) -> ::zap_pairs {return ::zap::divmod(num,den).cpair();} + zap_attr_nthrw auto zap_divmodi( int const num,int const den) -> ::zap_pairi {return ::zap::divmod(num,den).cpair();} + zap_attr_nthrw auto zap_divmodl( long const num,long const den) -> ::zap_pairl {return ::zap::divmod(num,den).cpair();} + zap_attr_nthrw auto zap_divmodll(long long const num,long long const den) -> ::zap_pairll {return ::zap::divmod(num,den).cpair();} } diff --git a/zap/source/any/mem/cp.c b/zap/source/any/mem/cp.c index 12c6bfd..f0de644 100644 --- a/zap/source/any/mem/cp.c +++ b/zap/source/any/mem/cp.c @@ -6,7 +6,7 @@ #include <zap/mem.h> -void * zap_cp(void * const zap_priv_restr voiddest,void const * const zap_priv_restr voidsrc,zap_sz const num) { +void * zap_cp(void * const zap_restr voiddest,void const * const zap_restr voidsrc,zap_sz const num) { unsigned char * dest = voiddest; unsigned char const * src = voidsrc; unsigned char * const stop = dest + num; diff --git a/zap/source/any/str/fmt.cc b/zap/source/any/str/fmt.cc index b2c0c75..ff6edb1 100644 --- a/zap/source/any/str/fmt.cc +++ b/zap/source/any/str/fmt.cc @@ -4,13 +4,13 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zap/str.h> +#include <zap/str.hh> #include "numdig.hh" namespace zap { namespace impl { - template<typename signtyp> zap_priv_inln inline static auto fmt(::zap::i02 * buf,signtyp signval,::zap::i8 const bs,::zap::i8 const rtl) noexcept -> void { + template<typename signtyp> zap_attr_iln inline static auto fmt(::zap::i02 * buf,signtyp signval,::zap::i8 const bs,::zap::i8 const rtl) noexcept -> void { using typ = typename ::zap::usign<signtyp>; char32_t const * digs = U"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (bs == 0xCu) digs = U"0123456789\u218A\u218B"; diff --git a/zap/source/any/str/fmtlen.cc b/zap/source/any/str/fmtlen.cc index 866d011..b5e508c 100644 --- a/zap/source/any/str/fmtlen.cc +++ b/zap/source/any/str/fmtlen.cc @@ -4,14 +4,14 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zap/math.h> -#include <zap/str.h> +#include <zap/math.hh> +#include <zap/str.hh> #include "numdig.hh" namespace zap { namespace impl { - template<typename typ> zap_priv_inln inline static auto fmtlen(typ val,::zap::i8 const bs) noexcept -> ::zap::i8 { + template<typename typ> zap_attr_iln inline static auto fmtlen(typ val,::zap::i8 const bs) noexcept -> ::zap::i8 { ::zap::i8 len = 0x0u; if (val < 0x0) { val = static_cast<typ>(::zap::abs(val)); diff --git a/zap/source/any/str/numdig.hh b/zap/source/any/str/numdig.hh index 65756b9..ea36f0b 100644 --- a/zap/source/any/str/numdig.hh +++ b/zap/source/any/str/numdig.hh @@ -2,7 +2,7 @@ namespace zap { namespace impl { - template<typename typ> zap_priv_inln inline static auto numdig(typ fmtval,::zap::i8 const bs) noexcept -> ::zap::i8 { + template<typename typ> zap_attr_iln inline static auto numdig(typ fmtval,::zap::i8 const bs) noexcept -> ::zap::i8 { ::zap::i8 len = 0x0u; if (fmtval == typ {0x0}) return 0x1u; for (typ val = fmtval;val > 0x0;val /= static_cast<typ>(bs)) ++len; diff --git a/zap/source/any/sys/syscall.c b/zap/source/any/sys/syscall.c new file mode 100644 index 0000000..46d1074 --- /dev/null +++ b/zap/source/any/sys/syscall.c @@ -0,0 +1,11 @@ +/* + Copyright 2022-2023 Gabriel Jensen. + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. +*/ + +#include <zap/str.h> + +void zap_syscall(unsigned long,...) { + zap_trap(); // Unsupported. +} |