1
0
Fork 0
mirror of https://github.com/tailix/libclayer.git synced 2024-11-20 11:06:24 -05:00
libclayer/examples/macro_packing.c

26 lines
363 B
C
Raw Normal View History

2022-12-25 03:58:00 -05:00
#include <kernaux/macro.h>
#include <assert.h>
#include <stdint.h>
struct Foo {
uint8_t a;
uint32_t b;
};
#include <kernaux/macro/packing_start.run>
struct Bar {
uint8_t a;
uint32_t b;
}
KERNAUX_PACKED;
#include <kernaux/macro/packing_end.run>
void example_main()
{
assert(sizeof(struct Foo) > 5);
assert(sizeof(struct Bar) == 5);
}