[tao-users] [ace-users] Compilation error using ACE_USES_WCHAR

Johnny Willemsen jwillemsen at remedy.nl
Wed Jun 10 05:09:43 CDT 2015


Hi,

I have added a wchar configuration to travis-ci, when you merge upstream
again in your master you should get this configuration added in your own
travis-ci build.

Best regards,

Johnny

On 06/09/2015 11:01 PM, Cesar Mello wrote:
> Hi Johnny,
> 
> I removed the avoids of uses_wchar as you suggested:
> 
> https://github.com/cmello/ATCD/commit/a5d23a20a1947489069c2f5c0bf979f3599cec6c
> 
> But I don't know yet how to enable a build with ACE_USES_WCHAR in the
> travis.yml. (Sorry my Linux scripting background is too small). I want
> to learn, but maybe it would be more productive and safe if someone with
> more experience could setup a USES_WCHAR entry in travis.
> 
> Thank you a lot for the attention!
> 
> Best regards
> Mello
> 
> 
> 
> 
> 
> 
> On Thu, May 21, 2015 at 2:10 PM, Johnny Willemsen <jwillemsen at remedy.nl
> <mailto:jwillemsen at remedy.nl>> wrote:
> 
>     Hi,
> 
>     > Thank you very much! The usage of macros ACE_TEXT_ALWAYS_CHAR, ACE_TEXT and ACE_TEXT_CHAR_TO_TCHAR solves the issues with IFRService.
> 
>     The IFRService wasn't updated for wchar support so your changes are
>     welcome. At the moment you have updated all code, also remove the avoids
>     of uses_wchar in TAO/MPC/config/ifrservice.mpb, at that moment also
>     wchar builds will try to compile the IFRService
>     >
>     > To share this through a pull request I still have to figure out how to setup a build from the git repository though.
> 
>     Easiest is to use travis-ci for your fork, at the moment you enable
>     github/travis-ci integration you can very easily build your fork using
>     travis-ci.
> 
>     Johnny
> 
>     >
>     > Thank you very much.
>     >
>     > Best regards!
>     > Mello
>     >
>     >
>     > -----Original Message-----
>     > From: tao-users [mailto:tao-users-bounces at list.isis.vanderbilt.edu
>     <mailto:tao-users-bounces at list.isis.vanderbilt.edu>] On Behalf Of
>     Phil Mesnier
>     > Sent: quarta-feira, 20 de maio de 2015 18:31
>     > To: Cesar Mello
>     > Cc: tao-users at list.isis.vanderbilt.edu
>     <mailto:tao-users at list.isis.vanderbilt.edu>
>     > Subject: Re: [tao-users] [ace-users] Compilation error using
>     ACE_USES_WCHAR
>     >
>     > Hi Cesar,
>     >
>     > I'm shifting this to the TAO users list… (using my registered
>     account this time)
>     >
>     >> On May 20, 2015, at 4:02 PM, Cesar Mello <cmello at gmail.com
>     <mailto:cmello at gmail.com>> wrote:
>     >>
>     >> Hi,
>     >>
>     >> I can build most of ACE and TAO using ACE_USES_WCHAR under
>     Windows (Visual Studio 2015 RC). Everything I currently need works,
>     congratulations for the great work!
>     >>
>     >
>     > On behalf of the ATCD development community, thanks!
>     >
>     >
>     >> But in IFRService/AliasDef_i.cpp the local variable ACE_TString
>     "id" is wide (that's ok when reading from the
>     ACE_Configuration::get_string_value because it also returns a wide
>     string):
>     >>
>     >> ----
>     >> CORBA::TypeCode_ptr
>     >> TAO_AliasDef_i::type_i (void)
>     >> {
>     >>  ACE_TString id;
>     >>  this->repo_->config ()->get_string_value (this->section_key_,
>     >>                                            ACE_TEXT("id"),
>     >>                                            id);
>     >> ----
>     >>
>     >> But later this wide string is passed to
>     CORBA::TypeFactory::create_alias_tc which expects an ANSI string
>     (const char*):
>     >>
>     >> ---
>     >>
>     >>  return this->repo_->tc_factory ()->create_alias_tc (id.c_str (),
>     >>                                                      name.c_str (),
>     >>                                                      tc.in
>     <http://tc.in> ());
>     >>
>     >> ---
>     >>
>     >> Should this string be converted from wide to ANSI before calling
>     create_alias_tc?
>     >>
>     >
>     > Thank you again for reporting this defect. There is a macro we
>     use, ACE_TEXT_ALWAYS_CHAR(). In context the fix is:
>     >  return this->repo_->tc_factory ()->create_alias_tc (id.c_str (),
>     >                                                      name.c_str (),
>     >                                                     
>     ACE_TEXT_ALWAYS_CHAR (tc.in <http://tc.in> ()));
>     >
>     >> Maybe if you give me a hint I can fix it myself.
>     >>
>     >
>     > There are several ACE_TEXT* macros used to handle char/wchar_t
>     conversions. Note that these are not proper translators so use of
>     character sets that extend beyond 0xFF (0x7F?) will yield
>     interesting results. :-)
>     >
>     >
>     >> Thank you a lot for the attention.
>     >>
>     >> Best regards!
>     >> Mello
>     >>
>     >
>     > -Phil
>     >
>     > --
>     > Phil Mesnier
>     > Principal Software Engineer and Partner,   http://www.ociweb.com
>     > Object Computing, Inc.                     +01.314.579.0066 x225
>     >
>     >
>     >



More information about the tao-users mailing list