NAME
KS_PASTE,
KS_OPTIONAL —
preprocessor macros
SYNOPSIS
#include
<libks/preprocessor.h>
KS_PASTE(prefix,
suffix);
KS_OPTIONAL(optional,
fallback);
DESCRIPTION
The preprocessor macros can be used to mitigate shortcomings of the C preprocessor.
The
KS_PASTE()
macro concatenates prefix and
suffix into a single token. Both arguments are macro
expanded before being concatenated.
extern int KS_PASTE(unused_, __LINE__);
The
KS_OPTIONAL()
macro expands to optional if not empty,
fallback otherwise. Both arguments are macro expanded.
Intended to be used in conjunction with variadic macros in order to give the
optional argument a default value.
KS_OPTIONAL(1, 0); /* 1 */ KS_OPTIONAL(, 0); /* 0 */
AUTHORS
Anton Lindqvist <anton@basename.se>