- Fix build with gcc 4.2

PR:		117770
Submitted by:	Pietro Cerutti <gahr@gahr.ch>
Approved by:	portmgr (pav)
This commit is contained in:
Martin Wilke 2007-11-05 10:15:56 +00:00
parent d75bf79743
commit 429da67c12
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=202513
2 changed files with 42 additions and 9 deletions

View file

@ -20,19 +20,13 @@ BUILD_DEPENDS= qmake:${PORTSDIR}/devel/qmake
SHLIB_MAJOR= 1
USE_OPENSSL= yes
USE_X_PREFIX= yes
USE_XLIB= yes
USE_BZIP2= yes
INSTALLS_SHLIB= yes
USE_LDCONFIG= yes
MAKE_ARGS= QTDIR=${QT_PREFIX}
PLIST_SUB= SHLIB_MAJOR="${SHLIB_MAJOR}"
USE_QT_VER= 3
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 700019
BROKEN= Does not compile on FreeBSD >= 7.0
.endif
do-configure:
cd ${WRKSRC} && ${SETENV} ${MAKE_ARGS} qmake \
-spec ${LOCALBASE}/share/qt/mkspecs/freebsd-g++ qssl.pro
@ -42,4 +36,4 @@ do-install:
${PREFIX}/lib/libqssl.so.${SHLIB_MAJOR}
${LN} -s libqssl.so.${SHLIB_MAJOR} ${PREFIX}/lib/libqssl.so
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -0,0 +1,39 @@
--- qssl.cpp.orig 2003-06-01 00:37:38.000000000 +0200
+++ qssl.cpp 2007-11-04 21:16:18.000000000 +0100
@@ -18,6 +18,8 @@
*
*/
+#include<sys/param.h> /* see line 471 */
+
#include"qssl_p.h"
#include<qstring.h>
@@ -147,10 +149,10 @@
c = d = 0;
for( i = 0; i < len; i += 4 ) {
- a = tbl[s[i]];
- b = tbl[s[i + 1]];
- c = tbl[s[i + 2]];
- d = tbl[s[i + 3]];
+ a = tbl[(unsigned char)s[i]];
+ b = tbl[(unsigned char)s[i + 1]];
+ c = tbl[(unsigned char)s[i + 2]];
+ d = tbl[(unsigned char)s[i + 3]];
if((a == 64 || b == 64) || (a < 0 || b < 0 || c < 0 || d < 0)) {
p.resize(0);
return p;
@@ -466,7 +468,12 @@
memcpy(enc.data(), cs.data(), enc.size());
QByteArray dat = base64decode(enc);
unsigned char *p = (unsigned char *)dat.data();
+#if (__FreeBSD_version >= 700042)
+ X509 *x = d2i_X509(NULL, (const unsigned char **)&p, dat.size());
+#else
X509 *x = d2i_X509(NULL, &p, dat.size());
+#endif
+
if(!x)
return false;
fromX509(x);