Ticket #20936: emacs-23.1-snow-leopard.patch
File emacs-23.1-snow-leopard.patch, 20.4 KB (added by dcreager@…, 15 years ago) |
---|
-
lib-src/ChangeLog
diff -urN emacs-23.1-old/lib-src/ChangeLog emacs-23.1/lib-src/ChangeLog
old new 1 2009-09-09 Erik Charlebois <erikcharlebois@gmail.com> 2 3 * movemail.c (error): Change fprintf to fputs to fix warning. 4 1 5 2009-07-29 Chong Yidong <cyd@stupidchicken.com> 2 6 3 7 * 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 622 622 else if (s2) 623 623 fprintf (stderr, s1, s2); 624 624 else 625 fp rintf (stderr, s1);625 fputs (s1, stderr); 626 626 fprintf (stderr, "\n"); 627 627 } 628 628 -
src/ChangeLog
diff -urN emacs-23.1-old/src/ChangeLog emacs-23.1/src/ChangeLog
old new 1 2009-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 1 51 2009-07-29 Chong Yidong <cyd@stupidchicken.com> 2 52 3 53 * Version 23.1 released. -
src/emacs.c
diff -urN emacs-23.1-old/src/emacs.c emacs-23.1/src/emacs.c
old new 1182 1182 argv[skip_args] = fdStr; 1183 1183 1184 1184 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); 1186 1186 exit (1); 1187 1187 } 1188 1188 -
src/font.c
diff -urN emacs-23.1-old/src/font.c emacs-23.1/src/font.c
old new 1357 1357 { 1358 1358 f[XLFD_AVGWIDTH_INDEX] = alloca (11); 1359 1359 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; 1361 1361 } 1362 1362 else 1363 1363 f[XLFD_AVGWIDTH_INDEX] = "*", len += 2; … … 1673 1673 } 1674 1674 1675 1675 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))); 1677 1677 if (INTEGERP (AREF (font, FONT_SPACING_INDEX))) 1678 1678 len += strlen (":spacing=100"); 1679 1679 if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) … … 1686 1686 if (STRINGP (val)) 1687 1687 len += SBYTES (val); 1688 1688 else if (INTEGERP (val)) 1689 len += sprintf (work, "% d",XINT (val));1689 len += sprintf (work, "%ld", (long) XINT (val)); 1690 1690 else if (SYMBOLP (val)) 1691 1691 len += (NILP (val) ? 5 : 4); /* for "false" or "true" */ 1692 1692 } … … 1713 1713 p += sprintf (p, ":%s=%s", style_names[i], 1714 1714 SDATA (SYMBOL_NAME (styles[i]))); 1715 1715 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))); 1717 1717 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))); 1719 1720 if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) 1720 1721 { 1721 1722 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 1005 1005 { 1006 1006 entry 1007 1007 = 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])) 1009 1009 { 1010 1010 if (keymaps != 0) 1011 1011 { -
src/nsfns.m
diff -urN emacs-23.1-old/src/nsfns.m emacs-23.1/src/nsfns.m
old new 1770 1770 Lisp_Object display; 1771 1771 { 1772 1772 check_ns (); 1773 #ifdef NS_IMPL_COCOA 1774 PSFlush (); 1775 #endif 1773 1776 1774 /*ns_delete_terminal (dpyinfo->terminal); */ 1777 1775 [NSApp terminate: NSApp]; 1778 1776 return Qnil; … … 2239 2237 Lisp_Object color, frame; 2240 2238 { 2241 2239 NSColor * col; 2242 float red, green, blue, alpha;2240 CGFloat red, green, blue, alpha; 2243 2241 Lisp_Object rgba[4]; 2244 2242 2245 2243 check_ns (); -
src/nsfont.m
diff -urN emacs-23.1-old/src/nsfont.m emacs-23.1/src/nsfont.m
old new 238 238 return w; 239 239 } 240 240 #endif 241 w = [sfont widthOfString: cstr]; 241 NSDictionary *attrsDictionary = 242 [NSDictionary dictionaryWithObject: sfont 243 forKey: NSFontAttributeName]; 244 w = [cstr sizeWithAttributes: attrsDictionary].width; 242 245 return max (w, 2.0); 243 246 } 244 247 … … 510 513 return ns_fallback_entity (); 511 514 512 515 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))); 514 518 515 519 return list; 516 520 } … … 616 620 /* FIXME: escape the name? */ 617 621 618 622 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))); 621 625 622 626 return list; 623 627 } … … 834 838 ((CFStringRef)@"Monaco", kATSOptionFlagsDefault); 835 839 } 836 840 } 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 837 847 font_info->cgfont = CGFontCreateWithPlatformFont ((void*)&atsFont); 848 #endif 838 849 } 839 850 #endif 840 851 841 852 /* set up metrics portion of font struct */ 842 853 font->ascent = [sfont ascender]; 843 854 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 845 862 font->space_width = lrint (ns_char_width (sfont, ' ')); 846 863 font->average_width = lrint (font_info->width); 847 864 font->max_width = lrint (font_info->max_bounds.width); … … 881 898 [font_info->nsfont release]; 882 899 #ifdef NS_IMPL_COCOA 883 900 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 884 904 #endif 885 905 xfree (font_info->name); 886 906 xfree (font_info); … … 1301 1321 NSGlyphGenerator *glyphGenerator = [NSGlyphGenerator sharedGlyphGenerator]; 1302 1322 /*NSCharacterSet *coveredChars = [nsfont coveredCharacterSet]; */ 1303 1323 unsigned int numGlyphs = [font_info->nsfont numberOfGlyphs]; 1304 unsigned intgInd =0, cInd =0;1324 NSUInteger gInd =0, cInd =0; 1305 1325 1306 1326 [glyphStorage setString: allChars font: font_info->nsfont]; 1307 1327 [glyphGenerator generateGlyphsForGlyphStorage: glyphStorage … … 1432 1452 } 1433 1453 1434 1454 /* NSGlyphStorage protocol */ 1435 - ( unsigned int)layoutOptions1455 - (NSUInteger)layoutOptions 1436 1456 { 1437 1457 return 0; 1438 1458 } … … 1442 1462 return attrStr; 1443 1463 } 1444 1464 1445 - (void)insertGlyphs: (const NSGlyph *)glyphs length: ( unsigned int)length1446 forStartingGlyphAtIndex: ( unsigned int)glyphIndex1447 characterIndex: ( unsigned int)charIndex1465 - (void)insertGlyphs: (const NSGlyph *)glyphs length: (NSUInteger)length 1466 forStartingGlyphAtIndex: (NSUInteger)glyphIndex 1467 characterIndex: (NSUInteger)charIndex 1448 1468 { 1449 1469 len = glyphIndex+length; 1450 1470 for (i =glyphIndex; i<len; i++) … … 1453 1473 maxGlyph = len; 1454 1474 } 1455 1475 1456 - (void)setIntAttribute: ( int)attributeTag value: (int)val1457 forGlyphAtIndex: ( unsigned)glyphIndex1476 - (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val 1477 forGlyphAtIndex: (NSUInteger)glyphIndex 1458 1478 { 1459 1479 return; 1460 1480 } -
src/nsgui.h
diff -urN emacs-23.1-old/src/nsgui.h emacs-23.1/src/nsgui.h
old new 128 128 unsigned width, height; 129 129 } XRectangle; 130 130 131 #if !defined(__OBJC__) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 132 #ifdef _LP64 133 typedef unsigned long NSUInteger; 134 typedef long NSInteger; 135 typedef double CGFloat; 136 #else 137 typedef unsigned int NSUInteger; 138 typedef int NSInteger; 139 typedef float CGFloat; 140 #endif 141 #endif 142 131 143 #ifndef __OBJC__ 132 typedef struct _NSPoint { float x, y; } NSPoint;133 typedef struct _NSSize { float width, height; } NSSize;144 typedef struct _NSPoint { CGFloat x, y; } NSPoint; 145 typedef struct _NSSize { CGFloat width, height; } NSSize; 134 146 typedef struct _NSRect { NSPoint origin; NSSize size; } NSRect; 135 147 #endif 136 148 137 #define NativeRectangle struct _NSRect149 #define NativeRectangle NSRect 138 150 139 151 #define CONVERT_TO_XRECT(xr, nr) \ 140 152 ((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 329 329 NSSize s = [self size]; 330 330 int len = (int) s.width * s.height; 331 331 unsigned char *planes[5]; 332 float r, g, b, a;332 CGFloat r, g, b, a; 333 333 NSColor *rgbColor; 334 334 335 335 if (bmRep == nil || color == nil) … … 431 431 else if (onTiger) 432 432 { 433 433 NSColor *color = [bmRep colorAtX: x y: y]; 434 float r, g, b, a;434 CGFloat r, g, b, a; 435 435 [color getRed: &r green: &g blue: &b alpha: &a]; 436 436 return ((int)(a * 255.0) << 24) 437 437 | ((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 656 656 else 657 657 [item setState: NSOffState]; 658 658 659 [item setTag: ( int)wv->call_data];659 [item setTag: (NSInteger)wv->call_data]; 660 660 } 661 661 662 662 return item; … … 708 708 #ifdef NS_IMPL_GNUSTEP 709 709 if ([[self window] isVisible]) 710 710 [self sizeToFit]; 711 #el se711 #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 712 712 if ([self supermenu] == nil) 713 713 [self sizeToFit]; 714 714 #endif … … 1611 1611 #define TEXTHEIGHT 20.0 1612 1612 #define MINCELLWIDTH 90.0 1613 1613 1614 - initWithContentRect: (NSRect)contentRect styleMask: ( unsigned int)aStyle1614 - initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle 1615 1615 backing: (NSBackingStoreType)backingType defer: (BOOL)flag 1616 1616 { 1617 1617 NSSize spacing = {SPACER, SPACER}; -
src/nsterm.h
diff -urN emacs-23.1-old/src/nsterm.h emacs-23.1/src/nsterm.h
old new 420 420 #else /* GNUstep or OS X < 10.3 */ 421 421 void *cgfont; 422 422 #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 423 429 #else /* ! OBJC */ 424 430 void *nsfont; 425 431 void *cgfont; 432 void *ctfont; 426 433 #endif 427 434 char bold, ital; /* convenience flags */ 428 435 char synthItal; -
src/nsterm.m
diff -urN emacs-23.1-old/src/nsterm.m emacs-23.1/src/nsterm.m
old new 1556 1556 Convert a color to a lisp string with the RGB equivalent 1557 1557 -------------------------------------------------------------------------- */ 1558 1558 { 1559 float red, green, blue, alpha, gray;1559 CGFloat red, green, blue, alpha, gray; 1560 1560 char buf[1024]; 1561 1561 const char *str; 1562 1562 NSTRACE (ns_color_to_lisp); … … 1576 1576 { 1577 1577 [[col colorUsingColorSpaceName: NSCalibratedWhiteColorSpace] 1578 1578 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", 1580 1580 lrint (gray * 0xff), lrint (gray * 0xff), lrint (gray * 0xff)); 1581 1581 UNBLOCK_INPUT; 1582 1582 return build_string (buf); 1583 1583 } 1584 1584 1585 snprintf (buf, sizeof (buf), "#% 02.2lx%02.2lx%02.2lx",1585 snprintf (buf, sizeof (buf), "#%2.2lx%2.2lx%2.2lx", 1586 1586 lrint (red*0xff), lrint (green*0xff), lrint (blue*0xff)); 1587 1587 1588 1588 UNBLOCK_INPUT; … … 1598 1598 and set color_def pixel to the resulting index. 1599 1599 -------------------------------------------------------------------------- */ 1600 1600 { 1601 float r, g, b, a;1601 CGFloat r, g, b, a; 1602 1602 1603 1603 [((NSColor *)col) getRed: &r green: &g blue: &b alpha: &a]; 1604 1604 color_def->red = r * 65535; … … 4816 4816 return NSMakeRange (NSNotFound, 0); 4817 4817 } 4818 4818 4819 - ( unsigned int)characterIndexForPoint: (NSPoint)thePoint4819 - (NSUInteger)characterIndexForPoint: (NSPoint)thePoint 4820 4820 { 4821 4821 if (NS_KEYLOG) 4822 4822 NSLog (@"characterIndexForPoint request"); … … 5493 5493 /* NSDraggingDestination protocol methods. Actually this is not really a 5494 5494 protocol, but a category of Object. O well... */ 5495 5495 5496 -( unsigned int) draggingEntered: (id <NSDraggingInfo>) sender5496 -(NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender 5497 5497 { 5498 5498 NSTRACE (draggingEntered); 5499 5499 return NSDragOperationGeneric; … … 5778 5778 #define SCROLL_BAR_FIRST_DELAY 0.5 5779 5779 #define SCROLL_BAR_CONTINUOUS_DELAY (1.0 / 15) 5780 5780 5781 + ( float) scrollerWidth5781 + (CGFloat) scrollerWidth 5782 5782 { 5783 5783 /* TODO: if we want to allow variable widths, this is the place to do it, 5784 5784 however neither GNUstep nor Cocoa support it very well */ … … 5909 5909 em_whole = whole; 5910 5910 5911 5911 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 } 5913 5920 else 5914 5921 { 5915 5922 float pos, por; 5916 5923 portion = max ((float)whole*min_portion/pixel_height, portion); 5917 5924 pos = (float)position / (whole - portion); 5918 5925 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 5919 5930 [self setFloatValue: pos knobProportion: por]; 5931 #endif 5920 5932 } 5921 5933 #ifdef NS_IMPL_GNUSTEP 5922 5934 [self display]; … … 6021 6033 case NSScrollerKnobSlot: /* GNUstep-only */ 6022 6034 last_hit_part = scroll_bar_move_ratio; break; 6023 6035 default: /* NSScrollerNoPart? */ 6024 fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %d\n", part); 6036 fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %ld\n", 6037 (long) part); 6025 6038 return; 6026 6039 } 6027 6040 -
src/process.c
diff -urN emacs-23.1-old/src/process.c emacs-23.1/src/process.c
old new 1519 1519 insert_string ("?"); 1520 1520 if (INTEGERP (speed)) 1521 1521 { 1522 sprintf (tembuf, " at % d b/s",XINT (speed));1522 sprintf (tembuf, " at %ld b/s", (long) XINT (speed)); 1523 1523 insert_string (tembuf); 1524 1524 } 1525 1525 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 171 171 #define malloc unexec_malloc 172 172 #define realloc unexec_realloc 173 173 #define free unexec_free 174 /* Don't use posix_memalign because it is not compatible with 175 unexmacosx.c. */ 176 #undef HAVE_POSIX_MEMALIGN 174 177 #endif 175 178 176 179 /* 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 582 582 printf ("LC_UUID "); 583 583 break; 584 584 #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 585 593 default: 586 594 printf ("unknown "); 587 595 } … … 676 684 } 677 685 } 678 686 679 printf ("Highest address of load commands in input file: %#8 x\n",680 infile_lc_highest_addr);687 printf ("Highest address of load commands in input file: %#8lx\n", 688 (long) infile_lc_highest_addr); 681 689 682 690 printf ("Lowest offset of all sections in __TEXT segment: %#8lx\n", 683 691 text_seg_lowest_offset); … … 819 827 || strncmp (sectp->sectname, "__const", 16) == 0 820 828 || strncmp (sectp->sectname, "__cfstring", 16) == 0 821 829 || strncmp (sectp->sectname, "__gcc_except_tab", 16) == 0 830 || strncmp (sectp->sectname, "__program_vars", 16) == 0 822 831 || strncmp (sectp->sectname, "__objc_", 7) == 0) 823 832 { 824 833 if (!unexec_copy (sectp->offset, old_file_offset, sectp->size)) … … 1086 1095 curr_header_offset += lc->cmdsize; 1087 1096 } 1088 1097 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. */ 1101 static void 1102 copy_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 1089 1128 /* Copy other kinds of load commands from the input file to the output 1090 1129 file, ones that do not require adjustments of file offsets. */ 1091 1130 static void … … 1152 1191 case LC_TWOLEVEL_HINTS: 1153 1192 copy_twolevelhints (lca[i], linkedit_delta); 1154 1193 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 1155 1200 default: 1156 1201 copy_other (lca[i]); 1157 1202 break;