From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eddie Hillenbrand Newsgroups: gmane.emacs.devel Subject: Re: Fixes for 64-bit Emacs on Snow Leopard Date: Mon, 7 Sep 2009 22:18:01 -0700 Message-ID: <85528437-A94F-4933-BAB9-B40254133975@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary=Apple-Mail-5--798025185 X-Trace: ger.gmane.org 1252387108 22508 80.91.229.12 (8 Sep 2009 05:18:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2009 05:18:28 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 08 07:18:21 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mkt5w-0005gW-3o for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2009 07:18:20 +0200 Original-Received: from localhost ([127.0.0.1]:35399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mkt5v-0005jz-Dj for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2009 01:18:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mkt5m-0005go-Bp for emacs-devel@gnu.org; Tue, 08 Sep 2009 01:18:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mkt5h-0005aJ-Je for emacs-devel@gnu.org; Tue, 08 Sep 2009 01:18:09 -0400 Original-Received: from [199.232.76.173] (port=44919 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mkt5h-0005a0-8m for emacs-devel@gnu.org; Tue, 08 Sep 2009 01:18:05 -0400 Original-Received: from caiajhbdcahe.dreamhost.com ([208.97.132.74]:34021 helo=homiemail-a13.g.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mkt5g-0002Do-MN for emacs-devel@gnu.org; Tue, 08 Sep 2009 01:18:05 -0400 Original-Received: from [10.0.1.4] (71-211-93-57.phnx.qwest.net [71.211.93.57]) by homiemail-a13.g.dreamhost.com (Postfix) with ESMTPA id 9CAD06A8058 for ; Mon, 7 Sep 2009 22:18:02 -0700 (PDT) X-Mailer: Apple Mail (2.936) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115119 Archived-At: --Apple-Mail-5--798025185 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi, Thanks to Erik Charlebois I was able to create a patch that would get Emacs.app to build on Snow Leopard. I did not use all of his changes and there are still many warnings, but Emacs.app at least builds. The patch is attached. All credit goes to Erik! Yay! --Apple-Mail-5--798025185 Content-Disposition: attachment; filename=emacs-app-snow-leopard.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="emacs-app-snow-leopard.patch" Content-Transfer-Encoding: 7bit diff --git a/src/dbusbind.c b/src/dbusbind.c --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1247,7 +1247,7 @@ CHECK_STRING (service); GCPRO3 (bus, serial, service); - XD_DEBUG_MESSAGE ("%d %s ", XUINT (serial), SDATA (service)); + XD_DEBUG_MESSAGE ("%ld %s ", XUINT (serial), SDATA (service)); /* Open a connection to the bus. */ connection = xd_initialize (bus); @@ -1341,7 +1341,7 @@ CHECK_STRING (service); GCPRO3 (bus, serial, service); - XD_DEBUG_MESSAGE ("%d %s ", XUINT (serial), SDATA (service)); + XD_DEBUG_MESSAGE ("%ld %s ", XUINT (serial), SDATA (service)); /* Open a connection to the bus. */ connection = xd_initialize (bus); diff --git a/src/font.c b/src/font.c --- a/src/font.c +++ b/src/font.c @@ -1357,7 +1357,7 @@ { f[XLFD_AVGWIDTH_INDEX] = alloca (11); len += sprintf (f[XLFD_AVGWIDTH_INDEX], - "%d", XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1; + "%ld", XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1; } else f[XLFD_AVGWIDTH_INDEX] = "*", len += 2; @@ -1673,7 +1673,7 @@ } if (INTEGERP (AREF (font, FONT_DPI_INDEX))) - len += sprintf (work, ":dpi=%d", XINT (AREF (font, FONT_DPI_INDEX))); + len += sprintf (work, ":dpi=%ld", XINT (AREF (font, FONT_DPI_INDEX))); if (INTEGERP (AREF (font, FONT_SPACING_INDEX))) len += strlen (":spacing=100"); if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) @@ -1686,7 +1686,7 @@ if (STRINGP (val)) len += SBYTES (val); else if (INTEGERP (val)) - len += sprintf (work, "%d", XINT (val)); + len += sprintf (work, "%ld", XINT (val)); else if (SYMBOLP (val)) len += (NILP (val) ? 5 : 4); /* for "false" or "true" */ } @@ -1713,9 +1713,9 @@ p += sprintf (p, ":%s=%s", style_names[i], SDATA (SYMBOL_NAME (styles[i]))); if (INTEGERP (AREF (font, FONT_DPI_INDEX))) - p += sprintf (p, ":dpi=%d", XINT (AREF (font, FONT_DPI_INDEX))); + p += sprintf (p, ":dpi=%ld", XINT (AREF (font, FONT_DPI_INDEX))); if (INTEGERP (AREF (font, FONT_SPACING_INDEX))) - p += sprintf (p, ":spacing=%d", XINT (AREF (font, FONT_SPACING_INDEX))); + p += sprintf (p, ":spacing=%ld", XINT (AREF (font, FONT_SPACING_INDEX))); if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) { if (XINT (AREF (font, FONT_AVGWIDTH_INDEX)) == 0) diff --git a/src/nsfns.m b/src/nsfns.m --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1772,7 +1772,7 @@ { check_ns (); #ifdef NS_IMPL_COCOA - PSFlush (); + /*PSFlush ();*/ #endif /*ns_delete_terminal (dpyinfo->terminal); */ [NSApp terminate: NSApp]; diff --git a/src/nsfont.m b/src/nsfont.m --- a/src/nsfont.m +++ b/src/nsfont.m @@ -245,7 +245,10 @@ return w; } #endif - w = [sfont widthOfString: cstr]; + NSDictionary *attrsDictionary = + [NSDictionary dictionaryWithObject:sfont + forKey:NSFontAttributeName]; + w = [cstr sizeWithAttributes:attrsDictionary].width; return max (w, 2.0); } diff --git a/src/nsgui.h b/src/nsgui.h --- a/src/nsgui.h +++ b/src/nsgui.h @@ -129,12 +129,13 @@ } XRectangle; #ifndef __OBJC__ -typedef struct _NSPoint { float x, y; } NSPoint; -typedef struct _NSSize { float width, height; } NSSize; +typedef double CGFloat; +typedef struct _NSPoint { CGFloat x, y; } NSPoint; +typedef struct _NSSize { CGFloat width, height; } NSSize; typedef struct _NSRect { NSPoint origin; NSSize size; } NSRect; #endif -#define NativeRectangle struct _NSRect +#define NativeRectangle NSRect #define CONVERT_TO_XRECT(xr, nr) \ ((xr).x = (nr).origin.x, \ diff --git a/src/nsterm.m b/src/nsterm.m --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1481,7 +1481,7 @@ Convert a color to a lisp string with the RGB equivalent -------------------------------------------------------------------------- */ { - float red, green, blue, alpha, gray; + CGFloat red, green, blue, alpha, gray; char buf[1024]; const char *str; NSTRACE (ns_color_to_lisp); @@ -1523,7 +1523,7 @@ and set color_def pixel to the resulting index. -------------------------------------------------------------------------- */ { - float r, g, b, a; + CGFloat r, g, b, a; [((NSColor *)col) getRed: &r green: &g blue: &b alpha: &a]; color_def->red = r * 65535; @@ -5833,15 +5833,18 @@ em_portion = portion; em_whole = whole; - if (portion >= whole) - [self setFloatValue: 0.0 knobProportion: 1.0]; + if (portion >= whole) { + [self setDoubleValue: 0.0]; + [self setKnobProportion: 1.0]; + } else { float pos, por; portion = max ((float)whole*min_portion/pixel_height, portion); pos = (float)position / (whole - portion); por = (float)portion/whole; - [self setFloatValue: pos knobProportion: por]; + [self setDoubleValue: pos]; + [self setKnobProportion: por]; } #ifdef NS_IMPL_GNUSTEP [self display]; @@ -5946,7 +5949,7 @@ case NSScrollerKnobSlot: /* GNUstep-only */ last_hit_part = scroll_bar_move_ratio; break; default: /* NSScrollerNoPart? */ - fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %d\n", part); + fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %ld\n", part); return; } diff --git a/src/process.c b/src/process.c --- a/src/process.c +++ b/src/process.c @@ -1522,7 +1522,7 @@ insert_string ("?"); if (INTEGERP (speed)) { - sprintf (tembuf, " at %d b/s", XINT (speed)); + sprintf (tembuf, " at %ld b/s", XINT (speed)); insert_string (tembuf); } insert_string (")\n"); --Apple-Mail-5--798025185 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-5--798025185--