1// Copyright 2014 The Android Open Source Project
2//
3// This software is licensed under the terms of the GNU General Public
4// License version 2, as published by the Free Software Foundation, and
5// may be copied, distributed, and modified under those terms.
6//
7// This program is distributed in the hope that it will be useful,
8// but WITHOUT ANY WARRANTY; without even the implied warranty of
9// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10// GNU General Public License for more details.
11
12#ifndef ANDROID_UTILS_COMPILER_H
13#define ANDROID_UTILS_COMPILER_H
14
15#ifdef __cplusplus
16#define ANDROID_BEGIN_HEADER extern "C" {
17#define ANDROID_END_HEADER   }
18#else
19#define ANDROID_BEGIN_HEADER /* nothing */
20#define ANDROID_END_HEADER  /* nothing */
21#endif
22
23// ANDROID_GCC_PREREQ(<major>,<minor>) will evaluate to true
24// iff the current version of GCC is <major>.<minor> or higher.
25#if defined(__GNUC__) && defined(__GNUC_MINOR__)
26# define ANDROID_GCC_PREREQ(maj, min) \
27         ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
28#else
29# define ANDROID_GCC_PREREQ(maj, min) 0
30#endif
31
32#endif  // ANDROID_UTILS_COMPILER_H
33