|
| 1 | +/* Copyright (C) 1995-2015 Free Software Foundation, Inc. |
| 2 | + This file is part of the GNU C Library. |
| 3 | +
|
| 4 | + The GNU C Library is free software; you can redistribute it and/or |
| 5 | + modify it under the terms of the GNU Lesser General Public |
| 6 | + License as published by the Free Software Foundation; either |
| 7 | + version 2.1 of the License, or (at your option) any later version. |
| 8 | +
|
| 9 | + The GNU C Library is distributed in the hope that it will be useful, |
| 10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | + Lesser General Public License for more details. |
| 13 | +
|
| 14 | + You should have received a copy of the GNU Lesser General Public |
| 15 | + License along with the GNU C Library; if not, see |
| 16 | + <http://www.gnu.org/licenses/>. */ |
| 17 | + |
| 18 | +#ifndef _GNURX_INTERNAL_H |
| 19 | +#define _GNURX_INTERNAL_H 1 |
| 20 | + |
| 21 | +#define _GNU_SOURCE |
| 22 | +#define IS_IN(x) 1 |
| 23 | + |
| 24 | +/* GNURX: from glibc-2.22/misc/sys/param.h */ |
| 25 | +/* Macros for min/max. */ |
| 26 | +#define MIN(a,b) (((a)<(b))?(a):(b)) |
| 27 | +#define MAX(a,b) (((a)>(b))?(a):(b)) |
| 28 | + |
| 29 | +/* GNURX: from glibc-2.22/include/features.h */ |
| 30 | +/* Convenience macros to test the versions of glibc and gcc. |
| 31 | + Use them like this: |
| 32 | + #if __GNUC_PREREQ (2,8) |
| 33 | + ... code requiring gcc 2.8 or later ... |
| 34 | + #endif |
| 35 | + Note - they won't work for gcc1 or glibc1, since the _MINOR macros |
| 36 | + were not defined then. */ |
| 37 | +#if defined __GNUC__ && defined __GNUC_MINOR__ |
| 38 | +# define __GNUC_PREREQ(maj, min) \ |
| 39 | + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) |
| 40 | +#else |
| 41 | +# define __GNUC_PREREQ(maj, min) 0 |
| 42 | +#endif |
| 43 | + |
| 44 | +/* GNURX: from glibc-2.22/misc/sys/cdefs.h */ |
| 45 | +/* If fortification mode, we warn about unused results of certain |
| 46 | + function calls which can lead to problems. */ |
| 47 | +#if __GNUC_PREREQ (3,4) |
| 48 | +# define __attribute_warn_unused_result__ \ |
| 49 | + __attribute__ ((__warn_unused_result__)) |
| 50 | +# if __USE_FORTIFY_LEVEL > 0 |
| 51 | +# define __wur __attribute_warn_unused_result__ |
| 52 | +# endif |
| 53 | +#else |
| 54 | +# define __attribute_warn_unused_result__ /* empty */ |
| 55 | +#endif |
| 56 | +#ifndef __wur |
| 57 | +# define __wur /* Ignore */ |
| 58 | +#endif |
| 59 | + |
| 60 | +#endif /* gnurx_internal.h */ |
0 commit comments