| 1 |
/* |
| 2 |
* Multi-include test program |
| 3 |
* ensure that pixel, bool and vector are not redefined |
| 4 |
* |
| 5 |
* Copyright (C) 2020 Yann Collet |
| 6 |
* |
| 7 |
* GPL v2 License |
| 8 |
* |
| 9 |
* This program is free software; you can redistribute it and/or modify |
| 10 |
* it under the terms of the GNU General Public License as published by |
| 11 |
* the Free Software Foundation; either version 2 of the License, or |
| 12 |
* (at your option) any later version. |
| 13 |
* |
| 14 |
* This program 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 General Public License for more details. |
| 18 |
* |
| 19 |
* You should have received a copy of the GNU General Public License along |
| 20 |
* with this program; if not, write to the Free Software Foundation, Inc., |
| 21 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 22 |
* |
| 23 |
* You can contact the author at: |
| 24 |
* - xxHash homepage: https://www.xxhash.com |
| 25 |
* - xxHash source repository: https://github.com/Cyan4973/xxHash |
| 26 |
*/ |
| 27 |
|
| 28 |
/* gcc's altivec.h, included for the VSX code path, |
| 29 |
* may, in some circumstances, redefine |
| 30 |
* bool, vector and pixel keywords. |
| 31 |
* |
| 32 |
* This unit checks if it happens. |
| 33 |
* It's a compile test. |
| 34 |
* The test is mostly meaningful for PPC target using altivec.h |
| 35 |
* hence XXH_VECTOR == XXH_VSX |
| 36 |
*/ |
| 37 |
|
| 38 |
#define BOOL_VALUE 32123456 |
| 39 |
#define bool BOOL_VALUE |
| 40 |
|
| 41 |
#define VECTOR_VALUE 374464784 |
| 42 |
#define vector VECTOR_VALUE |
| 43 |
|
| 44 |
#define PIXEL_VALUE 5846841 |
| 45 |
#define pixel PIXEL_VALUE |
| 46 |
|
| 47 |
#define XXH_INLINE_ALL |
| 48 |
#include "../xxhash.h" |
| 49 |
|
| 50 |
#if (bool != BOOL_VALUE) |
| 51 |
# error "bool macro was redefined !" |
| 52 |
#endif |
| 53 |
|
| 54 |
#if (vector != VECTOR_VALUE) |
| 55 |
# error "vector macro was redefined !" |
| 56 |
#endif |
| 57 |
|
| 58 |
#if (pixel != PIXEL_VALUE) |
| 59 |
# error "pixel macro was redefined !" |
| 60 |
#endif |
| 61 |
|
| 62 |
int g_nonEmptyUnit = 0; |