xref: /freebsd/contrib/openbsm/compat/compat.h (revision aa77200569e397d6ff1fdb4d255d0fa254d0a128)
1*aa772005SRobert Watson /*-
2*aa772005SRobert Watson  * Copyright (c) 2012 The FreeBSD Foundation
3*aa772005SRobert Watson  * All rights reserved.
4*aa772005SRobert Watson  *
5*aa772005SRobert Watson  * This software was developed by Pawel Jakub Dawidek under sponsorship from
6*aa772005SRobert Watson  * the FreeBSD Foundation.
7*aa772005SRobert Watson  *
8*aa772005SRobert Watson  * Redistribution and use in source and binary forms, with or without
9*aa772005SRobert Watson  * modification, are permitted provided that the following conditions
10*aa772005SRobert Watson  * are met:
11*aa772005SRobert Watson  * 1. Redistributions of source code must retain the above copyright
12*aa772005SRobert Watson  *    notice, this list of conditions and the following disclaimer.
13*aa772005SRobert Watson  * 2. Redistributions in binary form must reproduce the above copyright
14*aa772005SRobert Watson  *    notice, this list of conditions and the following disclaimer in the
15*aa772005SRobert Watson  *    documentation and/or other materials provided with the distribution.
16*aa772005SRobert Watson  *
17*aa772005SRobert Watson  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18*aa772005SRobert Watson  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*aa772005SRobert Watson  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*aa772005SRobert Watson  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21*aa772005SRobert Watson  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*aa772005SRobert Watson  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*aa772005SRobert Watson  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*aa772005SRobert Watson  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*aa772005SRobert Watson  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*aa772005SRobert Watson  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*aa772005SRobert Watson  * SUCH DAMAGE.
28*aa772005SRobert Watson  *
29*aa772005SRobert Watson  * $P4: //depot/projects/trustedbsd/openbsm/compat/compat.h#1 $
30*aa772005SRobert Watson  */
31*aa772005SRobert Watson 
32*aa772005SRobert Watson #ifndef	_COMPAT_H_
33*aa772005SRobert Watson #define	_COMPAT_H_
34*aa772005SRobert Watson 
35*aa772005SRobert Watson #include <sys/types.h>
36*aa772005SRobert Watson #include <sys/socket.h>
37*aa772005SRobert Watson 
38*aa772005SRobert Watson #ifndef MSG_NOSIGNAL
39*aa772005SRobert Watson #define	MSG_NOSIGNAL	0
40*aa772005SRobert Watson #endif
41*aa772005SRobert Watson 
42*aa772005SRobert Watson #ifndef	__unused
43*aa772005SRobert Watson #define	__unused	__attribute__((__unused__))
44*aa772005SRobert Watson #endif
45*aa772005SRobert Watson 
46*aa772005SRobert Watson #ifndef	__packed
47*aa772005SRobert Watson #define	__packed	__attribute__((__packed__))
48*aa772005SRobert Watson #endif
49*aa772005SRobert Watson 
50*aa772005SRobert Watson #ifndef __dead2
51*aa772005SRobert Watson #define	__dead2	__attribute__((__noreturn__))
52*aa772005SRobert Watson #endif
53*aa772005SRobert Watson 
54*aa772005SRobert Watson #ifndef __printflike
55*aa772005SRobert Watson #define	__printflike(fmtarg, firstvararg)	\
56*aa772005SRobert Watson 	__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
57*aa772005SRobert Watson #endif
58*aa772005SRobert Watson 
59*aa772005SRobert Watson #endif	/* !_COMPAT_H_ */
60