Derive-C
Loading...
Searching...
No Matches
reflect.h
Go to the documentation of this file.
1#pragma once
2
3#include <inttypes.h> // NOLINT(misc-include-cleaner)
4#include <stddef.h> // NOLINT(misc-include-cleaner)
5#include <stdint.h> // NOLINT(misc-include-cleaner)
6#include <sys/types.h> // NOLINT(misc-include-cleaner)
7
10// clang-format off
11#define DC_STD_REFLECT(F, ...) \
12 /* character types */ \
13 F(char, "%c" , __VA_ARGS__) \
14 /* floating point types */ \
15 F(float, "%f" , __VA_ARGS__) \
16 F(double, "%lf" , __VA_ARGS__) \
17 /* integer + pointer types */ \
18 F(int8_t, "%" PRId8 , __VA_ARGS__) \
19 F(uint8_t, "%" PRIu8 , __VA_ARGS__) \
20 F(int16_t, "%" PRId16 , __VA_ARGS__) \
21 F(uint16_t, "%" PRIu16 , __VA_ARGS__) \
22 F(int32_t, "%" PRId32 , __VA_ARGS__) \
23 F(uint32_t, "%" PRIu32 , __VA_ARGS__) \
24 F(int64_t, "%" PRId64 , __VA_ARGS__) \
25 F(uint64_t, "%" PRIu64 , __VA_ARGS__)
26// clang-format on