Changeset 24539

Show
Ignore:
Timestamp:
11/21/08 04:56:26 (6 years ago)
Author:
saturday06
Message:

hobifuioi@kl@pojhgyhiky

Location:
lang/cplusplus/i3/trunk
Files:
1 added
6 modified
1 moved

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/i3/trunk/TODO.txt

    r23693 r24539  
    7979*2 Windowsの他、gtk+付きUNIX系OSに対応 
    8080*3 C/Migemoを利用 
     81 
     82 
     83 
     84*** 
     85*アイコンはもっと貝の色を白くましろく!!!!!!!!!!!! 
     86 
     87 
  • lang/cplusplus/i3/trunk/po/POTFILES.in

    r23492 r24539  
    77src/CompletionWindow.cpp 
    88src/CompletionWindow.h 
     9src/Config.cpp 
     10src/Config.h 
    911src/Delegate.cpp 
    1012src/Delegate.h 
     
    5961src/mol/include/mol/Mol.h 
    6062src/mol/include/mol/MscCrt.h 
    61 src/mol/include/mol/os-posix/Debug.h 
    62 src/mol/include/mol/os-posix/Os.h 
    63 src/mol/include/mol/os-posix/PrecompiledHeaders.h 
    64 src/mol/include/mol/os-posix/ThreadCore.h 
     63src/mol/include/mol/os-unix/Debug.h 
     64src/mol/include/mol/os-unix/Os.h 
     65src/mol/include/mol/os-unix/PrecompiledHeaders.h 
     66src/mol/include/mol/os-unix/ThreadCore.h 
    6567src/mol/include/mol/os-windows/Common.h 
    6668src/mol/include/mol/os-windows/Debug.h 
     
    8082src/mol/src/Test3.cpp 
    8183src/mol/src/windows/WindowProcedureTest.cpp 
    82 src/os-posix/Os.cpp 
    83 src/os-posix/Os.h 
    84 src/os-posix/OsTest1.cpp 
    85 src/os-posix/OsTest2.cpp 
     84src/os-unix/Os.cpp 
     85src/os-unix/Os.h 
     86src/os-unix/OsTest1.cpp 
     87src/os-unix/OsTest2.cpp 
    8688src/os-windows/CygwinPty.cpp 
    8789src/os-windows/CygwinPty.h 
    88 src/os-windows/msvc/argtable2.h 
     90src/os-windows/libintl.h 
    8991src/os-windows/msvc/iconv.h 
    90 src/os-windows/msvc/libintl.h 
    91 src/os-windows/msvc/popt.h 
    9292src/os-windows/Os.cpp 
    9393src/os-windows/Os.h 
  • lang/cplusplus/i3/trunk/src/os-windows/Os.cpp

    r24497 r24539  
    107107    return check_args(); 
    108108#endif 
    109  
     109    return 0; 
    110110} 
    111111extern HINSTANCE hInstance; 
  • lang/cplusplus/i3/trunk/src/os-windows/libintl.h

    r23755 r24539  
    4949 
    5050#ifdef __cplusplus 
    51 extern "C" 
    52 { 
    53 #endif 
    54  
    55  
    56     /* Version number: (major<<16) + (minor<<8) + subminor */ 
     51extern "C" { 
     52#endif 
     53 
     54 
     55/* Version number: (major<<16) + (minor<<8) + subminor */ 
    5756#define LIBINTL_VERSION 0x001100 
    58     extern int libintl_version; 
    59  
    60  
    61     /* We redirect the functions to those prefixed with "libintl_".  This is 
    62        necessary, because some systems define gettext/textdomain/... in the C 
    63        library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). 
    64        If we used the unprefixed names, there would be cases where the 
    65        definition in the C library would override the one in the libintl.so 
    66        shared library.  Recall that on ELF systems, the symbols are looked 
    67        up in the following order: 
    68          1. in the executable, 
    69          2. in the shared libraries specified on the link command line, in order, 
    70          3. in the dependencies of the shared libraries specified on the link 
    71             command line, 
    72          4. in the dlopen()ed shared libraries, in the order in which they were 
    73             dlopen()ed. 
    74        The definition in the C library would override the one in libintl.so if 
    75        either 
    76          * -lc is given on the link command line and -lintl isn't, or 
    77          * -lc is given on the link command line before -lintl, or 
    78          * libintl.so is a dependency of a dlopen()ed shared library but not 
    79            linked to the executable at link time. 
    80        Since Solaris gettext() behaves differently than GNU gettext(), this 
    81        would be unacceptable. 
    82  
    83        The redirection happens by default through macros in C, so that &gettext 
    84        is independent of the compilation unit, but through inline functions in 
    85        C++, in order not to interfere with the name mangling of class fields or 
    86        class methods called 'gettext'.  */ 
    87  
    88     /* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. 
    89        If he doesn't, we choose the method.  A third possible method is 
    90        _INTL_REDIRECT_ASM, supported only by GCC.  */ 
     57extern int libintl_version; 
     58 
     59 
     60/* We redirect the functions to those prefixed with "libintl_".  This is 
     61   necessary, because some systems define gettext/textdomain/... in the C 
     62   library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). 
     63   If we used the unprefixed names, there would be cases where the 
     64   definition in the C library would override the one in the libintl.so 
     65   shared library.  Recall that on ELF systems, the symbols are looked 
     66   up in the following order: 
     67     1. in the executable, 
     68     2. in the shared libraries specified on the link command line, in order, 
     69     3. in the dependencies of the shared libraries specified on the link 
     70        command line, 
     71     4. in the dlopen()ed shared libraries, in the order in which they were 
     72        dlopen()ed. 
     73   The definition in the C library would override the one in libintl.so if 
     74   either 
     75     * -lc is given on the link command line and -lintl isn't, or 
     76     * -lc is given on the link command line before -lintl, or 
     77     * libintl.so is a dependency of a dlopen()ed shared library but not 
     78       linked to the executable at link time. 
     79   Since Solaris gettext() behaves differently than GNU gettext(), this 
     80   would be unacceptable. 
     81 
     82   The redirection happens by default through macros in C, so that &gettext 
     83   is independent of the compilation unit, but through inline functions in 
     84   C++, in order not to interfere with the name mangling of class fields or 
     85   class methods called 'gettext'.  */ 
     86 
     87/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. 
     88   If he doesn't, we choose the method.  A third possible method is 
     89   _INTL_REDIRECT_ASM, supported only by GCC.  */ 
    9190#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) 
    9291# if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) 
     
    10099# endif 
    101100#endif 
    102     /* Auxiliary macros.  */ 
     101/* Auxiliary macros.  */ 
    103102#ifdef _INTL_REDIRECT_ASM 
    104103# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) 
     
    109108#endif 
    110109 
    111     /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return 
    112        its n-th argument literally.  This enables GCC to warn for example about 
    113        printf (gettext ("foo %y")).  */ 
     110/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return 
     111   its n-th argument literally.  This enables GCC to warn for example about 
     112   printf (gettext ("foo %y")).  */ 
    114113#if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus) 
    115114# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n))) 
     
    118117#endif 
    119118 
    120     /* Look up MSGID in the current default message catalog for the current 
    121        LC_MESSAGES locale.  If not found, returns MSGID itself (the default 
    122        text).  */ 
    123 #ifdef _INTL_REDIRECT_INLINE 
    124     extern char *libintl_gettext (const char *__msgid) 
    125         _INTL_MAY_RETURN_STRING_ARG (1); 
    126     static inline char *gettext (const char *__msgid) 
    127     { 
    128         return libintl_gettext (__msgid); 
    129     } 
     119/* Look up MSGID in the current default message catalog for the current 
     120   LC_MESSAGES locale.  If not found, returns MSGID itself (the default 
     121   text).  */ 
     122#ifdef _INTL_REDIRECT_INLINE 
     123extern char *libintl_gettext (const char *__msgid) 
     124       _INTL_MAY_RETURN_STRING_ARG (1); 
     125static inline char *gettext (const char *__msgid) 
     126{ 
     127  return libintl_gettext (__msgid); 
     128} 
    130129#else 
    131130#ifdef _INTL_REDIRECT_MACROS 
    132131# define gettext libintl_gettext 
    133132#endif 
    134     extern char *gettext (const char *__msgid) 
    135         _INTL_ASM (libintl_gettext) 
    136         _INTL_MAY_RETURN_STRING_ARG (1); 
    137 #endif 
    138  
    139     /* Look up MSGID in the DOMAINNAME message catalog for the current 
    140        LC_MESSAGES locale.  */ 
    141 #ifdef _INTL_REDIRECT_INLINE 
    142     extern char *libintl_dgettext (const char *__domainname, const char *__msgid) 
    143         _INTL_MAY_RETURN_STRING_ARG (2); 
    144     static inline char *dgettext (const char *__domainname, const char *__msgid) 
    145     { 
    146         return libintl_dgettext (__domainname, __msgid); 
    147     } 
     133extern char *gettext (const char *__msgid) 
     134       _INTL_ASM (libintl_gettext) 
     135       _INTL_MAY_RETURN_STRING_ARG (1); 
     136#endif 
     137 
     138/* Look up MSGID in the DOMAINNAME message catalog for the current 
     139   LC_MESSAGES locale.  */ 
     140#ifdef _INTL_REDIRECT_INLINE 
     141extern char *libintl_dgettext (const char *__domainname, const char *__msgid) 
     142       _INTL_MAY_RETURN_STRING_ARG (2); 
     143static inline char *dgettext (const char *__domainname, const char *__msgid) 
     144{ 
     145  return libintl_dgettext (__domainname, __msgid); 
     146} 
    148147#else 
    149148#ifdef _INTL_REDIRECT_MACROS 
    150149# define dgettext libintl_dgettext 
    151150#endif 
    152     extern char *dgettext (const char *__domainname, const char *__msgid) 
    153         _INTL_ASM (libintl_dgettext) 
    154         _INTL_MAY_RETURN_STRING_ARG (2); 
    155 #endif 
    156  
    157     /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 
    158        locale.  */ 
    159 #ifdef _INTL_REDIRECT_INLINE 
    160     extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, 
    161                                         int __category) 
    162         _INTL_MAY_RETURN_STRING_ARG (2); 
    163     static inline char *dcgettext (const char *__domainname, const char *__msgid, 
    164                                    int __category) 
    165     { 
    166         return libintl_dcgettext (__domainname, __msgid, __category); 
    167     } 
     151extern char *dgettext (const char *__domainname, const char *__msgid) 
     152       _INTL_ASM (libintl_dgettext) 
     153       _INTL_MAY_RETURN_STRING_ARG (2); 
     154#endif 
     155 
     156/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 
     157   locale.  */ 
     158#ifdef _INTL_REDIRECT_INLINE 
     159extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, 
     160                                int __category) 
     161       _INTL_MAY_RETURN_STRING_ARG (2); 
     162static inline char *dcgettext (const char *__domainname, const char *__msgid, 
     163                               int __category) 
     164{ 
     165  return libintl_dcgettext (__domainname, __msgid, __category); 
     166} 
    168167#else 
    169168#ifdef _INTL_REDIRECT_MACROS 
    170169# define dcgettext libintl_dcgettext 
    171170#endif 
    172     extern char *dcgettext (const char *__domainname, const char *__msgid, 
    173                                 int __category) 
    174         _INTL_ASM (libintl_dcgettext) 
    175         _INTL_MAY_RETURN_STRING_ARG (2); 
    176 #endif 
    177  
    178  
    179     /* Similar to `gettext' but select the plural form corresponding to the 
    180        number N.  */ 
    181 #ifdef _INTL_REDIRECT_INLINE 
    182     extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, 
    183                                        unsigned long int __n) 
    184         _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); 
    185     static inline char *ngettext (const char *__msgid1, const char *__msgid2, 
    186                                   unsigned long int __n) 
    187     { 
    188         return libintl_ngettext (__msgid1, __msgid2, __n); 
    189     } 
     171extern char *dcgettext (const char *__domainname, const char *__msgid, 
     172                        int __category) 
     173       _INTL_ASM (libintl_dcgettext) 
     174       _INTL_MAY_RETURN_STRING_ARG (2); 
     175#endif 
     176 
     177 
     178/* Similar to `gettext' but select the plural form corresponding to the 
     179   number N.  */ 
     180#ifdef _INTL_REDIRECT_INLINE 
     181extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, 
     182                               unsigned long int __n) 
     183       _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); 
     184static inline char *ngettext (const char *__msgid1, const char *__msgid2, 
     185                              unsigned long int __n) 
     186{ 
     187  return libintl_ngettext (__msgid1, __msgid2, __n); 
     188} 
    190189#else 
    191190#ifdef _INTL_REDIRECT_MACROS 
    192191# define ngettext libintl_ngettext 
    193192#endif 
    194     extern char *ngettext (const char *__msgid1, const char *__msgid2, 
    195                                unsigned long int __n) 
    196         _INTL_ASM (libintl_ngettext) 
    197         _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); 
    198 #endif 
    199  
    200     /* Similar to `dgettext' but select the plural form corresponding to the 
    201        number N.  */ 
    202 #ifdef _INTL_REDIRECT_INLINE 
    203     extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, 
    204                                         const char *__msgid2, unsigned long int __n) 
    205         _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 
    206     static inline char *dngettext (const char *__domainname, const char *__msgid1, 
    207                                    const char *__msgid2, unsigned long int __n) 
    208     { 
    209         return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); 
    210     } 
     193extern char *ngettext (const char *__msgid1, const char *__msgid2, 
     194                       unsigned long int __n) 
     195       _INTL_ASM (libintl_ngettext) 
     196       _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); 
     197#endif 
     198 
     199/* Similar to `dgettext' but select the plural form corresponding to the 
     200   number N.  */ 
     201#ifdef _INTL_REDIRECT_INLINE 
     202extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, 
     203                                const char *__msgid2, unsigned long int __n) 
     204       _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 
     205static inline char *dngettext (const char *__domainname, const char *__msgid1, 
     206                               const char *__msgid2, unsigned long int __n) 
     207{ 
     208  return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); 
     209} 
    211210#else 
    212211#ifdef _INTL_REDIRECT_MACROS 
    213212# define dngettext libintl_dngettext 
    214213#endif 
    215     extern char *dngettext (const char *__domainname, 
    216                                 const char *__msgid1, const char *__msgid2, 
    217                                 unsigned long int __n) 
    218         _INTL_ASM (libintl_dngettext) 
    219         _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 
    220 #endif 
    221  
    222     /* Similar to `dcgettext' but select the plural form corresponding to the 
    223        number N.  */ 
    224 #ifdef _INTL_REDIRECT_INLINE 
    225     extern char *libintl_dcngettext (const char *__domainname, 
    226                                         const char *__msgid1, const char *__msgid2, 
    227                                         unsigned long int __n, int __category) 
    228         _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 
    229     static inline char *dcngettext (const char *__domainname, 
    230                                     const char *__msgid1, const char *__msgid2, 
    231                                     unsigned long int __n, int __category) 
    232     { 
    233         return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); 
    234     } 
     214extern char *dngettext (const char *__domainname, 
     215                        const char *__msgid1, const char *__msgid2, 
     216                        unsigned long int __n) 
     217       _INTL_ASM (libintl_dngettext) 
     218       _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 
     219#endif 
     220 
     221/* Similar to `dcgettext' but select the plural form corresponding to the 
     222   number N.  */ 
     223#ifdef _INTL_REDIRECT_INLINE 
     224extern char *libintl_dcngettext (const char *__domainname, 
     225                                const char *__msgid1, const char *__msgid2, 
     226                                unsigned long int __n, int __category) 
     227       _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 
     228static inline char *dcngettext (const char *__domainname, 
     229                                const char *__msgid1, const char *__msgid2, 
     230                                unsigned long int __n, int __category) 
     231{ 
     232  return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); 
     233} 
    235234#else 
    236235#ifdef _INTL_REDIRECT_MACROS 
    237236# define dcngettext libintl_dcngettext 
    238237#endif 
    239     extern char *dcngettext (const char *__domainname, 
    240                                 const char *__msgid1, const char *__msgid2, 
    241                                 unsigned long int __n, int __category) 
    242         _INTL_ASM (libintl_dcngettext) 
    243         _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 
    244 #endif 
    245  
    246  
    247  
    248     /* Set the current default message catalog to DOMAINNAME. 
    249        If DOMAINNAME is null, return the current default. 
    250        If DOMAINNAME is "", reset to the default of "messages".  */ 
    251 #ifdef _INTL_REDIRECT_INLINE 
    252     extern char *libintl_textdomain (const char *__domainname); 
    253     static inline char *textdomain (const char *__domainname) 
    254     { 
    255         return libintl_textdomain (__domainname); 
    256     } 
     238extern char *dcngettext (const char *__domainname, 
     239                        const char *__msgid1, const char *__msgid2, 
     240                        unsigned long int __n, int __category) 
     241       _INTL_ASM (libintl_dcngettext) 
     242       _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 
     243#endif 
     244 
     245 
     246 
     247/* Set the current default message catalog to DOMAINNAME. 
     248   If DOMAINNAME is null, return the current default. 
     249   If DOMAINNAME is "", reset to the default of "messages".  */ 
     250#ifdef _INTL_REDIRECT_INLINE 
     251extern char *libintl_textdomain (const char *__domainname); 
     252static inline char *textdomain (const char *__domainname) 
     253{ 
     254  return libintl_textdomain (__domainname); 
     255} 
    257256#else 
    258257#ifdef _INTL_REDIRECT_MACROS 
    259258# define textdomain libintl_textdomain 
    260259#endif 
    261     extern char *textdomain (const char *__domainname) 
    262         _INTL_ASM (libintl_textdomain); 
    263 #endif 
    264  
    265     /* Specify that the DOMAINNAME message catalog will be found 
    266        in DIRNAME rather than in the system locale data base.  */ 
    267 #ifdef _INTL_REDIRECT_INLINE 
    268     extern char *libintl_bindtextdomain (const char *__domainname, 
    269                                              const char *__dirname); 
    270     static inline char *bindtextdomain (const char *__domainname, 
    271                                         const char *__dirname) 
    272     { 
    273         return libintl_bindtextdomain (__domainname, __dirname); 
    274     } 
     260extern char *textdomain (const char *__domainname) 
     261       _INTL_ASM (libintl_textdomain); 
     262#endif 
     263 
     264/* Specify that the DOMAINNAME message catalog will be found 
     265   in DIRNAME rather than in the system locale data base.  */ 
     266#ifdef _INTL_REDIRECT_INLINE 
     267extern char *libintl_bindtextdomain (const char *__domainname, 
     268                                     const char *__dirname); 
     269static inline char *bindtextdomain (const char *__domainname, 
     270                                    const char *__dirname) 
     271{ 
     272  return libintl_bindtextdomain (__domainname, __dirname); 
     273} 
    275274#else 
    276275#ifdef _INTL_REDIRECT_MACROS 
    277276# define bindtextdomain libintl_bindtextdomain 
    278277#endif 
    279     extern char *bindtextdomain (const char *__domainname, const char *__dirname) 
    280         _INTL_ASM (libintl_bindtextdomain); 
    281 #endif 
    282  
    283     /* Specify the character encoding in which the messages from the 
    284        DOMAINNAME message catalog will be returned.  */ 
    285 #ifdef _INTL_REDIRECT_INLINE 
    286     extern char *libintl_bind_textdomain_codeset (const char *__domainname, 
    287                 const char *__codeset); 
    288     static inline char *bind_textdomain_codeset (const char *__domainname, 
    289             const char *__codeset) 
    290     { 
    291         return libintl_bind_textdomain_codeset (__domainname, __codeset); 
    292     } 
     278extern char *bindtextdomain (const char *__domainname, const char *__dirname) 
     279       _INTL_ASM (libintl_bindtextdomain); 
     280#endif 
     281 
     282/* Specify the character encoding in which the messages from the 
     283   DOMAINNAME message catalog will be returned.  */ 
     284#ifdef _INTL_REDIRECT_INLINE 
     285extern char *libintl_bind_textdomain_codeset (const char *__domainname, 
     286                                              const char *__codeset); 
     287static inline char *bind_textdomain_codeset (const char *__domainname, 
     288                                             const char *__codeset) 
     289{ 
     290  return libintl_bind_textdomain_codeset (__domainname, __codeset); 
     291} 
    293292#else 
    294293#ifdef _INTL_REDIRECT_MACROS 
    295294# define bind_textdomain_codeset libintl_bind_textdomain_codeset 
    296295#endif 
    297     extern char *bind_textdomain_codeset (const char *__domainname, 
    298                                               const char *__codeset) 
    299         _INTL_ASM (libintl_bind_textdomain_codeset); 
    300 #endif 
    301  
    302  
    303  
    304     /* Support for format strings with positions in *printf(), following the 
    305        POSIX/XSI specification. 
    306        Note: These replacements for the *printf() functions are visible only 
    307        in source files that #include <libintl.h> or #include "gettext.h". 
    308        Packages that use *printf() in source files that don't refer to _() 
    309        or gettext() but for which the format string could be the return value 
    310        of _() or gettext() need to add this #include.  Oh well.  */ 
    311  
    312 #if 0 
     296extern char *bind_textdomain_codeset (const char *__domainname, 
     297                                      const char *__codeset) 
     298       _INTL_ASM (libintl_bind_textdomain_codeset); 
     299#endif 
     300 
     301 
     302 
     303/* Support for format strings with positions in *printf(), following the 
     304   POSIX/XSI specification. 
     305   Note: These replacements for the *printf() functions are visible only 
     306   in source files that #include <libintl.h> or #include "gettext.h". 
     307   Packages that use *printf() in source files that don't refer to _() 
     308   or gettext() but for which the format string could be the return value 
     309   of _() or gettext() need to add this #include.  Oh well.  */ 
     310 
     311#if !0 
    313312 
    314313#include <stdio.h> 
    315314#include <stddef.h> 
    316315 
    317     /* Get va_list.  */ 
     316/* Get va_list.  */ 
    318317#if __STDC__ || defined __cplusplus || defined _MSC_VER 
    319318# include <stdarg.h> 
     
    324323#undef fprintf 
    325324#define fprintf libintl_fprintf 
    326     extern int fprintf (FILE *, const char *, ...); 
     325extern int fprintf (FILE *, const char *, ...); 
    327326#undef vfprintf 
    328327#define vfprintf libintl_vfprintf 
    329     extern int vfprintf (FILE *, const char *, va_list); 
     328extern int vfprintf (FILE *, const char *, va_list); 
    330329 
    331330#undef printf 
    332331#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ 
    333     /* Don't break __attribute__((format(printf,M,N))). 
    334        This redefinition is only possible because the libc in NetBSD, Cygwin, 
    335        mingw does not have a function __printf__.  */ 
     332/* Don't break __attribute__((format(printf,M,N))). 
     333   This redefinition is only possible because the libc in NetBSD, Cygwin, 
     334   mingw does not have a function __printf__.  */ 
    336335# define libintl_printf __printf__ 
    337336#endif 
    338337#define printf libintl_printf 
    339     extern int printf (const char *, ...); 
     338extern int printf (const char *, ...); 
    340339#undef vprintf 
    341340#define vprintf libintl_vprintf 
    342     extern int vprintf (const char *, va_list); 
     341extern int vprintf (const char *, va_list); 
    343342 
    344343#undef sprintf 
    345344#define sprintf libintl_sprintf 
    346     extern int sprintf (char *, const char *, ...); 
     345extern int sprintf (char *, const char *, ...); 
    347346#undef vsprintf 
    348347#define vsprintf libintl_vsprintf 
    349     extern int vsprintf (char *, const char *, va_list); 
    350  
    351 #if 0 
     348extern int vsprintf (char *, const char *, va_list); 
     349 
     350#if 1 
    352351 
    353352#undef snprintf 
    354353#define snprintf libintl_snprintf 
    355     extern int snprintf (char *, size_t, const char *, ...); 
     354extern int snprintf (char *, size_t, const char *, ...); 
    356355#undef vsnprintf 
    357356#define vsnprintf libintl_vsnprintf 
    358     extern int vsnprintf (char *, size_t, const char *, va_list); 
     357extern int vsnprintf (char *, size_t, const char *, va_list); 
    359358 
    360359#endif 
     
    364363#undef asprintf 
    365364#define asprintf libintl_asprintf 
    366     extern int asprintf (char **, const char *, ...); 
     365extern int asprintf (char **, const char *, ...); 
    367366#undef vasprintf 
    368367#define vasprintf libintl_vasprintf 
    369     extern int vasprintf (char **, const char *, va_list); 
     368extern int vasprintf (char **, const char *, va_list); 
    370369 
    371370#endif 
     
    375374#undef fwprintf 
    376375#define fwprintf libintl_fwprintf 
    377     extern int fwprintf (FILE *, const wchar_t *, ...); 
     376extern int fwprintf (FILE *, const wchar_t *, ...); 
    378377#undef vfwprintf 
    379378#define vfwprintf libintl_vfwprintf 
    380     extern int vfwprintf (FILE *, const wchar_t *, va_list); 
     379extern int vfwprintf (FILE *, const wchar_t *, va_list); 
    381380 
    382381#undef wprintf 
    383382#define wprintf libintl_wprintf 
    384     extern int wprintf (const wchar_t *, ...); 
     383extern int wprintf (const wchar_t *, ...); 
    385384#undef vwprintf 
    386385#define vwprintf libintl_vwprintf 
    387     extern int vwprintf (const wchar_t *, va_list); 
     386extern int vwprintf (const wchar_t *, va_list); 
    388387 
    389388#undef swprintf 
    390389#define swprintf libintl_swprintf 
    391     extern int swprintf (wchar_t *, size_t, const wchar_t *, ...); 
     390extern int swprintf (wchar_t *, size_t, const wchar_t *, ...); 
    392391#undef vswprintf 
    393392#define vswprintf libintl_vswprintf 
    394     extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); 
    395  
    396 #endif 
    397  
    398 #endif 
    399  
    400  
    401     /* Support for relocatable packages.  */ 
    402  
    403     /* Sets the original and the current installation prefix of the package. 
    404        Relocation simply replaces a pathname starting with the original prefix 
    405        by the corresponding pathname with the current prefix instead.  Both 
    406        prefixes should be directory names without trailing slash (i.e. use "" 
    407        instead of "/").  */ 
     393extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); 
     394 
     395#endif 
     396 
     397#endif 
     398 
     399 
     400/* Support for relocatable packages.  */ 
     401 
     402/* Sets the original and the current installation prefix of the package. 
     403   Relocation simply replaces a pathname starting with the original prefix 
     404   by the corresponding pathname with the current prefix instead.  Both 
     405   prefixes should be directory names without trailing slash (i.e. use "" 
     406   instead of "/").  */ 
    408407#define libintl_set_relocation_prefix libintl_set_relocation_prefix 
    409     extern void 
    410         libintl_set_relocation_prefix (const char *orig_prefix, 
    411                                        const char *curr_prefix); 
    412  
    413  
    414     /* Wide character support.  */ 
    415     /* XXX inline ! */ 
    416 #ifdef _INTL_REDIRECT_INLINE 
    417 #define WIDE_LIBINTL_STATIC_INLINE static inline 
     408extern void 
     409       libintl_set_relocation_prefix (const char *orig_prefix, 
     410                                      const char *curr_prefix); 
     411 
     412/* wchar_t support */ 
     413#ifdef _INTL_REDIRECT_INLINE 
     414#define WCHAR_LIBINTL_STATIC_INLINE static inline 
    418415#elif defined(_MSC_VER) 
    419 #define WIDE_LIBINTL_STATIC_INLINE static _inline 
    420 #else 
    421 #define WIDE_LIBINTL_STATIC_INLINE static 
     416#define WCHAR_LIBINTL_STATIC_INLINE static _inline 
     417#else 
     418#define WCHAR_LIBINTL_STATIC_INLINE static 
    422419#endif 
    423420 
     
    429426#define dcnwgettext(domainname, msgid1, msgid2, n, category) dnwgettext_(domainname, msgid1, msgid2, n, L##msgid1,  L##msgid2) 
    430427 
    431     WIDE_LIBINTL_STATIC_INLINE  
    432     const wchar_t* wgettext_(const char* msgid, const wchar_t* wmsgid) { 
    433         const char* translated = gettext(msgid); 
    434         return translated != msgid ? (const wchar_t*)translated : wmsgid; 
    435     } 
    436  
    437     WIDE_LIBINTL_STATIC_INLINE  
    438     const wchar_t* dwgettext_(const char *domainname, const char* msgid, const wchar_t* wmsgid) { 
    439         const char* translated = dgettext(domainname, msgid); 
    440         return translated != msgid ? (const wchar_t*)translated : wmsgid; 
    441     } 
    442  
    443     WIDE_LIBINTL_STATIC_INLINE  
    444     const wchar_t* dcwgettext_(const char *domainname, const char* msgid, int category,  const wchar_t* wmsgid) { 
    445         const char* translated = dcgettext(domainname, msgid, category); 
    446         return translated != msgid ? (const wchar_t*)translated : wmsgid; 
    447     } 
    448  
    449     WIDE_LIBINTL_STATIC_INLINE  
    450     const wchar_t* nwgettext_(const char* msgid1, const char* msgid2, unsigned long n, const wchar_t* wmsgid1, const wchar_t* wmsgid2) { 
    451         const char* translated = ngettext(msgid1, msgid2, n); 
    452         return translated == msgid1 ? wmsgid1 : (translated == msgid2 ? wmsgid2 : (const wchar_t*)translated); 
    453     } 
    454  
    455     WIDE_LIBINTL_STATIC_INLINE  
    456     const wchar_t* dnwgettext_(const char* domainname, const char* msgid1, const char* msgid2, unsigned long n, const wchar_t* wmsgid1, const wchar_t* wmsgid2) { 
    457         const char* translated = dngettext(domainname, msgid1, msgid2, n); 
    458         return translated == msgid1 ? wmsgid1 : (translated == msgid2 ? wmsgid2 : (const wchar_t*)translated); 
    459     } 
    460  
    461     WIDE_LIBINTL_STATIC_INLINE  
    462     const wchar_t* dcnwgettext_(const char* domainname, const char* msgid1, const char* msgid2, unsigned long n, const wchar_t* wmsgid1, const wchar_t* wmsgid2, int category) { 
    463         const char* translated = dcngettext(domainname, msgid1, msgid2, n, category); 
    464         return translated == msgid1 ? wmsgid1 : (translated == msgid2 ? wmsgid2 : (const wchar_t*)translated); 
    465     } 
     428WCHAR_LIBINTL_STATIC_INLINE  
     429const wchar_t *wgettext_ (const char *msgid, const wchar_t *wmsgid) 
     430{ 
     431  const char *translated = gettext (msgid); 
     432  return translated != msgid ? (const wchar_t *)translated : wmsgid; 
     433} 
     434 
     435WCHAR_LIBINTL_STATIC_INLINE  
     436const wchar_t *dwgettext_ (const char *domainname, const char *msgid, const wchar_t *wmsgid) 
     437{ 
     438  const char *translated = dgettext (domainname, msgid); 
     439  return translated != msgid ? (const wchar_t *)translated : wmsgid; 
     440} 
     441 
     442WCHAR_LIBINTL_STATIC_INLINE  
     443const wchar_t *dcwgettext_ (const char *domainname, const char *msgid, int category,  const wchar_t *wmsgid) 
     444{ 
     445  const char *translated = dcgettext (domainname, msgid, category); 
     446  return translated != msgid ? (const wchar_t *)translated : wmsgid; 
     447} 
     448 
     449WCHAR_LIBINTL_STATIC_INLINE  
     450const wchar_t *nwgettext_ (const char *msgid1, const char *msgid2, unsigned long n, const wchar_t *wmsgid1, const wchar_t *wmsgid2) 
     451{ 
     452  const char *translated = ngettext (msgid1, msgid2, n); 
     453  return translated == msgid1 ? wmsgid1 : (translated == msgid2 ? wmsgid2 : (const wchar_t *)translated); 
     454} 
     455 
     456WCHAR_LIBINTL_STATIC_INLINE  
     457const wchar_t *dnwgettext_ (const char *domainname, const char *msgid1, const char *msgid2, unsigned long n, const wchar_t *wmsgid1, const wchar_t *wmsgid2) 
     458{ 
     459  const char *translated = dngettext (domainname, msgid1, msgid2, n); 
     460  return translated == msgid1 ? wmsgid1 : (translated == msgid2 ? wmsgid2 : (const wchar_t *)translated); 
     461} 
     462 
     463WCHAR_LIBINTL_STATIC_INLINE  
     464const wchar_t *dcnwgettext_ (const char *domainname, const char *msgid1, const char *msgid2, unsigned long n, const wchar_t *wmsgid1, const wchar_t *wmsgid2, int category) 
     465{ 
     466  const char *translated = dcngettext (domainname, msgid1, msgid2, n, category); 
     467  return translated == msgid1 ? wmsgid1 : (translated == msgid2 ? wmsgid2 : (const wchar_t *)translated); 
     468} 
    466469 
    467470#ifdef __cplusplus 
     
    469472#endif 
    470473 
    471 #if (defined(WIN32) || defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE)) && !defined(__CYGWIN__) 
     474/* MS Windows Wide character support.  */ 
     475#if (defined(WIN32) || defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE)) \ 
     476    && !defined(__CYGWIN__) && (defined(UNICODE) || defined(_UNICODE)) 
    472477 
    473478#include <windows.h> 
    474  
    475 #ifdef _MSC_VER 
    476 #include <malloc.h> 
    477 #endif 
    478479 
    479480#ifdef __cplusplus 
     
    486487#define wbindtextdomain windows_wbindtextdomain 
    487488 
    488     WIDE_LIBINTL_STATIC_INLINE  
    489     const wchar_t* windows_wbindtextdomain(const char* domainname, const wchar_t* dirname16) { 
    490         char* dirname8 = NULL; 
    491         unsigned int num_elements = 0; 
    492  
    493         num_elements = WideCharToMultiByte(CP_UTF8, 0, dirname16, -1, NULL, 0, 0, 0); 
    494         if (num_elements == 0 || num_elements >= MAX_PATH) { 
    495             return NULL; 
    496         } 
    497  
    498 #ifdef _MSC_VER 
    499         if (num_elements > _ALLOCA_S_THRESHOLD) { 
    500             return NULL; 
    501         } 
    502         __try { 
    503             dirname8 = (char*)alloca(num_elements); 
    504         } __except (GetExceptionCode() == STATUS_STACK_OVERFLOW ?  
    505                         EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { 
    506             return NULL; 
    507         } 
    508 #else 
    509         dirname8 = (char*)alloca(num_elements); 
    510 #endif 
    511         if (0 == WideCharToMultiByte(CP_UTF8, 0, dirname16, -1, dirname8, num_elements, 0, 0)) { 
    512             return NULL; 
    513         } 
    514  
    515         if (libintl_bindtextdomain(domainname, dirname8) == NULL) { 
    516             return NULL; 
    517         } 
    518  
    519         return dirname16; 
    520     } 
    521  
    522     WIDE_LIBINTL_STATIC_INLINE  
    523     const char* windows_bindtextdomain(const char* domainname, const char* dirname) { 
    524         wchar_t* dirname16 = NULL; 
    525         unsigned int num_elements = 0; 
    526         UINT acp = 0; 
    527  
    528         acp = GetACP(); 
    529  
    530         num_elements = MultiByteToWideChar(acp, 0, dirname, -1, NULL, 0); 
    531         if (num_elements == 0 || num_elements >= MAX_PATH) { 
    532             return NULL; 
    533         } 
    534  
    535 #ifdef _MSC_VER 
    536         { 
    537             const size_t dirname16_bytes = num_elements*sizeof(wchar_t); 
    538             if (dirname16_bytes > _ALLOCA_S_THRESHOLD) { 
    539                 return NULL; 
    540             } 
    541             __try { 
    542                 dirname16 = (wchar_t*)alloca(dirname16_bytes); 
    543             } __except (GetExceptionCode() == STATUS_STACK_OVERFLOW ?  
    544                         EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { 
    545                 return NULL; 
    546             } 
    547         } 
    548 #else 
    549         dirname16 = (wchar_t*)alloca(num_elements*sizeof(wchar_t)); 
    550 #endif 
    551         if (0 == MultiByteToWideChar(acp, 0, dirname, -1, dirname16, num_elements)) { 
    552             return NULL; 
    553         } 
    554  
    555         if (windows_wbindtextdomain(domainname, dirname16) == NULL) { 
    556             return NULL; 
    557         } 
    558  
    559         return dirname; 
    560     } 
     489/* http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx */ 
     490#define WCHAR_LIBINTL_MAX_PATH 33000 
     491 
     492WCHAR_LIBINTL_STATIC_INLINE 
     493const wchar_t *windows_wbindtextdomain (const char *domainname, const wchar_t *dirname16) 
     494{ 
     495  char *dirname8 = NULL; 
     496  unsigned int num_elements = 0; 
     497 
     498 
     499  if (wcslen (dirname16) >= WCHAR_LIBINTL_MAX_PATH) 
     500    { 
     501      return NULL; 
     502    } 
     503 
     504  num_elements = WideCharToMultiByte (CP_UTF8, 0, dirname16, -1, NULL, 0, 0, 0); 
     505  if (num_elements == 0) 
     506    { 
     507      return NULL; 
     508    } 
     509 
     510  dirname8 = (char *)malloc (num_elements); 
     511  if (!dirname8) 
     512    { 
     513      return NULL; 
     514    } 
     515 
     516  if (0 == WideCharToMultiByte (CP_UTF8, 0, dirname16, -1, dirname8, num_elements, 0, 0)) 
     517    { 
     518      free (dirname8); 
     519      return NULL; 
     520    } 
     521 
     522  if (libintl_bindtextdomain (domainname, dirname8) == NULL) 
     523    { 
     524      free (dirname8); 
     525      return NULL; 
     526    } 
     527 
     528  free (dirname8); 
     529 
     530  return dirname16; 
     531} 
     532 
     533WCHAR_LIBINTL_STATIC_INLINE 
     534const char *windows_bindtextdomain(const char *domainname, const char *dirname) 
     535{ 
     536  wchar_t *dirname16 = NULL; 
     537  unsigned int num_elements = 0; 
     538  UINT acp = 0; 
     539   
     540  acp = GetACP (); 
     541   
     542  num_elements = MultiByteToWideChar (acp, 0, dirname, -1, NULL, 0); 
     543  if (num_elements == 0) 
     544    { 
     545      return NULL; 
     546    } 
     547 
     548  if (num_elements >= WCHAR_LIBINTL_MAX_PATH) 
     549    { 
     550      return NULL; 
     551    } 
     552 
     553  dirname16 = (wchar_t *)malloc (num_elements * sizeof(wchar_t)); 
     554 
     555  if (0 == MultiByteToWideChar (acp, 0, dirname, -1, 
     556                                dirname16, num_elements)) 
     557    { 
     558      free (dirname16); 
     559      return NULL; 
     560    } 
     561 
     562  if (windows_wbindtextdomain (domainname, dirname16) == NULL) 
     563    { 
     564      free (dirname16); 
     565      return NULL; 
     566    } 
     567 
     568  free (dirname16); 
     569 
     570  return dirname; 
     571} 
    561572 
    562573#ifdef __cplusplus 
     
    564575#endif 
    565576 
    566 #endif /* (defined(WIN32) || defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE)) && !defined(__CYGWIN__) */ 
    567 #undef WIDE_LIBINTL_STATIC_INLINE  
     577#endif /*  (defined(WIN32) || defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE)) \ 
     578    && !defined(__CYGWIN__) && (defined(UNICODE) || defined(_UNICODE)) */ 
     579 
     580#undef WCHAR_LIBINTL_MAX_PATH 
     581#undef WCHAR_LIBINTL_STATIC_INLINE  
    568582 
    569583#endif /* libintl.h */ 
     584 
     585 
  • lang/cplusplus/i3/trunk/src/os-windows/msvc/win_iconv.c

  • lang/cplusplus/i3/trunk/windows/i3.vcproj

    r23849 r24539  
    302302                        </File> 
    303303                        <File 
     304                                RelativePath="..\src\Config.h" 
     305                                > 
     306                        </File> 
     307                        <File 
    304308                                RelativePath="..\src\os-windows\CygwinPty.h" 
    305309                                > 
     
    387391                        <File 
    388392                                RelativePath="..\src\gui-windows\CompletionWindowCore.cpp" 
     393                                > 
     394                        </File> 
     395                        <File 
     396                                RelativePath="..\src\Config.cpp" 
    389397                                > 
    390398                        </File> 
     
    454462                        </File> 
    455463                        <File 
    456                                 RelativePath="..\src\os-windows\win_iconv.c" 
     464                                RelativePath="..\src\os-windows\msvc\win_iconv.c" 
    457465                                > 
    458466                                <FileConfiguration 
     
    486494                        </File> 
    487495                </Filter> 
    488                 <File 
    489                         RelativePath="..\src\Config.cpp" 
    490                         > 
    491                 </File> 
    492                 <File 
    493                         RelativePath="..\src\Config.h" 
    494                         > 
    495                 </File> 
    496496        </Files> 
    497497        <Globals>