Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Oct 2005 11:29:20 +0800
From:      "Lin, Cheng-tao(psilotum)" <psilotum.ptt2@gmail.com>
To:        freebsd-ports@freebsd.org
Cc:        xxjack12xx@gmail.com
Subject:   Re: dcraw does not compile
Message-ID:  <42b6915e0510052029s2758d164saf87c88b46572a3f@mail.gmail.com>
In-Reply-To: <42b6915e0510051959x6c6d1ff7g8f9188f818edf46f@mail.gmail.com>
References:  <ab581e31050915185220d31d03@mail.gmail.com> <432A2E2D.2060000@bellsouth.net> <42b6915e0510051959x6c6d1ff7g8f9188f818edf46f@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_15463_9222782.1128569360420
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

'Cause "memmem" confliction between /usr/include/string.h and dcraw.c
I just changed the "memmem" to "memmemory" (patch is as following and
in attachment, but I really do not know if it is appropriate to do
this...)

cvsweb:
http://www.freebsd.org/cgi/cvsweb.cgi/src/include/string.h

--- dcraw.c     Thu Oct  6 11:06:37 2005
+++ dcraw.orig  Thu Oct  6 11:10:30 2005
@@ -174,7 +174,7 @@
  */

 #ifndef __GLIBC__
-char *memmemory (char *haystack, size_t haystacklen,
+char *memmem (char *haystack, size_t haystacklen,
              char *needle, size_t needlelen)
 {
   char *c;
@@ -2932,7 +2932,7 @@
   fread (head, 1, 32, ifp);
   fseek (ifp, 0, SEEK_END);
   fsize =3D ftell(ifp);
-  if ((c =3D memmemory (head, 32, "MMMMRawT", 8))) {
+  if ((c =3D memmem (head, 32, "MMMMRawT", 8))) {
     strcpy (make, "Phase One");
     data_offset =3D c - head;
     fseek (ifp, data_offset + 8, SEEK_SET);

regards,

cheng-tao

On 10/6/05, Lin, Cheng-tao(psilotum) <psilotum.ptt2@gmail.com> wrote:
> I have the same problem with compiling dcraw and gimp-ufraw,  too.
>
> compile graphics/dcraw log:
> =3D=3D=3D>  Building for dcraw-1.236
> cc -o dcraw -O2 -fno-strict-aliasing -pipe   -I/usr/local/include
> dcraw.c -L/usr/local/lib -lm -ljpeg
> dcraw.c:179: error: conflicting types for 'memmem'
here is the problem
> /usr/include/string.h:65: error: previous declaration of 'memmem' was her=
e
> dcraw.c:179: error: conflicting types for 'memmem'
> /usr/include/string.h:65: error: previous declaration of 'memmem' was her=
e
> *** Error code 1
>
> Stop in /usr/ports/graphics/dcraw/work/dcraw-1.236.
> *** Error code 1
>
> Stop in /usr/ports/graphics/dcraw.
>
> uname -v is:
>
> FreeBSD 7.0-CURRENT #0: Sun Oct  2 01:02:10 CST 2005
> root@litsea.psilotum.twbbs.org:/usr/obj/usr/src/sys/LITSEA
>
> my string.h revision is 1.23:
> $FreeBSD: src/include/string.h,v 1.23 2005/08/25 19:46:38 andre Exp $
>
> regards,
>
> cheng-tao
>
> On 9/16/05, bsdlogical <kwlogical@bellsouth.net> wrote:
> > That's odd. Could you post the output of `uname -a`? I'm using FreeBSD
> > 5.4-STABLE and it compiles fine:
> >
> > =3D=3D=3D>  Building for dcraw-1.236
> > cc -o dcraw -O -pipe -march=3Dpentium4 -march=3Dpentium4
> > -I/usr/local/include dcraw.c -L/usr/local/lib -lm -ljpeg
> > =3D=3D=3D>  Installing for dcraw-1.236
> > =3D=3D=3D>   Generating temporary packing list
> > =3D=3D=3D>  Checking if graphics/dcraw already installed
> > install  -s -o root -g wheel -m 555
> > /usr/ports/graphics/dcraw/work/dcraw-1.236/dcraw /usr/local/bin
> > install  -o root -g wheel -m 444
> > /usr/ports/graphics/dcraw/work/dcraw-1.236/dcraw.1 /usr/local/man/man1
> > =3D=3D=3D>   Compressing manual pages for dcraw-1.236
> > =3D=3D=3D>   Registering installation for dcraw-1.236
> > root@argon#
> >
> >  * $FreeBSD: src/include/string.h,v 1.20 2004/07/23 02:20:05 tjr Exp $
> >
> > bsdlogical
> >
> > Jack L. wrote:
> >
> > >I get this when I try to compile dcraw
> > >
> > >musirc# make install
> > >=3D=3D=3D> Building for dcraw-1.236
> > >cc -o dcraw -O2 -fno-strict-aliasing -pipe -march=3Dprescott -march=3D=
prescott
> > >-I/usr/local/include dcraw.c -L/usr/local/lib -lm -ljpeg
> > >dcraw.c:179: error: conflicting types for 'memmem'
> > >/usr/include/string.h:65: error: previous declaration of 'memmem' was =
here
> > >dcraw.c:179: error: conflicting types for 'memmem'
> > >/usr/include/string.h:65: error: previous declaration of 'memmem' was =
here
> > >*** Error code 1
> > >
> > >Stop in /usr/ports/graphics/dcraw/work/dcraw-1.236.
> > >*** Error code 1
> > >
> > >Stop in /usr/ports/graphics/dcraw.
> > >musirc#
> > >_______________________________________________
>

------=_Part_15463_9222782.1128569360420
Content-Type: text/x-patch; name=dcraw.diff; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="dcraw.diff"

--- dcraw.c	Thu Oct  6 11:06:37 2005
+++ dcraw.orig	Thu Oct  6 11:10:30 2005
@@ -174,7 +174,7 @@
  */
 
 #ifndef __GLIBC__
-char *memmemory (char *haystack, size_t haystacklen,
+char *memmem (char *haystack, size_t haystacklen,
 	      char *needle, size_t needlelen)
 {
   char *c;
@@ -2932,7 +2932,7 @@
   fread (head, 1, 32, ifp);
   fseek (ifp, 0, SEEK_END);
   fsize = ftell(ifp);
-  if ((c = memmemory (head, 32, "MMMMRawT", 8))) {
+  if ((c = memmem (head, 32, "MMMMRawT", 8))) {
     strcpy (make, "Phase One");
     data_offset = c - head;
     fseek (ifp, data_offset + 8, SEEK_SET);


------=_Part_15463_9222782.1128569360420--



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