Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bit: Add bswap() overloads for every primitive type | Tavian Barnes | 5 days | 1 | -9/+34 |
| | | | | Fixes: https://github.com/tavianator/bfs/issues/145 | ||||
* | build: Move feature test macros to prelude.h | Tavian Barnes | 2024-08-28 | 1 | -2/+0 |
| | | | | | | This replaces the explicit CPPFLAGS list in flags.mk with just `-include src/prelude.h`, shortening our compiler command lines and allowing them to be easily documented. | ||||
* | prelude: Split bfs-specific utilities into new bfs.h header | Tavian Barnes | 2024-08-28 | 1 | -0/+3 |
| | |||||
* | prelude: Rely more on __has_include() | Tavian Barnes | 2024-08-28 | 1 | -1/+1 |
| | | | | | Rather than a bunch of manual fallback macros, just provide a fallback definition that returns false. | ||||
* | bit: Use <stdbit.h> if it exists, even without -std=c23 | Tavian Barnes | 2024-05-29 | 1 | -3/+3 |
| | | | | glibc added an implementation in 2.39. | ||||
* | bit: Update to match C23 | Tavian Barnes | 2024-05-29 | 1 | -51/+45 |
| | | | | | | | | | | Based on the latest C23 draft (N3220): - Argument types to generic bit functions should be unsigned - Bit functions return unsigned int - Byte-swapping functions (stdc_memreverse8*()) weren't added - stdc_rotate_{left,right}() weren't added - first_leading_*() counts from the *left* | ||||
* | Rename config.h to prelude.h | Tavian Barnes | 2024-04-19 | 1 | -1/+1 |
| | |||||
* | bit: Check __BYTE_ORDER__ for the native endian | Tavian Barnes | 2024-03-21 | 1 | -2/+2 |
| | | | | __ORDER_NATIVE_ENDIAN__ is not a thing. | ||||
* | bit: Rename bswap{16,32,64}() | Tavian Barnes | 2024-01-03 | 1 | -16/+16 |
| | | | | | NetBSD already defines this in <sys/bswap.h>, so pick names that don't conflict. | ||||
* | bit: Implement a branchless has_single_bit() | Tavian Barnes | 2023-11-13 | 1 | -1/+2 |
| | |||||
* | Revert "bit: Implement a branchless has_single_bit()" | Tavian Barnes | 2023-11-11 | 1 | -2/+1 |
| | | | | | | Doesn't work for the highest bit due to overflow. This reverts commit 208376ef99da243545efcd6fb02d3469b4c068ed. | ||||
* | bit: Implement a branchless has_single_bit() | Tavian Barnes | 2023-11-10 | 1 | -1/+2 |
| | |||||
* | config: Add constants for C standard versions | Tavian Barnes | 2023-11-10 | 1 | -4/+4 |
| | |||||
* | bit: Fix UINTPTR_WIDTH typo | Tavian Barnes | 2023-09-26 | 1 | -1/+1 |
| | |||||
* | bit: Use predefined __*_WIDTH__ macros if we can | Tavian Barnes | 2023-09-26 | 1 | -24/+69 |
| | |||||
* | bit: Add a cast to squelch -Wsign-compare | Tavian Barnes | 2023-07-24 | 1 | -1/+1 |
| | | | | I see this only with musl-gcc for some reason. | ||||
* | bit: Rename int.h to bit.h | Tavian Barnes | 2023-05-18 | 1 | -0/+355 |