Add include guards

This commit is contained in:
Juhani Krekelä 2018-08-11 10:37:24 +03:00
parent 3ba365f113
commit 15eda1ea7b
1 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,6 @@
#ifndef __CMAYBE_H__
#define __CMAYBE_H__
#define MAYBE_TYPE(name, type) struct maybe_##name {type value; char is_value;}
#define MAYBE(name) struct maybe_##name
@ -15,3 +18,5 @@
#define IS_VALUE(x) if((x).is_value)
#define IS_NOT_VALUE(x) if(!(x).is_value)
#define VALUE(x) (x).value
#endif