1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00
damus/nostrdb/flatcc/portable
William Casarin 6863e74c0f nostrdb: fix japanese profile names not loading
update flatcc, including the patch that fixes japanese usenames

Changelog-Fixed: Fix japanese profiles names not loading
2023-11-02 10:20:40 +09:00
..
include nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
grisu3_math.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
grisu3_parse.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
grisu3_print.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
LICENSE nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
paligned_alloc.h nostrdb: fix japanese profile names not loading 2023-11-02 10:20:40 +09:00
pattributes.h nostrdb: fix japanese profile names not loading 2023-11-02 10:20:40 +09:00
pbase64.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pcrt.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pdiagnostic_pop.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pdiagnostic_push.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pdiagnostic.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pendian_detect.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pendian.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pinline.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pinttypes.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
portable_basic.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
portable.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pparsefp.h nostrdb: fix japanese profile names not loading 2023-11-02 10:20:40 +09:00
pparseint.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pprintfp.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pprintint.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pstatic_assert_scope.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pstatic_assert.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pstdalign.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pstdbool.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pstdint.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
punaligned.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pversion.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
pwarnings.h nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
README.md nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00

A small library for adding C11 compatibility to older C compilers, but only a small highly useful subset such as static assertions, inline functions and alignment.

C++ is not a primary target, but the library has been updated to be more C++ friendly based on user feedback.

Many compilers already have the required functionality but with slightly different names and arguments.

In addition, compatibility with the Linux <endian.h> system file is provided, and "punaligned.h" is provided for unaligned memory reads which in part depends on endian support.

The library also provides fast integer printing and floating point printing and parsing optionally using the grisu3 algorithm, but can fall back to strtod and related. The pgrisu3 folder is header only and excludes test cases found in the main grisu3 project the files were extracted from. Base64 conversion is also provided.

Integer conversion is not just an optimization. It is more difficult than it would appear to portably parse an integer of known size such as uint64_t up to at most n bytes which is needed for safe parsing. At the same time, the sometimes significant performance gains warrants custom implementations that might as well be done once and for all.

Files can be included individually, or portable.h may be included to get all functionality. If the compiler is C11 compliant, portable.h will not include anything, except: it will provide a patch for static assertions which clang does not fully support in all versions even with C11 flagged.

The grisu3 header files are the runtime files for the Grisu3 floating point conversion to/from text C port. Test coverage is provided separately. This library can be used indirectly via pparsefp.h and pprintfp.h.

The pstatic_assert.h file is often needed on C11 systems because the compiler and standard library may support _Static_assert without static_assert. For compilers without _Static_assert, a unique identifier is needed for each assertion. This is done non-standard with the __COUNTER__ macro, but has a fallback to pstatic_assert_scope.h for systems witout the __COUNTER__ macro. Because of this fallback, pstatic_assert.h needs to be included in every file using static_assert in order to increment a scope counter, otherwise there is a risk of assert identifier conflicts when static_assert happen on the same line in different files.

The paligned_alloc.h file implements the non-standard aligned_free to match the C11 standard aligned_alloc call. aligned_free is normally equivalent to free, but not on systems where aligned_free cannot be implemented using a system provived free call. Use of aligned_free is thus optional on some systems, but using it increases general portablity at the cost of pure C11 compatibility.

IMPORTANT NOTE: this library has been used on various platforms and updated with user feedback but it is impossibly to systematically test all platforms so please test for specific uses cases and report any issues upstream.