1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

11 Commits

Author SHA1 Message Date
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
Marian Buschsieweke
9723a8d5f4
sys/endian: move form sys/libc
Move the <endian.h> header from `sys/libc/include` to `sys/include`.
2024-01-31 20:14:46 +01:00
Marian Buschsieweke
10e896390d
sys/libc/endian.h: fix compilation with older newlib
Older versions of newlib already provide the magic endian numbers
via `machine/endian.h`, which may be indirectly included. This changes
the header to only provide the macros if the are not provided otherwise.
For sanity, it checks if the values are indeed the expected magic
numbers, even if provided from other sources.
2024-01-31 14:50:36 +01:00
Marian Buschsieweke
0d01356c9c
sys/libc/endian: fix compilation on AVR
There is no need to use `__uint16_t` instead of `uint16_t` etc., so
let's just go with `uint16_t` and have AVR GCC happy.
2024-01-31 14:46:24 +01:00
Marian Buschsieweke
e5f69206ad
sys/libc/endian.h: fix magic constants
The constants BIG_ENDIAN etc. were not consistently defined. This
bug was not caught by the unit tests, as the preprocessor would
treat undefined macros as being `0` in numeric comparisons, hence
the following test did select the correct implementation:

```C
#if BYTE_ORDER == LITTLE_ENDIAN
/* correct implementation for all currently supported boards */
#endif
```

This adds now an explicit test to the unit tests to ensure that the
magic numbers are consistently the correct values. Hence, this bug
should no longer be able to sneak in.

Co-authored-by: Teufelchen <9516484+Teufelchen1@users.noreply.github.com>
2024-01-31 14:46:24 +01:00
Marian Buschsieweke
68018fe182
sys/libc: add endian.h
This provides glibc, NetBSD, FreeBSD compatible endian.h header with a
lean and simple API to convert between host byte order to little endian
and big endian and the other way around.
2024-01-30 10:59:28 +01:00
Benjamin Valentin
c57b13f1e8 sys/string_utils: add memchk()
Check if all bytes in a buffer are set to s certain value - inverse
of memset().
2023-05-30 20:39:10 +02:00
Benjamin Valentin
cdaf715a84 sys/string_utils: add strscpy() 2022-09-26 19:06:46 +02:00
0fcc7d3834 cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
Hauke Petersen
e93189288a sys/libc/uio.h: added include of stdlib for size_t 2015-08-12 18:25:24 +02:00
7acc4141ce sys: add libc includes directory and sys/uio.h header 2015-07-13 13:36:18 +02:00