unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* stack base on Mac OS X
@ 2004-05-24 12:37 Andreas Vögele
  2004-06-16  1:05 ` Rob Browning
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Vögele @ 2004-05-24 12:37 UTC (permalink / raw)


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

The stack base problem on Mac OS X can easily be fixed by using the 
preprocessor macros __APPLE__ and __MACH__ instead of the macro macosx, 
which is not defined by GCC on Mac OS X.

Hans Boehm's garbage collector now also uses __APPLE__ and __MACH__ and 
Apple's documentation says "To define a section of code to be compiled 
on Mac OS X system you should define a section using __APPLE__ with 
__MACH__ macros.". See 
http://developer.apple.com/technotes/tn2002/tn2071.html#Section10 for 
details.

The attached patch updates the preprocessor directives in gc_os_dep.c.  
The patch also separates the definition of the variable result in 
scm_get_stack_base() from the variable initialisation. If the 
definition and the initialisation are not separated GCC 3.3 complains 
about an unused variable on Mac OS X and HP-UX.


[-- Attachment #2: gc_os_dep.c.diff.c --]
[-- Type: text/plain, Size: 839 bytes --]

Index: gc_os_dep.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/gc_os_dep.c,v
retrieving revision 1.22
diff -u -r1.22 gc_os_dep.c
--- gc_os_dep.c	13 Nov 2003 18:19:02 -0000	1.22
+++ gc_os_dep.c	24 May 2004 11:59:22 -0000
@@ -266,7 +266,8 @@
 #   define MACOS
 #   define mach_type_known
 # endif
-# if defined(macosx)
+# if defined(macosx) || \
+     defined(__APPLE__) && defined(__MACH__) && defined(__ppc__)
 #    define MACOSX
 #    define POWERPC
 #    define mach_type_known
@@ -1878,7 +1879,9 @@
 void *scm_get_stack_base()
 {
     word dummy;
-    void *result = &dummy;  /* initialize to silence compiler */
+    void *result;
+   
+    result = &dummy;  /* initialize to silence compiler */
 
 #   define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1)
 

[-- Attachment #3: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile

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

* Re: stack base on Mac OS X
  2004-05-24 12:37 stack base on Mac OS X Andreas Vögele
@ 2004-06-16  1:05 ` Rob Browning
  2004-06-17  0:45   ` Rob Browning
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Browning @ 2004-06-16  1:05 UTC (permalink / raw)
  Cc: bug-guile

Andreas Vögele <voegelas@gmx.net> writes:

> The stack base problem on Mac OS X can easily be fixed by using the
> preprocessor macros __APPLE__ and __MACH__ instead of the macro
> macosx, which is not defined by GCC on Mac OS X.
>
> Hans Boehm's garbage collector now also uses __APPLE__ and __MACH__
> and Apple's documentation says "To define a section of code to be
> compiled on Mac OS X system you should define a section using
> __APPLE__ with __MACH__ macros.". See
> http://developer.apple.com/technotes/tn2002/tn2071.html#Section10 for
> details.

OK, I've added these changes to 1.6, and I'll add them to 1.7 in a
bit.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


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

* Re: stack base on Mac OS X
  2004-06-16  1:05 ` Rob Browning
@ 2004-06-17  0:45   ` Rob Browning
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Browning @ 2004-06-17  0:45 UTC (permalink / raw)
  Cc: bug-guile

Rob Browning <rlb@defaultvalue.org> writes:

> OK, I've added these changes to 1.6, and I'll add them to 1.7 in a
> bit.

OK, they're in 1.7 too now.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


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

end of thread, other threads:[~2004-06-17  0:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-24 12:37 stack base on Mac OS X Andreas Vögele
2004-06-16  1:05 ` Rob Browning
2004-06-17  0:45   ` Rob Browning

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).