2019 day 5: add examples from day 2, add _stringify in br.h

This commit is contained in:
2022-09-22 10:11:24 +02:00
parent f2b32f236d
commit d1221ab086
10 changed files with 320 additions and 35 deletions

View File

@@ -18,6 +18,13 @@
#ifndef _BR_H
#define _BR_H
/* Indirect stringification. Doing two levels allows the parameter to be a
* macro itself. For example, compile with -DFOO=bar, __stringify(FOO)
* converts to "bar".
*/
#define __stringify_1(x...) #x
#define __stringify(x...) __stringify_1(x)
/* generate a (maybe) unique id.
*/
#define ___PASTE(x, y) x##y