GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing codebrowser.dev — typecheck.h source code [linux/include/linux/typecheck.h] - Codebrowser

Codebrowser logo
About
Contact
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef TYPECHECK_H_INCLUDED
3#define TYPECHECK_H_INCLUDED
4
5/*
6 * Check at compile time that something is of a particular type.
7 * Always evaluates to 1 so you may use it easily in comparisons.
8 */
9#define typecheck(type,x) \
10({ type __dummy; \
11 typeof(x) __dummy2; \
12 (void)(&__dummy == &__dummy2); \
13 1; \
14})
15
16/*
17 * Check at compile time that 'function' is a certain type, or is a pointer
18 * to that type (needs to use typedef for the function type.)
19 */
20#define typecheck_fn(type,function) \
21({ typeof(type) __tmp = function; \
22 (void)__tmp; \
23})
24
25/*
26 * Check at compile time that something is a pointer type.
27 */
28#define typecheck_pointer(x) \
29({ typeof(x) __dummy; \
30 (void)sizeof(*__dummy); \
31 1; \
32})
33
34#endif /* TYPECHECK_H_INCLUDED */
35

source code of linux/include/linux/typecheck.h

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.