From a855846b764dc5c31d1197b8305ced25fab01c74 Mon Sep 17 00:00:00 2001
From: Doug Coleman <doug.coleman@gmail.com>
Date: Wed, 19 Mar 2008 19:43:36 -0500
Subject: [PATCH 1/2] cairo dll update

---
 extra/cairo/ffi/ffi.factor | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extra/cairo/ffi/ffi.factor b/extra/cairo/ffi/ffi.factor
index d7aa90c464..76ce27975b 100644
--- a/extra/cairo/ffi/ffi.factor
+++ b/extra/cairo/ffi/ffi.factor
@@ -13,7 +13,7 @@ USING: alien alien.syntax combinators system ;
 IN: cairo.ffi
 
 << "cairo" {
-        { [ win32? ] [ "cairo.dll" ] }
+        { [ win32? ] [ "libcairo-2.dll" ] }
         ! { [ macosx? ] [ "libcairo.dylib" ] }
         { [ macosx? ] [ "/opt/local/lib/libcairo.dylib" ] }
         { [ unix? ] [ "libcairo.so.2" ] }

From 55a8c991ad329bdc53edfcd03722016474be9ec0 Mon Sep 17 00:00:00 2001
From: Doug Coleman <doug.coleman@gmail.com>
Date: Tue, 18 Mar 2008 18:59:37 -0500
Subject: [PATCH 2/2] fix gmt-offset on windows

---
 extra/calendar/windows/windows.factor | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/extra/calendar/windows/windows.factor b/extra/calendar/windows/windows.factor
index 1609b9f260..6986902ff1 100755
--- a/extra/calendar/windows/windows.factor
+++ b/extra/calendar/windows/windows.factor
@@ -1,22 +1,21 @@
 USING: calendar.backend namespaces alien.c-types
-windows windows.kernel32 kernel math ;
+windows windows.kernel32 kernel math combinators.cleave
+combinators ;
 IN: calendar.windows
 
 TUPLE: windows-calendar ;
 
 T{ windows-calendar } calendar-backend set-global
 
-: TIME_ZONE_ID_INVALID HEX: ffffffff ; inline
-
 M: windows-calendar gmt-offset ( -- hours minutes seconds )
-    0 0 0 ;
-    ! "TIME_ZONE_INFORMATION" <c-object>
-    ! dup GetTimeZoneInformation {
-    !     { [ dup TIME_ZONE_ID_INVALID = ] [ win32-error ] }
-    !     { [ dup { TIME_ZONE_ID_UNKNOWN TIME_ZONE_ID_STANDARD } member? ]
-    !         [ TIME_ZONE_INFORMATION-Bias 60 / neg ] }
-    !     { [ dup TIME_ZONE_ID_DAYLIGHT = ] [
-    !         [ TIME_ZONE_INFORMATION-Bias 60 / neg ]
-    !         [ TIME_ZONE_INFORMATION-DaylightBias ] bi
-    !     ] }
-    ! } cond ;
+    "TIME_ZONE_INFORMATION" <c-object>
+    dup GetTimeZoneInformation {
+        { [ dup TIME_ZONE_ID_INVALID = ] [ win32-error-string throw ] }
+        { [ dup [ TIME_ZONE_ID_UNKNOWN = ] [ TIME_ZONE_ID_STANDARD = ] bi or ] [
+            drop TIME_ZONE_INFORMATION-Bias ] }
+        { [ dup TIME_ZONE_ID_DAYLIGHT = ] [
+            drop
+            [ TIME_ZONE_INFORMATION-Bias ]
+            [ TIME_ZONE_INFORMATION-DaylightBias ] bi +
+        ] }
+    } cond neg 60 /mod 0 ;