[5109] | 1 | //compilerhacks.h: |
---|
| 2 | |
---|
| 3 | /* |
---|
| 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2011 |
---|
| 5 | * |
---|
| 6 | * This file is part of RoarAudio, |
---|
| 7 | * a cross-platform sound system for both, home and professional use. |
---|
| 8 | * See README for details. |
---|
| 9 | * |
---|
| 10 | * This file is free software; you can redistribute it and/or modify |
---|
| 11 | * it under the terms of the GNU Lesser General Public License version 3 |
---|
| 12 | * as published by the Free Software Foundation. |
---|
| 13 | * |
---|
| 14 | * RoarAudio is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU Lesser General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU Lesser General Public License |
---|
| 20 | * along with this software; see the file COPYING. If not, write to |
---|
| 21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
| 22 | * Boston, MA 02110-1301, USA. |
---|
| 23 | * |
---|
| 24 | * NOTE: Even though this file is LGPLed it (may) include GPLed files |
---|
| 25 | * so the license of this file is/may therefore downgraded to GPL. |
---|
| 26 | * See HACKING for details. |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | #ifndef _ROARAUDIO_COMPILERHACKS_H_ |
---|
| 30 | #define _ROARAUDIO_COMPILERHACKS_H_ |
---|
| 31 | |
---|
| 32 | #if defined(__GNUC__) && __GNUC__ >= 4 |
---|
| 33 | #define _LIBROAR_ATTR_DEPRECATED __attribute__((deprecated)) |
---|
| 34 | #define _LIBROAR_ATTR_NONNULL(x, index...) __attribute__((nonnull ( x, ##index ))) |
---|
| 35 | #define _LIBROAR_ATTR_NONNULL_ALL __attribute__((nonnull)) |
---|
| 36 | #define _LIBROAR_ATTR_PURE __attribute__ ((pure)) |
---|
| 37 | #define _LIBROAR_ATTR_USE_RESULT __attribute__ ((warn_unused_result)) |
---|
| 38 | #endif |
---|
| 39 | |
---|
| 40 | // add more defintions for other compilers here. |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | #ifndef _LIBROAR_ATTR_DEPRECATED |
---|
| 45 | #define _LIBROAR_ATTR_DEPRECATED |
---|
| 46 | #endif |
---|
| 47 | #ifndef _LIBROAR_ATTR_NONNULL |
---|
| 48 | #define _LIBROAR_ATTR_NONNULL(index...) |
---|
| 49 | #endif |
---|
| 50 | #ifndef _LIBROAR_ATTR_NONNULL_ALL |
---|
| 51 | #define _LIBROAR_ATTR_NONNULL_ALL |
---|
| 52 | #endif |
---|
| 53 | #ifndef _LIBROAR_ATTR_PURE |
---|
| 54 | #define _LIBROAR_ATTR_PURE |
---|
| 55 | #endif |
---|
| 56 | #ifndef _LIBROAR_ATTR_USE_RESULT |
---|
| 57 | #define _LIBROAR_ATTR_USE_RESULT |
---|
| 58 | #endif |
---|
| 59 | |
---|
[5111] | 60 | #ifndef _LIBROAR_IGNORE_RET |
---|
| 61 | #define _LIBROAR_IGNORE_RET(x) ((void)((x)+1)) |
---|
| 62 | #endif |
---|
| 63 | |
---|
[5109] | 64 | #ifndef _LIBROAR_NOATTR_TO_STATIC |
---|
| 65 | #define _LIBROAR_ATTR_TO_STATIC _LIBROAR_ATTR_DEPRECATED |
---|
| 66 | #else |
---|
| 67 | #define _LIBROAR_ATTR_TO_STATIC |
---|
| 68 | #endif |
---|
| 69 | |
---|
| 70 | #ifdef _LIBROAR_NOATTR_WARNINGS |
---|
| 71 | #undef _LIBROAR_ATTR_DEPRECATED |
---|
| 72 | #define _LIBROAR_ATTR_DEPRECATED |
---|
| 73 | #undef _LIBROAR_ATTR_USE_RESULT |
---|
| 74 | #define _LIBROAR_ATTR_USE_RESULT |
---|
| 75 | #endif |
---|
| 76 | |
---|
| 77 | #endif |
---|
| 78 | |
---|
| 79 | //ll |
---|