[patch] darwin full x86_64 and i?86 libjava support

Andrew Haley aph@redhat.com
Fri Dec 7 10:38:00 GMT 2007


Andreas Tobler writes:
 > 
 > 
 > Thanks for review and feedback,

Your formatting is FUBAR in a few places:

>  #include <stdint.h>
 > +#if !defined (__LP64__)
 >  struct mach_header;
 > +#define JAVA_MACH_HEADER mach_header
 > +#define  mh_size_t uint32_t
 >  extern "C" void _dyld_register_func_for_add_image
 > -  (void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide));
 > +(void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide));

Whitespace incorrectly removed here, and in several other places.

 >  extern "C" void _dyld_register_func_for_remove_image
 > -  (void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide));
 > +(void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide));
 >  extern "C" char *getsectdatafromheader
 >  (const struct mach_header *mhp, const char *segname, const char *sectname,
 >   uint32_t *size);
 > +#else
 > +struct mach_header_64;
 > +#define JAVA_MACH_HEADER mach_header_64
 > +#define mh_size_t uint64_t
 > +extern "C" void _dyld_register_func_for_add_image
 > +(void (*func)(const struct mach_header_64 *mh, intptr_t vmaddr_slide));
 > +extern "C" void _dyld_register_func_for_remove_image
 > +(void (*func)(const struct mach_header_64 *mh, intptr_t vmaddr_slide));
 > +extern "C" char *getsectdatafromheader_64
 > +(const struct mach_header_64 *mhp, const char *segname, const char *sectname,
 > + uint64_t *size);
 > +#endif
 >  
 >  /* When a new image is loaded, look to see if it has a jcr section
 >     and if so register the classes listed in it.  */
 >  
 >  static void
 > -darwin_java_register_dyld_add_image_hook (const struct mach_header *mh,
 > +darwin_java_register_dyld_add_image_hook (const struct JAVA_MACH_HEADER *mh,
 >  					  intptr_t slide)
 >  {
 >    char *fde;
 > -  uint32_t sz;
 > +  mh_size_t sz;
 >  
 > -  fde = getsectdatafromheader (mh, "__DATA", "jcr", &sz);

This is kinda horrible:

 > +#if defined (__LP64__)
 > +  fde = getsectdatafromheader_64(
 > +#else
 > +  fde = getsectdatafromheader(
 > +#endif
 > +			      mh, "__DATA", "jcr", &sz);

Remember spaces between function names and arg lists.

Otherwise OK.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903



More information about the Java-patches mailing list