Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 1 | From 8aa5402393fabaf4fff51be3af4868e8dfab6da7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Tue, 9 Mar 2021 19:30:42 +0000 |
| 4 | Subject: [PATCH] libdnf/config.h: avoid the use of non-portable __WORDSIZE |
| 5 | |
| 6 | Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/1159] |
| 7 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 8 | --- |
| 9 | libdnf/config.h | 8 +++----- |
| 10 | 1 file changed, 3 insertions(+), 5 deletions(-) |
| 11 | |
| 12 | diff --git a/libdnf/config.h b/libdnf/config.h |
| 13 | index 16121f6f..2925923e 100644 |
| 14 | --- a/libdnf/config.h |
| 15 | +++ b/libdnf/config.h |
| 16 | @@ -18,12 +18,10 @@ |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | -#include <bits/wordsize.h> |
| 21 | +#include <limits.h> |
| 22 | |
| 23 | -#if __WORDSIZE == 32 |
| 24 | -#include "config-32.h" |
| 25 | -#elif __WORDSIZE == 64 |
| 26 | +#if (ULONG_MAX == 0xffffffffffffffff) |
| 27 | #include "config-64.h" |
| 28 | #else |
| 29 | -#error "Unknown word size" |
| 30 | +#include "config-32.h" |
| 31 | #endif |