diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-19 18:15:52 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-20 12:01:56 -0400 |
| commit | 9cd55867de91013bdbfe0d73112df504eb7963ba (patch) | |
| tree | 35c7d25805c10a61dd65bd80febedb81e82c50bf /pk.h.in | |
| parent | bc7e78b1766e8d9c9af1d47c207d084e161db98d (diff) | |
pkuuid.h: first-pass + bump version to 0.4.1
Diffstat (limited to 'pk.h.in')
| -rw-r--r-- | pk.h.in | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -184,6 +184,24 @@ * `pk_tmr.e` end the end time. * You could then call the `pk_tmr_duration...` convenience macros as needed. * +******************************************************************************** +* pkuuid.h: define PK_IMPL_UUID before including pk.h to enable ad-hoc. +* +* Provides a 16-byte unsigned char array struct for uuids. +* +* The following definitions (shown with defaults) can be overridden: +* PK_UUID_CLOCK CLOCK_TAI (preferred, if available) +* PK_UUID_CLOCK CLOCK_REALTIME (fallback) +* +* The `PK_UUID_CLOCK` macro has minimal built-in fallback logic. +* The uuidv7 specification states that the timestamp portion of the uuid must be +* a unix epoch, leap seconds EXCLUDED. Only `CLOCK_TAI` meets this requirement +* on Linux. +* +* Note that this currectly calls `srand()` once at startup, and calls `rand()` +* 2 times for each uuidv7 to fill 74 bits with random data (with an XOR for the +* remaining 10 bits). +* *******************************************************************************/ #define PK_VERSION "@@PK_VERSION@@" @@ -207,4 +225,7 @@ # ifndef PK_IMPL_STN # define PK_IMPL_STN # endif +# ifndef PK_IMPL_UUID +# define PK_IMPL_UUID +# endif #endif |
