diff options
author | Dees Troy <dees_troy@teamw.in> | 2013-08-28 18:00:58 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@198.50.184.117> | 2013-08-28 18:00:58 +0200 |
commit | de307148cfb7f1f37df875f0451f56488b8f68b2 (patch) | |
tree | 7342cbe1d30c701e331a9bb11705044f1a3f20b7 /exfat/libexfat/compiler.h | |
parent | ignore lost+found in all the places (diff) | |
parent | update exfat to latest commits for io issues (diff) | |
download | android_bootable_recovery-de307148cfb7f1f37df875f0451f56488b8f68b2.tar android_bootable_recovery-de307148cfb7f1f37df875f0451f56488b8f68b2.tar.gz android_bootable_recovery-de307148cfb7f1f37df875f0451f56488b8f68b2.tar.bz2 android_bootable_recovery-de307148cfb7f1f37df875f0451f56488b8f68b2.tar.lz android_bootable_recovery-de307148cfb7f1f37df875f0451f56488b8f68b2.tar.xz android_bootable_recovery-de307148cfb7f1f37df875f0451f56488b8f68b2.tar.zst android_bootable_recovery-de307148cfb7f1f37df875f0451f56488b8f68b2.zip |
Diffstat (limited to 'exfat/libexfat/compiler.h')
-rw-r--r-- | exfat/libexfat/compiler.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/exfat/libexfat/compiler.h b/exfat/libexfat/compiler.h new file mode 100644 index 000000000..6edd8ec7f --- /dev/null +++ b/exfat/libexfat/compiler.h @@ -0,0 +1,62 @@ +/* + compiler.h (09.06.13) + Compiler-specific definitions. Note that unknown compiler is not a + showstopper. + + Free exFAT implementation. + Copyright (C) 2010-2013 Andrew Nayenko + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef COMPILER_H_INCLUDED +#define COMPILER_H_INCLUDED + +#if defined(__clang__) + +#define PRINTF __attribute__((format(printf, 1, 2))) +#define NORETURN __attribute__((noreturn)) +#define PACKED __attribute__((packed)) +#if __has_extension(c_static_assert) +#define USE_C11_STATIC_ASSERT +#endif + +#elif defined(__GNUC__) + +#define PRINTF __attribute__((format(printf, 1, 2))) +#define NORETURN __attribute__((noreturn)) +#define PACKED __attribute__((packed)) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#define USE_C11_STATIC_ASSERT +#endif + +#else + +#define PRINTF +#define NORETURN +#define PACKED + +#endif + +#ifdef USE_C11_STATIC_ASSERT +#define STATIC_ASSERT(cond) _Static_assert(cond, #cond) +#else +#define CONCAT2(a, b) a ## b +#define CONCAT1(a, b) CONCAT2(a, b) +#define STATIC_ASSERT(cond) \ + extern void CONCAT1(static_assert, __LINE__)(int x[(cond) ? 1 : -1]) +#endif + +#endif /* ifndef COMPILER_H_INCLUDED */ |