-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 105782 b: refs/heads/master c: e0deaff h: refs/heads/master v: v3
- Loading branch information
Andrew Morton
authored and
Linus Torvalds
committed
Jul 25, 2008
1 parent
ce26347
commit 21e5da4
Showing
3 changed files
with
26 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 5df439ef06d4173357711a04740aa8bfcf50d621 | ||
refs/heads/master: e0deaff470900a4c3222ca7139f6c9639e26a2f5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef TYPECHECK_H_INCLUDED | ||
#define TYPECHECK_H_INCLUDED | ||
|
||
/* | ||
* Check at compile time that something is of a particular type. | ||
* Always evaluates to 1 so you may use it easily in comparisons. | ||
*/ | ||
#define typecheck(type,x) \ | ||
({ type __dummy; \ | ||
typeof(x) __dummy2; \ | ||
(void)(&__dummy == &__dummy2); \ | ||
1; \ | ||
}) | ||
|
||
/* | ||
* Check at compile time that 'function' is a certain type, or is a pointer | ||
* to that type (needs to use typedef for the function type.) | ||
*/ | ||
#define typecheck_fn(type,function) \ | ||
({ typeof(type) __tmp = function; \ | ||
(void)__tmp; \ | ||
}) | ||
|
||
#endif /* TYPECHECK_H_INCLUDED */ |