Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Pending |
| 2 | |
| 3 | dpkg defines: |
| 4 | #define DPKG_BEGIN_DECLS extern "C" { |
| 5 | |
| 6 | That makes header cstdlib included in a extern "C" block which is not supported |
| 7 | by gcc 4.8. It fails on Fedora 19: |
| 8 | |
| 9 | /usr/include/c++/4.8.1/cstdlib: In function ‘long long int std::abs(long long int)’: |
| 10 | /usr/include/c++/4.8.1/cstdlib:174:20: error: declaration of C function ‘long long int std::abs(long long int)’ conflicts with |
| 11 | abs(long long __x) { return __builtin_llabs (__x); } |
| 12 | ^ |
| 13 | /usr/include/c++/4.8.1/cstdlib:166:3: error: previous declaration ‘long int std::abs(long int)’ here |
| 14 | abs(long __i) { return __builtin_labs(__i); } |
| 15 | ^ |
| 16 | |
| 17 | Move include gettext.h out of the extern "C" block to fix this issue. |
| 18 | |
| 19 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 20 | |
| 21 | --- dpkg-1.17.1/lib/dpkg/i18n.h.orig 2013-08-13 17:31:28.870935573 +0800 |
| 22 | +++ dpkg-1.17.1/lib/dpkg/i18n.h 2013-08-13 17:31:37.893065249 +0800 |
| 23 | @@ -23,8 +23,6 @@ |
| 24 | |
| 25 | #include <dpkg/macros.h> |
| 26 | |
| 27 | -DPKG_BEGIN_DECLS |
| 28 | - |
| 29 | /** |
| 30 | * @defgroup i18n Internationalization support |
| 31 | * @ingroup dpkg-internal |
| 32 | @@ -33,6 +31,8 @@ |
| 33 | |
| 34 | #include <gettext.h> |
| 35 | |
| 36 | +DPKG_BEGIN_DECLS |
| 37 | + |
| 38 | /* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h |
| 39 | * which gets pulled by gettext.h only includes it if building optimized. */ |
| 40 | #include <locale.h> |