2 Unix SMB/CIFS implementation.
3 Samba utility functions
4 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __UTIL_ATTR_H__
21 #define __UTIL_ATTR_H__
24 /** gcc attribute used on function parameters so that it does not emit
25 * warnings about them being unused. **/
26 # define UNUSED(param) param __attribute__ ((unused))
28 # define UNUSED(param) param
29 /** Feel free to add definitions for other compilers here. */
33 #ifdef HAVE_VISIBILITY_ATTR
34 # define _PUBLIC_ __attribute__((visibility("default")))
41 #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
42 #define _DEPRECATED_ __attribute__ ((deprecated))
48 #ifndef _WARN_UNUSED_RESULT_
49 #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
50 #define _WARN_UNUSED_RESULT_ __attribute__ ((warn_unused_result))
52 #define _WARN_UNUSED_RESULT_
57 #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
58 #define _NORETURN_ __attribute__ ((noreturn))
65 #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
66 #define _PURE_ __attribute__((pure))
73 #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
74 #define NONNULL(param) param __attribute__((nonnull))
76 #define NONNULL(param) param
80 #endif /* __UTIL_ATTR_H__ */