Whoops missed some
This commit is contained in:
parent
8a8a1b7ad7
commit
72689a1b24
1 changed files with 8 additions and 8 deletions
16
cmaybe.h
16
cmaybe.h
|
@ -1,18 +1,18 @@
|
|||
#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
|
||||
#define MAYBE_TYPE(name, type) struct cmaybe_maybe_##name {type value; char is_value;}
|
||||
#define MAYBE(name) struct cmaybe_maybe_##name
|
||||
|
||||
#define ENABLE_RETURN(name) MAYBE(name) _return_value
|
||||
#define ENABLE_RETURN(name) MAYBE(name) cmaybe_return_value
|
||||
#define RETURN_VALUE(x) do {\
|
||||
_return_value.is_value = 1;\
|
||||
_return_value.value = x;\
|
||||
return _return_value;\
|
||||
cmaybe_return_value.is_value = 1;\
|
||||
cmaybe_return_value.value = x;\
|
||||
return cmaybe_return_value;\
|
||||
} while(0)
|
||||
#define RETURN_NOTHING() do {\
|
||||
_return_value.is_value = 0;\
|
||||
return _return_value;\
|
||||
cmaybe_return_value.is_value = 0;\
|
||||
return cmaybe_return_value;\
|
||||
} while(0)
|
||||
|
||||
#define IS_VALUE(x) if ((x).is_value)
|
||||
|
|
Loading…
Reference in a new issue