From 679b03f8dbc61729363228a76d190bb1a20e0dea Mon Sep 17 00:00:00 2001
From: Erik Charlebois <erikcharlebois@gmail.com>
Date: Thu, 23 Jun 2011 01:17:24 -0400
Subject: [PATCH 1/4] Remove unnecessary -std=gnu99

Flag isn't needed anymore with g++ and it causes warnings with clang.
---
 vm/Config.macosx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vm/Config.macosx b/vm/Config.macosx
index 5b9de7f5cf..693ee9341d 100644
--- a/vm/Config.macosx
+++ b/vm/Config.macosx
@@ -14,7 +14,7 @@ else
 	LIBS = -lm -framework Cocoa -framework AppKit
 endif
 
-LINKER = $(CPP) $(CFLAGS) -dynamiclib -single_module -std=gnu99 \
+LINKER = $(CPP) $(CFLAGS) -dynamiclib -single_module \
 	-current_version $(VERSION) \
 	-compatibility_version $(VERSION) \
 	-fvisibility=hidden \

From 3acee3e55ecb9c034e8cacfab68c04ac08c08a9a Mon Sep 17 00:00:00 2001
From: Erik Charlebois <erikcharlebois@gmail.com>
Date: Thu, 23 Jun 2011 01:18:35 -0400
Subject: [PATCH 2/4] Run vim synchronously

If you run vim from the terminal asynchronously, vim and factor will conflict accessing stdin and stdout.
---
 basis/editors/vim/vim.factor | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/basis/editors/vim/vim.factor b/basis/editors/vim/vim.factor
index a62ed9e0a5..55c3889e00 100644
--- a/basis/editors/vim/vim.factor
+++ b/basis/editors/vim/vim.factor
@@ -16,7 +16,7 @@ M: vim vim-command
     ] { } make ;
 
 : vim ( file line -- )
-    vim-command run-detached drop ;
+    vim-command run-process drop ;
 
 "vim" vim-path set-global
 [ vim ] edit-hook set-global

From 6fef726d5833c1232361334f00c1edd15e694933 Mon Sep 17 00:00:00 2001
From: Erik Charlebois <erikcharlebois@gmail.com>
Date: Fri, 29 Jul 2011 01:56:13 -0400
Subject: [PATCH 3/4] Replace deprecated words with alternatives.

A load-all on OS X now completes without any deprecated word warnings.
---
 extra/24-game/24-game.factor | 1 +
 extra/trees/avl/avl.factor   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/extra/24-game/24-game.factor b/extra/24-game/24-game.factor
index 28600b6c48..60f180877f 100644
--- a/extra/24-game/24-game.factor
+++ b/extra/24-game/24-game.factor
@@ -8,6 +8,7 @@ arrays words quotations accessors math.parser backtrack assocs ;
 IN: 24-game
 SYMBOL: commands
 : nop ( -- ) ;
+: spin ( a b c -- c b a ) swapd swap swap ;
 : do-something ( a b -- c ) { + - * } amb-execute ;
 : maybe-swap ( a b -- a b ) { nop swap } amb-execute ;
 : some-rots ( a b c -- a b c )
diff --git a/extra/trees/avl/avl.factor b/extra/trees/avl/avl.factor
index 68efbdd2b4..69252bf762 100644
--- a/extra/trees/avl/avl.factor
+++ b/extra/trees/avl/avl.factor
@@ -136,7 +136,7 @@ GENERIC: avl-delete ( key node -- node shorter? deleted? )
 M: f avl-delete ( key f -- f f f ) nip f f ;
 
 : (avl-delete) ( key node -- node shorter? deleted? )
-    tuck node-link avl-delete [
+    swap over node-link avl-delete [
         [ over set-node-link ] dip [ balance-delete ] [ f ] if
     ] dip ;
 

From 981477a7ff33cf544417d47adc2f42a85b578ff2 Mon Sep 17 00:00:00 2001
From: Erik Charlebois <erikcharlebois@gmail.com>
Date: Fri, 29 Jul 2011 01:57:14 -0400
Subject: [PATCH 4/4] Fix mason following PPC changes; target-os and target-cpu
 are no longer strings.

---
 extra/mason/child/child-tests.factor           | 17 +++++++++--------
 extra/mason/child/child.factor                 |  8 ++++----
 extra/mason/email/email-tests.factor           |  7 ++++---
 extra/mason/platform/platform.factor           |  3 ++-
 extra/mason/release/branch/branch-tests.factor | 11 ++++++-----
 5 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/extra/mason/child/child-tests.factor b/extra/mason/child/child-tests.factor
index 140288585f..34f9c10103 100644
--- a/extra/mason/child/child-tests.factor
+++ b/extra/mason/child/child-tests.factor
@@ -1,26 +1,27 @@
 IN: mason.child.tests
-USING: mason.child mason.config tools.test namespaces io kernel sequences ;
+USING: mason.child mason.config tools.test namespaces io kernel
+sequences system ;
 
 [ { "nmake" "/f" "nmakefile" "x86-32" } ] [
     [
-        "winnt" target-os set
-        "x86.32" target-cpu set
+        winnt target-os set
+        x86.32 target-cpu set
         make-cmd
     ] with-scope
 ] unit-test
 
 [ { "make" "macosx-x86-32" } ] [
     [
-        "macosx" target-os set
-        "x86.32" target-cpu set
+        macosx target-os set
+        x86.32 target-cpu set
         make-cmd
     ] with-scope
 ] unit-test
 
 [ { "./factor.com" "-i=boot.winnt-x86.32.image" "-no-user-init" } ] [
     [
-        "winnt" target-os set
-        "x86.32" target-cpu set
+        winnt target-os set
+        x86.32 target-cpu set
         boot-cmd
     ] with-scope
 ] unit-test
@@ -43,4 +44,4 @@ USING: mason.child mason.config tools.test namespaces io kernel sequences ;
         { [ ] [ ] }
         [ "B" ]
     } recover-cond
-] unit-test
\ No newline at end of file
+] unit-test
diff --git a/extra/mason/child/child.factor b/extra/mason/child/child.factor
index 66e6eb3722..3a7e88ac9b 100644
--- a/extra/mason/child/child.factor
+++ b/extra/mason/child/child.factor
@@ -9,14 +9,14 @@ IN: mason.child
 
 : nmake-cmd ( -- args )
     { "nmake" "/f" "nmakefile" }
-    target-cpu get "." split "-" join suffix ;
+    target-cpu get name>> "." split "-" join suffix ;
 
 : gnu-make-cmd ( -- args )
     gnu-make platform 2array ;
 
 : make-cmd ( -- args )
     {
-        { [ target-os get "winnt" = ] [ nmake-cmd ] }
+        { [ target-os get winnt = ] [ nmake-cmd ] }
         [ gnu-make-cmd ]
     } cond ;
 
@@ -30,7 +30,7 @@ IN: mason.child
     ] with-directory ;
 
 : factor-vm ( -- string )
-    target-os get "winnt" = "./factor.com" "./factor" ? ;
+    target-os get winnt = "./factor.com" "./factor" ? ;
 
 : boot-cmd ( -- cmd )
     [
@@ -79,4 +79,4 @@ MACRO: recover-cond ( alist -- )
         { [ notify-boot boot ] [ boot-failed ] }
         { [ notify-test test ] [ test-failed ] }
         [ success ]
-    } recover-cond ;
\ No newline at end of file
+    } recover-cond ;
diff --git a/extra/mason/email/email-tests.factor b/extra/mason/email/email-tests.factor
index 77f651feb9..5e4f93de52 100644
--- a/extra/mason/email/email-tests.factor
+++ b/extra/mason/email/email-tests.factor
@@ -1,10 +1,11 @@
 IN: mason.email.tests
-USING: mason.email mason.common mason.config namespaces tools.test ;
+USING: mason.email mason.common mason.config namespaces
+tools.test system ;
 
 [ "mason on linux-x86-64: 12345 -- error" ] [
     [
-        "linux" target-os set
-        "x86.64" target-cpu set
+        linux target-os set
+        x86.64 target-cpu set
         "12345" current-git-id set
         status-error report-subject
     ] with-scope
diff --git a/extra/mason/platform/platform.factor b/extra/mason/platform/platform.factor
index 2a33c5240b..92d4ace972 100644
--- a/extra/mason/platform/platform.factor
+++ b/extra/mason/platform/platform.factor
@@ -5,13 +5,14 @@ mason.config bootstrap.image assocs ;
 IN: mason.platform
 
 : (platform) ( os cpu -- string )
+    [ name>> ] bi@
     { { CHAR: . CHAR: - } } substitute "-" glue ;
 
 : platform ( -- string )
     target-os get target-cpu get (platform) ;
 
 : gnu-make ( -- string )
-    target-os get { "freebsd" "openbsd" "netbsd" } member? "gmake" "make" ? ;
+    target-os get { freebsd openbsd netbsd } member? "gmake" "make" ? ;
 
 : boot-image-arch ( -- string )
     target-os get target-cpu get arch ;
diff --git a/extra/mason/release/branch/branch-tests.factor b/extra/mason/release/branch/branch-tests.factor
index 8327ae985d..47ebe3b404 100644
--- a/extra/mason/release/branch/branch-tests.factor
+++ b/extra/mason/release/branch/branch-tests.factor
@@ -1,13 +1,14 @@
 IN: mason.release.branch.tests
-USING: mason.release.branch mason.config tools.test namespaces ;
+USING: mason.release.branch mason.config tools.test namespaces
+system ;
 
 [ { "git" "push" "-f" "joe@blah.com:/my/git" "master:clean-linux-x86-32" } ] [
     [
         "joe" branch-username set
         "blah.com" branch-host set
         "/my/git" branch-directory set
-        "linux" target-os set
-        "x86.32" target-cpu set
+        linux target-os set
+        x86.32 target-cpu set
         push-to-clean-branch-cmd
     ] with-scope
 ] unit-test
@@ -18,8 +19,8 @@ USING: mason.release.branch mason.config tools.test namespaces ;
         "joe" image-username set
         "blah.com" image-host set
         "/stuff/clean" image-directory set
-        "netbsd" target-os set
-        "x86.64" target-cpu set
+        netbsd target-os set
+        x86.64 target-cpu set
         upload-clean-image-cmd
     ] with-scope
 ] unit-test