peiyongz    2004/11/07 19:10:40

  Modified:    c/src/xercesc/util/MsgLoaders/ICU ICUMsgLoader.cpp
  Log:
  Using different package name for windows/Unix
  
  Revision  Changes    Path
  1.25      +25 -5     
xml-xerces/c/src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp
  
  Index: ICUMsgLoader.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/c/src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ICUMsgLoader.cpp  4 Nov 2004 18:38:44 -0000       1.24
  +++ ICUMsgLoader.cpp  8 Nov 2004 03:10:40 -0000       1.25
  @@ -16,9 +16,12 @@
   
   /*
    * $Log$
  + * Revision 1.25  2004/11/08 03:10:40  peiyongz
  + * Using different package name for windows/Unix
  + *
    * Revision 1.24  2004/11/04 18:38:44  peiyongz
    * udata_setAppData and ures_open refer to the same pkgname
  - *
  + * 
    * Revision 1.23  2004/09/30 18:52:59  peiyongz
    * XercesC2_6_0 updates
    *
  @@ -151,7 +154,11 @@
    *  will then  be able to fetch resources from the data.
    */
   
  +#if defined(_WIN32) || defined(WIN32)
  +extern "C" void U_IMPORT *XercesMessages2_6_dat;
  +#else
   extern "C" void U_IMPORT *XercesMessages2_6_0_dat;
  +#endif
   
   /* 
    *  Tell ICU where our resource data is located in memory. The data lives in 
the XercesMessages dll, and we just
  @@ -171,8 +178,11 @@
       {
           setAppDataDone = true;
           UErrorCode err = U_ZERO_ERROR;
  +#if defined(_WIN32) || defined(WIN32)
  +        udata_setAppData("XercesMessages2_6", &XercesMessages2_6_dat, &err);
  +#else
           udata_setAppData("XercesMessages2_6_0", &XercesMessages2_6_0_dat, 
&err);
  -
  +#endif        
           if (U_SUCCESS(err))
           {
            setAppDataOK = true;
  @@ -259,25 +269,35 @@
       /***
        Open the locale-specific resource bundle
       ***/
  +#if defined(_WIN32) || defined(WIN32)
  +    strcat(locationBuf, "XercesMessages2_6");
  +#else
       strcat(locationBuf, "XercesMessages2_6_0");
  -
  +#endif
       UErrorCode err = U_ZERO_ERROR;
       uloc_setDefault("en_US", &err);   // in case user-specified locale 
unavailable
       err = U_ZERO_ERROR;
       fLocaleBundle = ures_open(locationBuf, XMLMsgLoader::getLocale(), &err);
  -
       if (!U_SUCCESS(err) || fLocaleBundle == NULL)
       {
        /***
           in case user specified location does not work
           try the dll
           ***/
  +
  +#if defined(_WIN32) || defined(WIN32)
  +        if (strcmp(locationBuf, "XercesMessages2_6") !=0 )
  +#else
           if (strcmp(locationBuf, "XercesMessages2_6_0") !=0 )
  +#endif        
           {                       
               setAppData();            
               err = U_ZERO_ERROR;
  -            fLocaleBundle = ures_open("XercesMessages2_6_0", 
XMLMsgLoader::getLocale(), &err);        
  -
  +#if defined(_WIN32) || defined(WIN32)            
  +            fLocaleBundle = ures_open("XercesMessages2_6", 
XMLMsgLoader::getLocale(), &err);
  +#else
  +            fLocaleBundle = ures_open("XercesMessages2_6_0", 
XMLMsgLoader::getLocale(), &err);
  +#endif            
               if (!U_SUCCESS(err) || fLocaleBundle == NULL)
               {
                    
XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to