I have the following compile error.

cc -c -I../.. -I.. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include    
-DCURDIR=src/lib -mtune=k6-2 -g -pg -O2 -fstack-protector-all  -fprofile-arcs 
-W -Wall -Wformat=2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-D_FILE_OFFSET_BITS=64 -momit-leaf-frame-pointer  misc.c
misc.c: In function `compat_page_align':
misc.c:3165: error: `MAP_PRIVATE' undeclared (first use in this function)
misc.c:3165: error: (Each undeclared identifier is reported only once
misc.c:3165: error: for each function it appears in.)
misc.c:3172: warning: implicit declaration of function `mmap'
misc.c:3172: error: `PROT_READ' undeclared (first use in this function)
misc.c:3172: error: `PROT_WRITE' undeclared (first use in this function)
misc.c:3172: warning: assignment makes pointer from integer without a cast
misc.c:3173: error: `MAP_FAILED' undeclared (first use in this function)
misc.c: In function `compat_page_free':
misc.c:3195: warning: implicit declaration of function `munmap'
make[3]: *** [misc.o] Error 1

Conditionalizing the compat_page_align(size_t size) routine with "#if
defined(USE_MMAP)" allows a compilation.  This is one issue.  The
misc.c needs conditionalization on the USE_MMAP in common.h.  I think
there are several functions that might be conditionalized on this as
well as the misc.h header.

The other question would be why the configure script didn't pickup the
fact that I have mmap.  The file "sys/mmap.h" exists and I have the
manpages for mmap().

bash> uname -a
Linux localhost 2.6.12.4-r00tK1t #1 Thu Aug 11 16:36:41 EDT 2005 i586 unknown 
unknown GNU/Linux

The common.h conditionalization is on "#if defined(__STDC_VERSION__)"

[test file foo.c]

    #if defined(__STDC_VERSION__)
    #error We have __STDC_VERSION__
    #else
    #error We have no __STDC_VERSION__.
    #endif

    $ gcc foo.c
    foo.c:4:2: #error We have no __STDC_VERSION__.
    $ 

Apparently gcc 3.4.3 doesn't define this macro.  I am not wise in the
ways of GTKG configuration.  I think I need a U/new/d_mmap.U file to
determine if the system has an mmap?

Replacing the "#if defined(__STDC_VERSION__)" with "#if 1" for the
USE_MMAP conditional in common.h on my system results in a clean
compile.

__STDC_VERSION__ looks like an internal compiler define.  I guess this
shouldn't have been defined on the command line, etc?  Maybe newer gcc
versions have alternate defines?

Here is some google output,

    An amendment to the 1990 standard was published in 1995. This
    amendment added digraphs and __STDC_VERSION__ to the language, but
    otherwise concerned the library. This amendment is commonly known
    as AMD1; the amended standard is sometimes known as C94 or C95. To
    select this standard in GCC, use the option -std=iso9899:199409
    (with, as for other standard versions, -pedantic to receive all
    required diagnostics).

I think I am compiling with C99 by default.  Does GTKG need C95 (not
C89 or C99)?...  but I don't think that any "C" standard really has
semantics related to mmap, does it?  Maybe some Unix or Posix defines,
but not STDC type semantics?

Regards,
Bill Pringlemeir.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Gtk-gnutella-devel mailing list
Gtk-gnutella-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to