Only 1 error stopping build on Mac OS X with gcc 4.0

Alan West <alan-P7ld/[email protected]> Tue, 19 Jul 2005 16:32:15 +0100
Newsgroups gmane.comp.gnu.dotgnu.developer
Message-ID <[email protected]>
A while back when I was building Portable .NET on a Mac just for the  
fun of it, I came across an error when using apple's gcc 4.0.0.

As I wasn't using the CVS source I didn't mention it. Now I am  
building the CVS version of the source and the error is there.

There was only one error stopping it from building in gcc 4.0..

I changed os_dep.c:2215, replacing the extern with static and  
everything was fine.

os_dep.c:3410: error: static declaration of 'GC_task_self' follows  
non-static declaration
os_dep.c:2215: error: previous declaration of 'GC_task_self' was here

# ifdef DARWIN
     /* Using vm_protect (mach syscall) over mprotect (BSD syscall)  
seems to
        decrease the likelihood of some of the problems described  
below. */
     #include <mach/vm_map.h>
     extern mach_port_t GC_task_self;   <---- os_dep.c:2215
     #define PROTECT(addr,len) \
         if(vm_protect(GC_task_self,(vm_address_t)(addr),(vm_size_t) 
(len), \
                 FALSE,VM_PROT_READ) != KERN_SUCCESS) { \
             ABORT("vm_portect failed"); \
         }
     #define UNPROTECT(addr,len) \
         if(vm_protect(GC_task_self,(vm_address_t)(addr),(vm_size_t) 
(len), \
                 FALSE,VM_PROT_READ|VM_PROT_WRITE) != KERN_SUCCESS) { \
             ABORT("vm_portect failed"); \
         }
# else