1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-10-30 11:54:01 -04:00
libkernaux/include/kernaux/macro.h

39 lines
894 B
C
Raw Normal View History

#ifndef KERNAUX_INCLUDED_MACRO
#define KERNAUX_INCLUDED_MACRO
#ifdef __cplusplus
extern "C" {
#endif
2022-06-20 17:28:35 -04:00
#ifdef KERNAUX_ACCESS_PRIVATE
# define KERNAUX_PRIVATE_FIELD(id) id
# define KERNAUX_PROTECTED_FIELD(id) id
#else
2022-06-20 17:28:35 -04:00
# define KERNAUX_PRIVATE_FIELD(id) _private_##id
# ifdef KERNAUX_ACCESS_PROTECTED
# define KERNAUX_PROTECTED_FIELD(id) id
# else
# define KERNAUX_PROTECTED_FIELD(id) _protected_##id
# endif
#endif // KERNAUX_ACCESS_PRIVATE
#ifdef __TINYC__
# define KERNAUX_PACKING_ATTR
#else
# define KERNAUX_PACKING_ATTR __attribute__((packed))
#endif
#define KERNAUX_STATIC_TEST_STRUCT_SIZE(name, size) \
__attribute__((unused)) \
static const int \
_kernaux_static_test_struct_size_##name[ \
sizeof(struct name) == (size) ? 1 : -1 \
]
#ifdef __cplusplus
}
#endif
#endif