xref: /freebsd/contrib/openbsm/compat/compat.h (revision b626f5a73a48f44a31a200291b141e1da408a2ff)
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 
30*aa772005SRobert Watson #ifndef	_COMPAT_H_
31*aa772005SRobert Watson #define	_COMPAT_H_
32*aa772005SRobert Watson 
33*aa772005SRobert Watson #include <sys/types.h>
34*aa772005SRobert Watson #include <sys/socket.h>
35*aa772005SRobert Watson 
36*aa772005SRobert Watson #ifndef MSG_NOSIGNAL
37*aa772005SRobert Watson #define	MSG_NOSIGNAL	0
38*aa772005SRobert Watson #endif
39*aa772005SRobert Watson 
40*aa772005SRobert Watson #ifndef	__unused
41*aa772005SRobert Watson #define	__unused	__attribute__((__unused__))
42*aa772005SRobert Watson #endif
43*aa772005SRobert Watson 
44*aa772005SRobert Watson #ifndef	__packed
45*aa772005SRobert Watson #define	__packed	__attribute__((__packed__))
46*aa772005SRobert Watson #endif
47*aa772005SRobert Watson 
48*aa772005SRobert Watson #ifndef __dead2
49*aa772005SRobert Watson #define	__dead2	__attribute__((__noreturn__))
50*aa772005SRobert Watson #endif
51*aa772005SRobert Watson 
52*aa772005SRobert Watson #ifndef __printflike
53*aa772005SRobert Watson #define	__printflike(fmtarg, firstvararg)	\
54*aa772005SRobert Watson 	__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
55*aa772005SRobert Watson #endif
56*aa772005SRobert Watson 
57*aa772005SRobert Watson #endif	/* !_COMPAT_H_ */
58