From: Eddie Hillenbrand <edalytical@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Fixes for 64-bit Emacs on Snow Leopard
Date: Mon, 7 Sep 2009 22:18:01 -0700 [thread overview]
Message-ID: <85528437-A94F-4933-BAB9-B40254133975@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 270 bytes --]
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!
[-- Attachment #2: emacs-app-snow-leopard.patch --]
[-- Type: application/octet-stream, Size: 5589 bytes --]
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");
[-- Attachment #3: Type: text/plain, Size: 1 bytes --]
next reply other threads:[~2009-09-08 5:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-08 5:18 Eddie Hillenbrand [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-09-07 21:08 Fixes for 64-bit Emacs on Snow Leopard Erik Charlebois
2009-09-07 22:03 ` Chong Yidong
2009-09-09 12:56 ` Adrian Robert
2009-09-07 23:26 ` David Reitter
2009-09-08 8:14 ` Erik Charlebois
2009-09-08 17:38 ` CHENG Gao
2009-09-09 7:32 ` Erik Charlebois
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85528437-A94F-4933-BAB9-B40254133975@gmail.com \
--to=edalytical@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.