Changeset 1045

Show
Ignore:
Timestamp:
11/10/07 00:17:49 (10 months ago)
Author:
kris
Message:

fixes #27

Thanks to aaronc for the patches

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mango/icu/ICU.d

    r1036 r1045  
    5454        private static const final char[] ICUSig = "_3_0\0"; 
    5555        } 
    56      else 
     56version (ICU32) 
    5757        { 
    5858        private static const final char[] ICULib = "32"; 
    5959        private static const final char[] ICUSig = "_3_2\0"; 
    6060        } 
     61version (ICU34) 
     62        { 
     63        private static const final char[] ICULib = "34"; 
     64        private static const final char[] ICUSig = "_3_4\0"; 
     65        } 
     66version (ICU36) 
     67        { 
     68        private static const final char[] ICULib = "36"; 
     69        private static const final char[] ICUSig = "_3_6\0"; 
     70        } 
     71else  
     72        { 
     73        private static const final char[] ICULib = "38"; 
     74        private static const final char[] ICUSig = "_3_8\0"; 
     75        } 
    6176 
    6277/******************************************************************************* 
     
    8297        ***********************************************************************/ 
    8398 
    84         version(Win32)  
    85         { 
    86         protected static char[] icuuc = "icuuc"~ICULib~".dll";      
    87         protected static char[] icuin = "icuin"~ICULib~".dll";      
    88         } 
    89          else  
    90             version (linux) 
    91             { 
    92             protected static char[] icuuc = "libicuuc.so."~ICULib; 
    93             protected static char[] icuin = "libicui18n.so."~ICULib; 
     99        version (Win32)  
     100                { 
     101                protected static char[] icuuc = "icuuc"~ICULib~".dll";      
     102                protected static char[] icuin = "icuin"~ICULib~".dll";      
     103                } 
     104        else  
     105        version (linux) 
     106                { 
     107                protected static char[] icuuc = "libicuuc.so."~ICULib; 
     108                protected static char[] icuin = "libicui18n.so."~ICULib; 
     109                } 
     110        else  
     111        version (darwin)  
     112                { 
     113                protected static char[] icuuc = "libicuuc.dylib."~ICULib; 
     114                protected static char[] icuin = "libicui18n.dylib."~ICULib; 
     115                } 
     116        else 
     117           { 
     118           static assert (false); 
    94119           } 
    95             else  
    96                version (darwin)  
    97                { 
    98                protected static char[] icuuc = "libicuuc.dylib."~ICULib; 
    99                protected static char[] icuin = "libicui18n.dylib."~ICULib; 
    100                } 
    101                 else 
    102                    { 
    103                    static assert (false); 
    104                    } 
    105120 
    106121        /*********************************************************************** 
     
    671686else static assert(0); // need an implementation of FunctionLoader for this OS 
    672687 
     688 
  • trunk/mango/icu/UDateFormat.d

    r939 r1045  
    174174         
    175175                Open a new UDateFormat for formatting and parsing dates  
    176                 and time. 
    177  
    178         ***********************************************************************/ 
    179  
    180         this (Style time, Style date, inout ULocale locale, inout UTimeZone tz, UText pattern) 
     176                and time. If a pattern is not specified, an appropriate 
     177                one for the given locale will be used. 
     178 
     179        ***********************************************************************/ 
     180 
     181        this (Style time, Style date, inout ULocale locale, inout UTimeZone tz, UText pattern=null) 
    181182        { 
    182183                Error e; 
    183  
    184                 handle = udat_open (time, date, toString(locale.name), tz.name.ptr, tz.name.length, pattern.get.ptr, pattern.length, e); 
     184                char* p; 
     185                uint  c; 
     186 
     187                if (pattern) 
     188                    p = pattern.get.ptr, c = pattern.length; 
     189                handle = udat_open (time, date, toString(locale.name), tz.name.ptr, tz.name.length, p, c, e); 
    185190                testError (e, "failed to create DateFormat"); 
    186191        } 
     
    419424 
    420425 
     426 
  • trunk/mango/icu/UNumberFormat.d

    r939 r1045  
    704704                        }; 
    705705                         
    706         private enum    Style      
     706        public enum    Style      
    707707                        {   
    708708                        PatternDecimal,  
     
    932932 
    933933 
     934