| 1 | /*-
|
|---|
| 2 | * Copyright (c) 2007
|
|---|
| 3 | * Thorsten Glaser <tg@mirbsd.de>
|
|---|
| 4 | *
|
|---|
| 5 | * Provided that these terms and disclaimer and all copyright notices
|
|---|
| 6 | * are retained or reproduced in an accompanying document, permission
|
|---|
| 7 | * is granted to deal in this work without restriction, including un-
|
|---|
| 8 | * limited rights to use, publicly perform, distribute, sell, modify,
|
|---|
| 9 | * merge, give away, or sublicence.
|
|---|
| 10 | *
|
|---|
| 11 | * Advertising materials mentioning features or use of this work must
|
|---|
| 12 | * display the following acknowledgement:
|
|---|
| 13 | * This product includes material provided by Thorsten Glaser.
|
|---|
| 14 | *
|
|---|
| 15 | * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
|
|---|
| 16 | * the utmost extent permitted by applicable law, neither express nor
|
|---|
| 17 | * implied; without malicious intent or gross negligence. In no event
|
|---|
| 18 | * may a licensor, author or contributor be held liable for indirect,
|
|---|
| 19 | * direct, other damage, loss, or other issues arising in any way out
|
|---|
| 20 | * of dealing in the work, even if advised of the possibility of such
|
|---|
| 21 | * damage or existence of a defect, except proven that it results out
|
|---|
| 22 | * of said person's immediate fault when using the work as intended.
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | #ifndef COMMON_H
|
|---|
| 26 | #define COMMON_H
|
|---|
| 27 |
|
|---|
| 28 | #include <sys/types.h>
|
|---|
| 29 |
|
|---|
| 30 | #ifndef __BEGIN_DECLS
|
|---|
| 31 | #if defined(__cplusplus)
|
|---|
| 32 | #define __BEGIN_DECLS extern "C" {
|
|---|
| 33 | #define __END_DECLS }
|
|---|
| 34 | #else
|
|---|
| 35 | #define __BEGIN_DECLS
|
|---|
| 36 | #define __END_DECLS
|
|---|
| 37 | #endif
|
|---|
| 38 | #endif
|
|---|
| 39 |
|
|---|
| 40 | #ifndef __RCSID
|
|---|
| 41 | #if defined(__ELF__) && defined(__GNUC__)
|
|---|
| 42 | #define __IDSTRING(prefix, string) \
|
|---|
| 43 | __asm__(".section .comment" \
|
|---|
| 44 | "\n .ascii \"@(\"\"#)" #prefix ": \"" \
|
|---|
| 45 | "\n .asciz \"" string "\"" \
|
|---|
| 46 | "\n .previous")
|
|---|
| 47 | #else
|
|---|
| 48 | #define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p
|
|---|
| 49 | #define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p)
|
|---|
| 50 | #define __IDSTRING(prefix, string) \
|
|---|
| 51 | static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \
|
|---|
| 52 | __attribute__((used)) = "@(""#)" #prefix ": " string
|
|---|
| 53 | #endif
|
|---|
| 54 | #define __COPYRIGHT(x) __IDSTRING(copyright,x)
|
|---|
| 55 | #define __KERNEL_RCSID(n,x) __IDSTRING(rcsid_ ## n,x)
|
|---|
| 56 | #define __RCSID(x) __IDSTRING(rcsid,x)
|
|---|
| 57 | #define __SCCSID(x) __IDSTRING(sccsid,x)
|
|---|
| 58 | #endif
|
|---|
| 59 |
|
|---|
| 60 | #endif
|
|---|