diff options
| author | Federico Angelilli <code@fedang.net> | 2025-01-15 23:36:10 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2025-01-15 23:36:10 +0100 |
| commit | c918489f06080f732138dee07fba11f7622312a7 (patch) | |
| tree | 2c28d3fcc1c9a0ca9cf349494b5fbd2cbae81aa0 /test | |
| parent | aef37e91f4e6f7781d4f6512ffc4ddc48a687cb5 (diff) | |
Update any_log documentation
Diffstat (limited to 'test')
| -rw-r--r-- | test/log.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,5 @@ #include <stdbool.h> +#include <stdint.h> //#define ANY_LOG_LOCKING #define ANY_LOG_IMPLEMENT @@ -25,7 +26,7 @@ #define ANY_LOG_VALUE_PTR(stream, key, value) \ do { \ if (value == NULL) fprintf(stream, "\"%s\": none", key); \ - else fprintf(stream, "\"%s\": %p", key, value); \ + else fprintf(stream, "\"%s\": %lu", key, (uintptr_t)value); \ } while (false) #define ANY_LOG_VALUE_DOUBLE(stream, key, value) \ @@ -128,6 +129,7 @@ int main() "p:window", NULL, "f:scale", 1.23, "b:hidden", true, + "p:ptr", malloc(0), "g:pairs", ANY_LOG_FORMATTER(pairs_format), pairs, "appname", "nice app"); |
