Paste: set LC_NUMERIC locale to "C"

Author: jon
Mode: patch
Date: Sun, 20 May 2012 15:20:32
Plain Text |
diff --git a/basis/libc/libc.factor b/basis/libc/libc.factor
index e9693aa..30928c2 100644
--- a/basis/libc/libc.factor
+++ b/basis/libc/libc.factor
@@ -103,5 +103,22 @@ FUNCTION: size_t strlen ( c-string alien ) ;
 
 FUNCTION: int system ( c-string command ) ;
 
+! !!! category of setlocale
+CONSTANT: __LC_CTYPE 0
+CONSTANT: __LC_NUMERIC 1
+CONSTANT: __LC_TIME 2
+CONSTANT: __LC_COLLATE 3
+CONSTANT: __LC_MONETARY 4
+CONSTANT: __LC_MESSAGES 5
+CONSTANT: __LC_ALL 6
+CONSTANT: __LC_PAPER 7
+CONSTANT: __LC_NAME 8
+CONSTANT: __LC_ADDRESS 9
+CONSTANT: __LC_TELEPHONE 10
+CONSTANT: __LC_MEASUREMENT 11
+CONSTANT: __LC_IDENTIFICATION 12
+
+FUNCTION: c-string setlocale ( int category, c-string name ) ;
+
 DESTRUCTOR: free
 DESTRUCTOR: (free)
diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor
index 033a96a..352c8bb 100644
--- a/basis/ui/backend/gtk/gtk.factor
+++ b/basis/ui/backend/gtk/gtk.factor
@@ -11,7 +11,7 @@ strings system threads ui ui.backend
 ui.backend.gtk.input-methods ui.backend.gtk.io ui.clipboards
 ui.event-loop ui.gadgets ui.gadgets.private ui.gadgets.worlds
 ui.gestures ui.pixel-formats ui.pixel-formats.private ui.private
-vocabs.loader combinators ;
+vocabs.loader combinators libc ;
 IN: ui.backend.gtk
 
 SINGLETON: gtk-ui-backend
@@ -524,6 +524,7 @@ M:: gtk-ui-backend system-alert ( caption text -- )
 M: gtk-ui-backend (with-ui)
     [
         0 gint <ref> f void* <ref> gtk_init
+        __LC_NUMERIC "C" setlocale drop
         0 gint <ref> f void* <ref> gtk_gl_init
         load-icon
         init-clipboard

New Annotation

Summary:
Author:
Mode:
Body: