| 1 |
# c-stdaux - Auxiliary macros and functions for the C standard library |
| 2 |
|
| 3 |
## CHANGES WITH 1.4.0: |
| 4 |
|
| 5 |
* New compiler-builtin c_assume_aligned() allows hinting alignment |
| 6 |
to the compiler and thus improving code generation. For targets |
| 7 |
without such builtins, the function will be a no-op. |
| 8 |
|
| 9 |
* A new set of memory-load operations is added: c_load_*() |
| 10 |
This includes support for reading unaligned & aligned memory, |
| 11 |
big-endian & little-endian data, and various standard sizes. |
| 12 |
The helpers are basically a pointer cast to `uintX_t*` and a |
| 13 |
dereference operation, but they guarantee that strict aliasing |
| 14 |
rules, as well as alignment requirements are followed. |
| 15 |
|
| 16 |
Contributions from: David Rheinsberg, Jan Engelhardt, Tom Gundersen |
| 17 |
|
| 18 |
- Dußlingen, 2023-01-12 |
| 19 |
|
| 20 |
## CHANGES WITH 1.3.0: |
| 21 |
|
| 22 |
* Microsoft Windows is now supported as a target platform. |
| 23 |
|
| 24 |
* The `C_COMPILER_*` and `C_OS_*` pre-processor constants now |
| 25 |
allow identifying the used compiler as well as the target OS. |
| 26 |
|
| 27 |
* The new `_c_always_inline_` annotation allows telling compilers |
| 28 |
to inline a function unless technically not possible. |
| 29 |
|
| 30 |
* Split c-stdaux.h into modules and include them from the root |
| 31 |
header for backwards compatibility. Inclusion of the new modules |
| 32 |
is guarded by the `C_COMPILER_*` and `C_OS_*` macros to prevent |
| 33 |
them from being used on unspported platforms. A direct include |
| 34 |
of the respective modules allows overriding that behavior. |
| 35 |
|
| 36 |
The new modules provide the same functionality as before on the |
| 37 |
previously supported linux platforms. With the support of other |
| 38 |
platforms, individual modules might not be available, or generic |
| 39 |
functions might provide a stub that provides the same runtime |
| 40 |
behavior, but possibly with fewer diagnostics. |
| 41 |
|
| 42 |
* Rework `c_assert()` to avoid context-expressions and instead use |
| 43 |
the ternary-operator to check for the assertion. |
| 44 |
|
| 45 |
* Improve `c_{un,}likely()` to support constant-folding as well as |
| 46 |
-Wparantheses diagnostics if supported by the compiler. This adds |
| 47 |
`_c_boolean_expr_()` as a helper to achieve this. |
| 48 |
|
| 49 |
Contributions from: David Rheinsberg, Thomas Haller |
| 50 |
|
| 51 |
- Dußlingen, 2022-12-15 |
| 52 |
|
| 53 |
## CHANGES WITH 1.2.0: |
| 54 |
|
| 55 |
* Add c_memcmp() as a safe wrapper around memcmp(3) that supports |
| 56 |
empty arenas as NULL pointers. |
| 57 |
|
| 58 |
* Add an API documentation renderer based on the sphinx docutils |
| 59 |
suite. The documentation is available on readthedocs.org. |
| 60 |
|
| 61 |
* Drop stdatomic.h from the public includes. This was not used by |
| 62 |
any of the dependent projects, but breaks builds on older GCC |
| 63 |
compilers. While this is technically an API break, no breakage |
| 64 |
has been discovered in our tests, and thus we deemed it reasonable |
| 65 |
to proceed without version bump. |
| 66 |
|
| 67 |
Contributions from: David Rheinsberg, Thomas Haller |
| 68 |
|
| 69 |
- Dußlingen, 2022-07-22 |
| 70 |
|
| 71 |
## CHANGES WITH 1.1.0: |
| 72 |
|
| 73 |
* Add c_memcpy() as a safe wrapper around memcpy(3) that supports |
| 74 |
empty arenas as NULL pointers. |
| 75 |
|
| 76 |
* Support building on MacOS-X. |
| 77 |
|
| 78 |
* Rework the apidoc comments and properly document the entire API. |
| 79 |
|
| 80 |
* Export 'version-scripts' configuration variable alongside the |
| 81 |
existing 'cflags' variable. It defines whether c-stdaux was built |
| 82 |
with GNU-linker version-scripts, or not. Dependent projects can |
| 83 |
use this to decide whether to use version-scripts or not. |
| 84 |
Additionally, the new 'version-scripts' meson-option allows |
| 85 |
specifying whether to use version-scripts, auto-detect whether to |
| 86 |
enable it, or disable it. |
| 87 |
|
| 88 |
* Fix the export of `cflags` to also be exported in pkg-config, not |
| 89 |
just meson subprojects. |
| 90 |
|
| 91 |
* Avoid NULL-pointers in compile-time macros. This silences possible |
| 92 |
false-positives from code sanitizers that otherwise trip over the |
| 93 |
NULL pointer dereferences. |
| 94 |
|
| 95 |
Contributions from: David Rheinsberg, Evgeny Vereshchagin |
| 96 |
|
| 97 |
- Brno, 2022-06-22 |
| 98 |
|
| 99 |
## CHANGES WITH 1.0.0: |
| 100 |
|
| 101 |
* Initial release of c-stdaux. |
| 102 |
|
| 103 |
Contributions from: David Rheinsberg, Lorenzo Arena, Michele Dionisio, |
| 104 |
Yuri Chornoivan |
| 105 |
|
| 106 |
- Dußlingen, 2022-05-12 |