configure.ac: Move OggVorbis Encoder to Encoder Plugins.
[mpd-mk.git] / src / gcc.h
blob085a8a5f64f45ab20a6f66c4559f93edf393d344
1 /*
2 * Copyright (C) 2003-2010 The Music Player Daemon Project
3 * http://www.musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef MPD_GCC_H
21 #define MPD_GCC_H
23 /* this allows us to take advantage of special gcc features while still
24 * allowing other compilers to compile:
26 * example taken from: http://rlove.org/log/2005102601
29 #if defined(__GNUC__) && (__GNUC__ >= 3)
30 # define mpd_must_check __attribute__ ((warn_unused_result))
31 # define mpd_packed __attribute__ ((packed))
32 /* these are very useful for type checking */
33 # define mpd_printf __attribute__ ((format(printf,1,2)))
34 # define mpd_fprintf __attribute__ ((format(printf,2,3)))
35 # define mpd_fprintf_ __attribute__ ((format(printf,3,4)))
36 # define mpd_fprintf__ __attribute__ ((format(printf,4,5)))
37 # define mpd_scanf __attribute__ ((format(scanf,1,2)))
38 # define mpd_used __attribute__ ((used))
39 /* # define inline inline __attribute__ ((always_inline)) */
40 # define mpd_noinline __attribute__ ((noinline))
41 #else
42 # define mpd_must_check
43 # define mpd_packed
44 # define mpd_printf
45 # define mpd_fprintf
46 # define mpd_fprintf_
47 # define mpd_fprintf__
48 # define mpd_scanf
49 # define mpd_used
50 /* # define inline */
51 # define mpd_noinline
52 #endif
54 #endif /* MPD_GCC_H */