unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fixes for 64-bit Emacs on Snow Leopard
@ 2009-09-07 21:08 Erik Charlebois
  2009-09-07 22:03 ` Chong Yidong
  2009-09-07 23:26 ` David Reitter
  0 siblings, 2 replies; 8+ messages in thread
From: Erik Charlebois @ 2009-09-07 21:08 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

I've posted the steps/fixes to get a 64-bit NS/Cocoa Emacs 23.1  
working for Snow Leopard on my blog at http://blog.fac9.com/index.php/2009/08/30/building-a-64-bit-emacs-on-snow-leopard/ 
  . I've been using it for a week without problems.

Feel free to roll those changes in, I haven't contributed to any GNU  
projects before so I'm not really sure where to begin making a patch /  
dealing with copyright assignment.

Which brings me to: is there a page somewhere with the steps on how to  
get involved /w emacs dev, what the contribution protocols are, who  
owns what area and such? I'm interested in improving Mac and Win32  
support.


Erik Charlebois
erikcharlebois@gmail.com





[-- Attachment #2: Type: text/html, Size: 2101 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Fixes for 64-bit Emacs on Snow Leopard
@ 2009-09-08  5:18 Eddie Hillenbrand
  0 siblings, 0 replies; 8+ messages in thread
From: Eddie Hillenbrand @ 2009-09-08  5:18 UTC (permalink / raw)
  To: emacs-devel

[-- 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 --]



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-09-09 12:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2009-09-08  5:18 Eddie Hillenbrand

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).