pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

clamav-0.80 fails to build (duplicate definition of "Byte")



Hi,

version 0.98 of security/clamav (from pkgsrc-current) does not build on
any of my Linux systems (Ubuntu 6.06, 8.04, 10.04, 12.04). Error message
always looks like this:

In file included from 7z/LzmaDec.h:7,
                 from lzma_iface.h:26,
                 from upx.c:59:
7z/Types.h:58: error: redefinition of typedef 'Byte'
/opt/pkgsrc/work/pkgsrc/security/clamav/default/.buildlink/include/zconf.h:368: 
error: previous declaration of 'Byte' was here
*** Error code 1

libclamav/7z/Types.h defines 'Byte', as does <zconf.h>
(devel/zlib-1.2.8). Since lzma_iface.h includes <zconf.h>, this
definition of 'Byte' as already known when the compiler reaches
libclamav/7z/Types.h.

Attached patch fixes the build error; it adds 
   include <zconf.h>
to Type.sh and removes the local defintion of 'Byte'.

In clamav-0.97.6, a similar workaround was used, but I don't know if
that was a pkgsrc patch or if it was from upstream.

Regards
Matthias Ferdinand
--- libclamav/7z/Types.h.orig   2013-09-16 21:28:14.000000000 +0200
+++ libclamav/7z/Types.h        2013-10-14 18:13:25.000000000 +0200
@@ -55,7 +55,9 @@
 #define RINOK(x) { int __result__ = (x); if (__result__ != 0) return 
__result__; }
 #endif
 
-typedef unsigned char Byte;
+/* mf 20131014: use Byte from zconf.h */
+#include <zconf.h>
+/* typedef unsigned char Byte; */
 typedef short Int16;
 typedef unsigned short UInt16;
 


Home | Main Index | Thread Index | Old Index