cfuncproto.h
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* cfuncproto.h --
*
* Declarations of a macro supporting Ansi-C function prototypes in
* Sprite. This macro allow function prototypes to be defined
* such that the code works on both standard and K&R C.
*
* Copyright 1990 Regents of the University of California
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies. The University of California
* makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without
* express or implied warranty.
*
* $Header: /root/leakn64/depot/rf/sw/bbplayer/simos/apps/unix/ethersim/sun/cfuncproto.h,v 1.1.1.1 2002/05/29 01:09:09 blythe Exp $ SPRITE (Berkeley)
*/
#ifndef _CFUNCPROTO
#define _CFUNCPROTO
/*
* Definition of the _ARGS_ macro. The _ARGS_ macro such be used to
* enclose the argument list of a function prototype. For example, the
* function:
* extern int main(argc, argv)
* int args;
* char **argv;
*
* Would have a prototype of:
*
* extern int main _ARGS_((int argc, char **argv))
*
* Currently the macro uses the arguments only when compiling the
* KERNEL with a standard C compiler.
*/
#ifndef _ASM
#if defined(__STDC__)
#define _HAS_PROTOTYPES
#define _HAS_VOIDPTR
#endif
#if defined(__cplusplus)
#define _EXTERN extern "C"
#define _NULLARGS (void)
#define _HAS_PROTOTYPES
#define _HAS_VOIDPTR
#define _HAS_CONST
#else
#define _EXTERN extern
#define _NULLARGS ()
#endif
#if defined(_HAS_PROTOTYPES) && !defined(lint)
#define _ARGS_(x) x
#else
#define _ARGS_(x) ()
#endif
#ifdef _HAS_CONST
#define _CONST const
#else
#define _CONST
#endif
#ifdef _HAS_VOIDPTR
typedef void *_VoidPtr;
#else
typedef char *_VoidPtr;
#endif
#endif /* _ASM */
#endif /* _CFUNCPROTO */