New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #20936: emacs-23.1-snow-leopard.patch

File emacs-23.1-snow-leopard.patch, 20.4 KB (added by dcreager@…, 2 years ago)

Source tree patch used by emacs-app Portfile

  • lib-src/ChangeLog

    diff -urN emacs-23.1-old/lib-src/ChangeLog emacs-23.1/lib-src/ChangeLog
    old new  
     12009-09-09  Erik Charlebois  <erikcharlebois@gmail.com> 
     2 
     3        * movemail.c (error): Change fprintf to fputs to fix warning. 
     4  
    152009-07-29  Chong Yidong  <cyd@stupidchicken.com> 
    26 
    37        * Version 23.1 released. 
  • lib-src/movemail.c

    diff -urN emacs-23.1-old/lib-src/movemail.c emacs-23.1/lib-src/movemail.c
    old new  
    622622  else if (s2) 
    623623    fprintf (stderr, s1, s2); 
    624624  else 
    625     fprintf (stderr, s1); 
     625    fputs (s1, stderr); 
    626626  fprintf (stderr, "\n"); 
    627627} 
    628628 
  • src/ChangeLog

    diff -urN emacs-23.1-old/src/ChangeLog emacs-23.1/src/ChangeLog
    old new  
     12009-09-09  Erik Charlebois  <erikcharlebois@gmail.com> 
     2 
     3        * emacs.c (main): Remove extra format specifier to fix warning. 
     4 
     5        * font.c (font_unparse_xlfd): Print EMACS_INT with %ld. 
     6        (font_unparse_fcname): Print EMACS_INT with %ld. 
     7 
     8        * menu.c (find_and_return_menu_selection): Fix truncation warning. 
     9 
     10        * nsfns.m (x-close-connection): Remove PSFlush call. Does not do anything 
     11        on Cocoa. Does not exist in 64-bit Cocoa. 
     12        (xw-color-values): Use CGFloat instead of float. 
     13 
     14        * nsfont.m (ns_char_width): Use sizeWithAttributes: instead of 
     15        widthOfString:, which does no exist in 64-bit Cocoa. 
     16        (ns_findfonts): Print EMACS_INT with %ld. 
     17        (nsfont_list_family): Print EMACS_INT with %ld. 
     18        (nsfont_open): Use Core Text for OS X 10.5 and later. 
     19        (nsfont_close): Release Core Text resource. 
     20        (ns_uni_to_glyphs): Use NSUInteger when calling Cocoa APIs. 
     21        (layoutOptions): Use NSUInteger in method signature. 
     22        (insertGlyphs): Use NSUIntger in method signature. 
     23        (setIntAttribute): Use NSInteger and NSUInteger in method signature. 
     24 
     25        * nsgui.h: Add typedefs for NSUInteger, NSInteger and CGFloat for 
     26        pre-10.5 OS X and GNUstep. 
     27 
     28        * nsimage.m (setXBMColor): Use CGFloat for calls to Cocoa. 
     29        (getPixelAtX): Use CGFloat for calls to Cocoa. 
     30 
     31        * nsmenu.m (addItemWithWidgetValue): Use NSInteger for call to Cocoa. 
     32        (fillWithWidgetValue): sizeToFit is deprecated (does nothing). Remove 
     33        call for OS X 10.5 and later. 
     34        (initWithContentRect): Use NSUInteger in method signature. 
     35 
     36        * nsterm.h: Use Core Text on OS X 10.5 and later. 
     37 
     38        * nsterm.m (mouseDown): Remove redundant leading 0s in format specifier. 
     39        (ns_query_color): Use CGFloat for calls to Cocoa. 
     40        (characterIndexForPoint): Use NUSInteger in method signature. 
     41        (draggingEntered): Use NSDragOperation in method signature. 
     42        (scrollerWidth): Use CGFloat in method signature. 
     43        (setPosition): Use setDoubleValue: and setKnobProportion: on 10.5 and 
     44        later since setFloatVAlue:knobProportion: is deprecated. 
     45        (mouseDown): Use %ld to print NSScrollerPart. 
     46 
     47        * process.c (list_processes_1): Use %ld to print EMACS_INT. 
     48 
     49        * unexmacosx.c (read_load_commands): Use %ld to print vm_address_t. 
     50 
    1512009-07-29  Chong Yidong  <cyd@stupidchicken.com> 
    252 
    353        * Version 23.1 released. 
  • src/emacs.c

    diff -urN emacs-23.1-old/src/emacs.c emacs-23.1/src/emacs.c
    old new  
    11821182            argv[skip_args] = fdStr; 
    11831183 
    11841184            execv (argv[0], argv); 
    1185             fprintf (stderr, "emacs daemon: exec failed: %d\t%d\n", errno); 
     1185            fprintf (stderr, "emacs daemon: exec failed: %d\n", errno); 
    11861186            exit (1); 
    11871187          } 
    11881188 
  • src/font.c

    diff -urN emacs-23.1-old/src/font.c emacs-23.1/src/font.c
    old new  
    13571357    { 
    13581358      f[XLFD_AVGWIDTH_INDEX] = alloca (11); 
    13591359      len += sprintf (f[XLFD_AVGWIDTH_INDEX], 
    1360                       "%d", XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1; 
     1360                      "%ld", (long) XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1; 
    13611361    } 
    13621362  else 
    13631363    f[XLFD_AVGWIDTH_INDEX] = "*", len += 2; 
     
    16731673    } 
    16741674 
    16751675  if (INTEGERP (AREF (font, FONT_DPI_INDEX))) 
    1676     len += sprintf (work, ":dpi=%d", XINT (AREF (font, FONT_DPI_INDEX))); 
     1676    len += sprintf (work, ":dpi=%ld", (long) XINT (AREF (font, FONT_DPI_INDEX))); 
    16771677  if (INTEGERP (AREF (font, FONT_SPACING_INDEX))) 
    16781678    len += strlen (":spacing=100"); 
    16791679  if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) 
     
    16861686      if (STRINGP (val)) 
    16871687        len += SBYTES (val); 
    16881688      else if (INTEGERP (val)) 
    1689         len += sprintf (work, "%d", XINT (val)); 
     1689        len += sprintf (work, "%ld", (long) XINT (val)); 
    16901690      else if (SYMBOLP (val)) 
    16911691        len += (NILP (val) ? 5 : 4); /* for "false" or "true" */ 
    16921692    } 
     
    17131713      p += sprintf (p, ":%s=%s", style_names[i], 
    17141714                    SDATA (SYMBOL_NAME (styles[i]))); 
    17151715  if (INTEGERP (AREF (font, FONT_DPI_INDEX))) 
    1716     p += sprintf (p, ":dpi=%d", XINT (AREF (font, FONT_DPI_INDEX))); 
     1716    p += sprintf (p, ":dpi=%ld", (long) XINT (AREF (font, FONT_DPI_INDEX))); 
    17171717  if (INTEGERP (AREF (font, FONT_SPACING_INDEX))) 
    1718     p += sprintf (p, ":spacing=%d", XINT (AREF (font, FONT_SPACING_INDEX))); 
     1718    p += sprintf (p, ":spacing=%ld", 
     1719            (long) XINT (AREF (font, FONT_SPACING_INDEX))); 
    17191720  if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) 
    17201721    { 
    17211722      if (XINT (AREF (font, FONT_AVGWIDTH_INDEX)) == 0) 
  • src/menu.c

    diff -urN emacs-23.1-old/src/menu.c emacs-23.1/src/menu.c
    old new  
    10051005        { 
    10061006          entry 
    10071007            = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE]; 
    1008           if ((int) (EMACS_INT)client_data ==  (int)(&XVECTOR (menu_items)->contents[i])) 
     1008          if ((EMACS_INT)client_data == (EMACS_INT)(&XVECTOR (menu_items)->contents[i])) 
    10091009            { 
    10101010              if (keymaps != 0) 
    10111011                { 
  • src/nsfns.m

    diff -urN emacs-23.1-old/src/nsfns.m emacs-23.1/src/nsfns.m
    old new  
    17701770     Lisp_Object display; 
    17711771{ 
    17721772  check_ns (); 
    1773 #ifdef NS_IMPL_COCOA 
    1774   PSFlush (); 
    1775 #endif 
     1773 
    17761774  /*ns_delete_terminal (dpyinfo->terminal); */ 
    17771775  [NSApp terminate: NSApp]; 
    17781776  return Qnil; 
     
    22392237     Lisp_Object color, frame; 
    22402238{ 
    22412239  NSColor * col; 
    2242   float red, green, blue, alpha; 
     2240  CGFloat red, green, blue, alpha; 
    22432241  Lisp_Object rgba[4]; 
    22442242 
    22452243  check_ns (); 
  • src/nsfont.m

    diff -urN emacs-23.1-old/src/nsfont.m emacs-23.1/src/nsfont.m
    old new  
    238238            return w; 
    239239      } 
    240240#endif 
    241     w = [sfont widthOfString: cstr]; 
     241    NSDictionary *attrsDictionary = 
     242        [NSDictionary dictionaryWithObject: sfont 
     243                      forKey: NSFontAttributeName]; 
     244    w = [cstr sizeWithAttributes: attrsDictionary].width; 
    242245    return max (w, 2.0); 
    243246} 
    244247 
     
    510513      return ns_fallback_entity (); 
    511514 
    512515    if (NSFONT_TRACE) 
    513         fprintf (stderr, "    Returning %d entities.\n", XINT (Flength (list))); 
     516        fprintf (stderr, "    Returning %ld entities.\n", 
     517            (long) XINT (Flength (list))); 
    514518 
    515519    return list; 
    516520} 
     
    616620  /* FIXME: escape the name? */ 
    617621 
    618622  if (NSFONT_TRACE) 
    619     fprintf (stderr, "nsfont: list families returning %d entries\n", 
    620             XINT (Flength (list))); 
     623    fprintf (stderr, "nsfont: list families returning %ld entries\n", 
     624            (long) XINT (Flength (list))); 
    621625 
    622626  return list; 
    623627} 
     
    834838                ((CFStringRef)@"Monaco", kATSOptionFlagsDefault); 
    835839            } 
    836840        } 
     841 
     842#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 
     843      font_info->ctfont = 
     844          CTFontCreateWithPlatformFont (atsFont, 0.0f, NULL, NULL); 
     845      font_info->cgfont = CTFontCopyGraphicsFont (font_info->ctfont, NULL); 
     846#else 
    837847      font_info->cgfont = CGFontCreateWithPlatformFont ((void*)&atsFont); 
     848#endif 
    838849    } 
    839850#endif 
    840851 
    841852    /* set up metrics portion of font struct */ 
    842853    font->ascent = [sfont ascender]; 
    843854    font->descent = -[sfont descender]; 
    844     font->min_width = [sfont widthOfString: @"|"]; /* FIXME */ 
     855  
     856    /* FIXME */ 
     857    NSDictionary *attrsDictionary = 
     858        [NSDictionary dictionaryWithObject: sfont 
     859                      forKey: NSFontAttributeName]; 
     860    font->min_width = [@"|" sizeWithAttributes: attrsDictionary].width; 
     861 
    845862    font->space_width = lrint (ns_char_width (sfont, ' ')); 
    846863    font->average_width = lrint (font_info->width); 
    847864    font->max_width = lrint (font_info->max_bounds.width); 
     
    881898  [font_info->nsfont release]; 
    882899#ifdef NS_IMPL_COCOA 
    883900  CGFontRelease (font_info->cgfont); 
     901#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 
     902  CFRelease (font_info->ctfont); 
     903#endif 
    884904#endif 
    885905  xfree (font_info->name); 
    886906  xfree (font_info); 
     
    13011321    NSGlyphGenerator *glyphGenerator = [NSGlyphGenerator sharedGlyphGenerator]; 
    13021322    /*NSCharacterSet *coveredChars = [nsfont coveredCharacterSet]; */ 
    13031323    unsigned int numGlyphs = [font_info->nsfont numberOfGlyphs]; 
    1304     unsigned int gInd =0, cInd =0; 
     1324    NSUInteger gInd =0, cInd =0; 
    13051325 
    13061326    [glyphStorage setString: allChars font: font_info->nsfont]; 
    13071327    [glyphGenerator generateGlyphsForGlyphStorage: glyphStorage 
     
    14321452} 
    14331453 
    14341454/* NSGlyphStorage protocol */ 
    1435 - (unsigned int)layoutOptions 
     1455- (NSUInteger)layoutOptions 
    14361456{ 
    14371457  return 0; 
    14381458} 
     
    14421462  return attrStr; 
    14431463} 
    14441464 
    1445 - (void)insertGlyphs: (const NSGlyph *)glyphs length: (unsigned int)length 
    1446         forStartingGlyphAtIndex: (unsigned int)glyphIndex 
    1447         characterIndex: (unsigned int)charIndex 
     1465- (void)insertGlyphs: (const NSGlyph *)glyphs length: (NSUInteger)length 
     1466        forStartingGlyphAtIndex: (NSUInteger)glyphIndex 
     1467        characterIndex: (NSUInteger)charIndex 
    14481468{ 
    14491469  len = glyphIndex+length; 
    14501470  for (i =glyphIndex; i<len; i++) 
     
    14531473    maxGlyph = len; 
    14541474} 
    14551475 
    1456 - (void)setIntAttribute: (int)attributeTag value: (int)val 
    1457         forGlyphAtIndex: (unsigned)glyphIndex 
     1476- (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val 
     1477        forGlyphAtIndex: (NSUInteger)glyphIndex 
    14581478{ 
    14591479  return; 
    14601480} 
  • src/nsgui.h

    diff -urN emacs-23.1-old/src/nsgui.h emacs-23.1/src/nsgui.h
    old new  
    128128      unsigned width, height; 
    129129} XRectangle; 
    130130 
     131#if !defined(__OBJC__) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 
     132#ifdef _LP64 
     133typedef unsigned long NSUInteger; 
     134typedef long NSInteger; 
     135typedef double CGFloat; 
     136#else 
     137typedef unsigned int NSUInteger; 
     138typedef int NSInteger; 
     139typedef float CGFloat; 
     140#endif 
     141#endif 
     142 
    131143#ifndef __OBJC__ 
    132 typedef struct _NSPoint { float x, y; } NSPoint; 
    133 typedef struct _NSSize  { float width, height; } NSSize; 
     144typedef struct _NSPoint { CGFloat x, y; } NSPoint; 
     145typedef struct _NSSize  { CGFloat width, height; } NSSize; 
    134146typedef struct _NSRect  { NSPoint origin; NSSize size; } NSRect; 
    135147#endif 
    136148 
    137 #define NativeRectangle struct _NSRect 
     149#define NativeRectangle NSRect 
    138150 
    139151#define CONVERT_TO_XRECT(xr, nr)                \ 
    140152  ((xr).x     = (nr).origin.x,                  \ 
  • src/nsimage.m

    diff -urN emacs-23.1-old/src/nsimage.m emacs-23.1/src/nsimage.m
    old new  
    329329  NSSize s = [self size]; 
    330330  int len = (int) s.width * s.height; 
    331331  unsigned char *planes[5]; 
    332   float r, g, b, a; 
     332  CGFloat r, g, b, a; 
    333333  NSColor *rgbColor; 
    334334 
    335335  if (bmRep == nil || color == nil) 
     
    431431  else if (onTiger) 
    432432    { 
    433433      NSColor *color = [bmRep colorAtX: x y: y]; 
    434       float r, g, b, a; 
     434      CGFloat r, g, b, a; 
    435435      [color getRed: &r green: &g blue: &b alpha: &a]; 
    436436      return ((int)(a * 255.0) << 24) 
    437437        | ((int)(r * 255.0) << 16) | ((int)(g * 255.0) << 8) 
  • src/nsmenu.m

    diff -urN emacs-23.1-old/src/nsmenu.m emacs-23.1/src/nsmenu.m
    old new  
    656656      else 
    657657        [item setState: NSOffState]; 
    658658 
    659       [item setTag: (int)wv->call_data]; 
     659      [item setTag: (NSInteger)wv->call_data]; 
    660660    } 
    661661 
    662662  return item; 
     
    708708#ifdef NS_IMPL_GNUSTEP 
    709709  if ([[self window] isVisible]) 
    710710    [self sizeToFit]; 
    711 #else 
     711#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 
    712712  if ([self supermenu] == nil) 
    713713    [self sizeToFit]; 
    714714#endif 
     
    16111611#define TEXTHEIGHT      20.0 
    16121612#define MINCELLWIDTH    90.0 
    16131613 
    1614 - initWithContentRect: (NSRect)contentRect styleMask: (unsigned int)aStyle 
     1614- initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle 
    16151615              backing: (NSBackingStoreType)backingType defer: (BOOL)flag 
    16161616{ 
    16171617  NSSize spacing = {SPACER, SPACER}; 
  • src/nsterm.h

    diff -urN emacs-23.1-old/src/nsterm.h emacs-23.1/src/nsterm.h
    old new  
    420420#else /* GNUstep or OS X < 10.3 */ 
    421421  void *cgfont; 
    422422#endif 
     423  /* ctFont is used only on OS X 10.5+ */ 
     424#if defined (NS_IMPL_COCOA) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) 
     425  CTFontRef ctfont; 
     426#else /* GNUstep or OS X < 10.5 */ 
     427  void *ctfont; 
     428#endif 
    423429#else /* ! OBJC */ 
    424430  void *nsfont; 
    425431  void *cgfont; 
     432  void *ctfont; 
    426433#endif 
    427434  char bold, ital;  /* convenience flags */ 
    428435  char synthItal; 
  • src/nsterm.m

    diff -urN emacs-23.1-old/src/nsterm.m emacs-23.1/src/nsterm.m
    old new  
    15561556     Convert a color to a lisp string with the RGB equivalent 
    15571557   -------------------------------------------------------------------------- */ 
    15581558{ 
    1559   float red, green, blue, alpha, gray; 
     1559  CGFloat red, green, blue, alpha, gray; 
    15601560  char buf[1024]; 
    15611561  const char *str; 
    15621562  NSTRACE (ns_color_to_lisp); 
     
    15761576    { 
    15771577      [[col colorUsingColorSpaceName: NSCalibratedWhiteColorSpace] 
    15781578            getWhite: &gray alpha: &alpha]; 
    1579       snprintf (buf, sizeof (buf), "#%02.2lx%02.2lx%02.2lx", 
     1579      snprintf (buf, sizeof (buf), "#%2.2lx%2.2lx%2.2lx", 
    15801580                lrint (gray * 0xff), lrint (gray * 0xff), lrint (gray * 0xff)); 
    15811581      UNBLOCK_INPUT; 
    15821582      return build_string (buf); 
    15831583    } 
    15841584 
    1585   snprintf (buf, sizeof (buf), "#%02.2lx%02.2lx%02.2lx", 
     1585  snprintf (buf, sizeof (buf), "#%2.2lx%2.2lx%2.2lx", 
    15861586            lrint (red*0xff), lrint (green*0xff), lrint (blue*0xff)); 
    15871587 
    15881588  UNBLOCK_INPUT; 
     
    15981598         and set color_def pixel to the resulting index. 
    15991599   -------------------------------------------------------------------------- */ 
    16001600{ 
    1601   float r, g, b, a; 
     1601  CGFloat r, g, b, a; 
    16021602 
    16031603  [((NSColor *)col) getRed: &r green: &g blue: &b alpha: &a]; 
    16041604  color_def->red   = r * 65535; 
     
    48164816  return NSMakeRange (NSNotFound, 0); 
    48174817} 
    48184818 
    4819 - (unsigned int)characterIndexForPoint: (NSPoint)thePoint 
     4819- (NSUInteger)characterIndexForPoint: (NSPoint)thePoint 
    48204820{ 
    48214821  if (NS_KEYLOG) 
    48224822    NSLog (@"characterIndexForPoint request"); 
     
    54935493/* NSDraggingDestination protocol methods.  Actually this is not really a 
    54945494   protocol, but a category of Object.  O well...  */ 
    54955495 
    5496 -(unsigned int) draggingEntered: (id <NSDraggingInfo>) sender 
     5496-(NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender 
    54975497{ 
    54985498  NSTRACE (draggingEntered); 
    54995499  return NSDragOperationGeneric; 
     
    57785778#define SCROLL_BAR_FIRST_DELAY 0.5 
    57795779#define SCROLL_BAR_CONTINUOUS_DELAY (1.0 / 15) 
    57805780 
    5781 + (float) scrollerWidth 
     5781+ (CGFloat) scrollerWidth 
    57825782{ 
    57835783  /* TODO: if we want to allow variable widths, this is the place to do it, 
    57845784           however neither GNUstep nor Cocoa support it very well */ 
     
    59095909  em_whole = whole; 
    59105910 
    59115911  if (portion >= whole) 
    5912     [self setFloatValue: 0.0 knobProportion: 1.0]; 
     5912    { 
     5913#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 
     5914      [self setDoubleValue: 0.0]; 
     5915      [self setKnobProportion: 1.0]; 
     5916#else 
     5917      [self setFloatValue: 0.0 knobProportion: 1.0]; 
     5918#endif 
     5919    } 
    59135920  else 
    59145921    { 
    59155922      float pos, por; 
    59165923      portion = max ((float)whole*min_portion/pixel_height, portion); 
    59175924      pos = (float)position / (whole - portion); 
    59185925      por = (float)portion/whole; 
     5926#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 
     5927      [self setDoubleValue: pos]; 
     5928      [self setKnobProportion: por]; 
     5929#else 
    59195930      [self setFloatValue: pos knobProportion: por]; 
     5931#endif 
    59205932    } 
    59215933#ifdef NS_IMPL_GNUSTEP 
    59225934  [self display]; 
     
    60216033    case NSScrollerKnobSlot:  /* GNUstep-only */ 
    60226034      last_hit_part = scroll_bar_move_ratio; break; 
    60236035    default:  /* NSScrollerNoPart? */ 
    6024       fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %d\n", part); 
     6036      fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %ld\n", 
     6037             (long) part); 
    60256038      return; 
    60266039    } 
    60276040 
  • src/process.c

    diff -urN emacs-23.1-old/src/process.c emacs-23.1/src/process.c
    old new  
    15191519            insert_string ("?"); 
    15201520          if (INTEGERP (speed)) 
    15211521            { 
    1522               sprintf (tembuf, " at %d b/s", XINT (speed)); 
     1522              sprintf (tembuf, " at %ld b/s", (long) XINT (speed)); 
    15231523              insert_string (tembuf); 
    15241524            } 
    15251525          insert_string (")\n"); 
  • src/s/darwin.h

    diff -urN emacs-23.1-old/src/s/darwin.h emacs-23.1/src/s/darwin.h
    old new  
    171171#define malloc unexec_malloc 
    172172#define realloc unexec_realloc 
    173173#define free unexec_free 
     174/* Don't use posix_memalign because it is not compatible with 
     175   unexmacosx.c.  */ 
     176#undef HAVE_POSIX_MEMALIGN 
    174177#endif 
    175178 
    176179/* The ncurses library has been moved out of the System framework in 
  • src/unexmacosx.c

    diff -urN emacs-23.1-old/src/unexmacosx.c emacs-23.1/src/unexmacosx.c
    old new  
    582582      printf ("LC_UUID          "); 
    583583      break; 
    584584#endif 
     585#ifdef LC_DYLD_INFO 
     586    case LC_DYLD_INFO: 
     587      printf ("LC_DYLD_INFO     "); 
     588      break; 
     589    case LC_DYLD_INFO_ONLY: 
     590      printf ("LC_DYLD_INFO_ONLY"); 
     591      break; 
     592#endif 
    585593    default: 
    586594      printf ("unknown          "); 
    587595    } 
     
    676684        } 
    677685    } 
    678686 
    679   printf ("Highest address of load commands in input file: %#8x\n", 
    680           infile_lc_highest_addr); 
     687  printf ("Highest address of load commands in input file: %#8lx\n", 
     688          (long) infile_lc_highest_addr); 
    681689 
    682690  printf ("Lowest offset of all sections in __TEXT segment: %#8lx\n", 
    683691          text_seg_lowest_offset); 
     
    819827               || strncmp (sectp->sectname, "__const", 16) == 0 
    820828               || strncmp (sectp->sectname, "__cfstring", 16) == 0 
    821829               || strncmp (sectp->sectname, "__gcc_except_tab", 16) == 0 
     830               || strncmp (sectp->sectname, "__program_vars", 16) == 0 
    822831               || strncmp (sectp->sectname, "__objc_", 7) == 0) 
    823832        { 
    824833          if (!unexec_copy (sectp->offset, old_file_offset, sectp->size)) 
     
    10861095  curr_header_offset += lc->cmdsize; 
    10871096} 
    10881097 
     1098#ifdef LC_DYLD_INFO 
     1099/* Copy a LC_DYLD_INFO(_ONLY) load command from the input file to the output 
     1100   file, adjusting the file offset fields.  */ 
     1101static void 
     1102copy_dyld_info (struct load_command *lc, long delta) 
     1103{ 
     1104  struct dyld_info_command *dip = (struct dyld_info_command *) lc; 
     1105 
     1106  if (dip->rebase_off > 0) 
     1107    dip->rebase_off += delta; 
     1108  if (dip->bind_off > 0) 
     1109    dip->bind_off += delta; 
     1110  if (dip->weak_bind_off > 0) 
     1111    dip->weak_bind_off += delta; 
     1112  if (dip->lazy_bind_off > 0) 
     1113    dip->lazy_bind_off += delta; 
     1114  if (dip->export_off > 0) 
     1115    dip->export_off += delta; 
     1116 
     1117  printf ("Writing "); 
     1118  print_load_command_name (lc->cmd); 
     1119  printf (" command\n"); 
     1120 
     1121  if (!unexec_write (curr_header_offset, lc, lc->cmdsize)) 
     1122    unexec_error ("cannot write dyld info command to header"); 
     1123 
     1124  curr_header_offset += lc->cmdsize; 
     1125} 
     1126#endif 
     1127 
    10891128/* Copy other kinds of load commands from the input file to the output 
    10901129   file, ones that do not require adjustments of file offsets.  */ 
    10911130static void 
     
    11521191      case LC_TWOLEVEL_HINTS: 
    11531192        copy_twolevelhints (lca[i], linkedit_delta); 
    11541193        break; 
     1194#ifdef LC_DYLD_INFO 
     1195      case LC_DYLD_INFO: 
     1196      case LC_DYLD_INFO_ONLY: 
     1197        copy_dyld_info (lca[i], linkedit_delta); 
     1198        break; 
     1199#endif 
    11551200      default: 
    11561201        copy_other (lca[i]); 
    11571202        break;