Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 2010 19:33:50 +0300 (MSK)
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        dhn@FreeBSD.org
Subject:   ports/152548: [PATCH] net/GeoIP: don't redefined memcpy
Message-ID:  <20101124163350.35DE1B844@hades.panopticon>
Resent-Message-ID: <201011241700.oAOH0Pn3081582@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         152548
>Category:       ports
>Synopsis:       [PATCH] net/GeoIP: don't redefined memcpy
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 24 17:00:24 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Fri Jul 30 02:50:28 MSD 2010
>Description:
GeoIP.h instelled by net/GeoIP has

#define memcpy(dest, src, n) bcopy(src, dest, n)

which breaks building stuff that uses that include under certain
circumstances (see How-To-Repeat). In real world, this prevents
building qbittorrent without GUI.

The patch removes that bogus define. I've mailed GeoIP devs and
they are going to remove it upstream as well.

Added file(s):
- files/patch-libGeoIP-GeoIP.h

Port maintainer (dhn@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
% cat > 1.cpp
#include <sys/param.h>
#include <cstring>
#include <GeoIP.h>

int main() {
    std::memcpy(NULL, NULL, 0);
}
^D
% c++ -I/usr/local/include 1.cpp
1.cpp: In function 'int main()':
1.cpp:6: error: 'bcopy' is not a member of 'std'
%
>Fix:

--- GeoIP-1.4.6_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/net/GeoIP/Makefile,v
retrieving revision 1.44
diff -u -u -r1.44 Makefile
--- Makefile	2 Aug 2009 19:34:54 -0000	1.44
+++ Makefile	24 Nov 2010 16:21:40 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	GeoIP
 PORTVERSION=	1.4.6
+PORTREVISION=	1
 CATEGORIES=	net geography
 MASTER_SITES=	http://geolite.maxmind.com/download/geoip/api/c/
 
Index: files/patch-libGeoIP-GeoIP.h
===================================================================
RCS file: files/patch-libGeoIP-GeoIP.h
diff -N files/patch-libGeoIP-GeoIP.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-libGeoIP-GeoIP.h	24 Nov 2010 16:21:26 -0000
@@ -0,0 +1,13 @@
+--- libGeoIP/GeoIP.h.orig	2009-02-24 19:03:23.000000000 +0300
++++ libGeoIP/GeoIP.h	2010-11-24 19:21:26.000000000 +0300
+@@ -241,10 +241,6 @@
+ /* Get timezone from country and region code */
+ GEOIP_API const char * GeoIP_time_zone_by_country_and_region(const char *country_code, const char *region_code);
+ 
+-#ifdef BSD
+-#define memcpy(dest, src, n) bcopy(src, dest, n)
+-#endif
+-
+ #ifdef __cplusplus
+ }
+ #endif
--- GeoIP-1.4.6_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101124163350.35DE1B844>