[Ace-users] Re: [ace-bugs] ACE_Log_Record::print
Johnny Willemsen
jwillemsen at remedy.nl
Wed Jun 27 03:02:15 CDT 2007
Hi,
The fix is in the repository, thanks for your fix.
Johnny
> Thanks, I will commit it when x.5.9 has been released.
>
> Regards,
>
> Johnny Willemsen
> Remedy IT
> Postbus 101
> 2650 AC Berkel en Rodenrijs
> The Netherlands
> www.theaceorb.nl / www.remedy.nl
>
> *** Integrated compile and test statistics see
> http://scoreboard.theaceorb.nl ***
> *** Commercial service and support for ACE/TAO/CIAO ***
> *** See http://www.theaceorb.nl/en/support.html ***
>
> > -----Original Message-----
> > From: Hofmann, Christoph [mailto:Christoph.Hofmann at zwick.de]
> > Sent: Tuesday, June 26, 2007 6:29 AM
> > To: Johnny Willemsen; ace-bugs at cs.wustl.edu
> > Subject: AW: [ace-bugs] ACE_Log_Record::print
> >
> > Hi Johnny,
> >
> > your patch works also.
> >
> >
> > Best regards
> >
> > Christoph Hofmann
> > Development Software / Projects Division
> >
> > Zwick GmbH & Co. KG
> > August-Nagel-Str. 11
> > 89079 Ulm
> > Tel: ++49 (0) 7305 - 10-277
> > Fax: ++49 (0) 7305 - 10-409
> > email: Christoph.Hofmann at Zwick.de
> > www.zwick.de / www.zwick.com
> >
> > A company of the Zwick Roell AG
> >
> > Zwick GmbH & Co. KG
> > Geschäftsführer: Dr. Jan Stefan Roell, Michaela Ganser
> > Pers. haftende Gesellschafterin: Zwick
> > Verwaltungsgesellschaft mbH, Ulm
> > Registergericht: Ulm, HRB 4361 und Ulm, HRA 1980
> > USt-IdNr.: DE 147 043 343
> >
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Johnny Willemsen [mailto:jwillemsen at remedy.nl]
> > Gesendet: Montag, 25. Juni 2007 13:24
> > An: Hofmann, Christoph; ace-bugs at cs.wustl.edu
> > Betreff: RE: [ace-bugs] ACE_Log_Record::print
> >
> > Hi,
> >
> > Thanks for usign the PRF form, can you test this patch below,
> > this is the same code as in Log_Msg.cpp
> >
> > Regards,
> >
> > Johnny Willemsen
> > Remedy IT
> > Postbus 101
> > 2650 AC Berkel en Rodenrijs
> > The Netherlands
> > www.theaceorb.nl / www.remedy.nl
> >
> > *** Integrated compile and test statistics see
> > http://scoreboard.theaceorb.nl ***
> > *** Commercial service and support for ACE/TAO/CIAO ***
> > *** See http://www.theaceorb.nl/en/support.html ***
> >
> > #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
> > int fwrite_result = ACE_OS::fprintf (fp,
> >
> > ACE_LIB_TEXT ("%ls"),
> >
> verbose_msg); #else
> > int fwrite_result = ACE_OS::fprintf (fp,
> >
> > ACE_LIB_TEXT ("%s"),
> >
> > verbose_msg); #endif
> >
> > > -----Original Message-----
> > > From: ace-bugs-bounces at cse.wustl.edu
> > > [mailto:ace-bugs-bounces at cse.wustl.edu] On Behalf Of Hofmann,
> > > Christoph
> > > Sent: Monday, June 25, 2007 1:19 PM
> > > To: ace-bugs at cs.wustl.edu
> > > Subject: [ace-bugs] ACE_Log_Record::print
> > >
> > > ACE VERSION: 5.5.8
> > >
> > > HOST MACHINE and OPERATING SYSTEM:
> > > P4 with Suse Linux 10.2
> > >
> > > TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> > > COMPILER NAME AND VERSION (AND PATCHLEVEL): gcc 4.02
> > >
> > > THE $ACE_ROOT/ace/config.h FILE :
> > > #define ACE_HAS_LINUX_NPTL
> > > #define ACE_USES_MUTEX_FOR_PROCESS_MUTEX #define
> > > ACE_HAS_NONSTATIC_OBJECT_MANAGER #define
> > > ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER
> > > #define ACE_USES_WCHAR
> > > #include "ace/config-linux.h"
> > >
> > > THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE :
> > > LN_S = zwick-ln
> > > optimize=0
> > > debug=1
> > >
> > > ZWICK_BUILDSUBDIR=linux/debug
> > >
> > > VDIR=$(ZWICK_BUILDSUBDIR)/obj/
> > > VSHDIR=$(ZWICK_BUILDSUBDIR)/shobj/
> > >
> > > INSLIB=$(ZWICK_BIN)/$(ZWICK_BUILDSUBDIR)
> > > INSBIN=$(ZWICK_BIN)/$(ZWICK_BUILDSUBDIR)
> > >
> > > include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
> > >
> > > SHLIB=$(ZWICK_BUILDSUBDIR)/$(SHLIB_UNCHECKED)
> > >
> > > BIN_TMP=$(ZWICK_BUILDSUBDIR)/$(BIN_UNCHECKED)
> > > BIN_UNCHECKED:=$(BIN_TMP)
> > >
> > > CPPFLAGS += -Werror -Wno-unused-parameter -Wextra #CPPFLAGS +=
> > > -ftest-coverage -fprofile-arcs LDFLAGS += -Wl,-rpath
> > > -Wl,$(ZWICK_BIN)/$(ZWICK_BUILDSUBDIR)
> > >
> > > TAO_IDL := $(HOST_ROOT)/bin/tao_idl
> > > TAO_IDLFLAGS += -g $(HOST_ROOT)/bin/gperf TAO_IDL_DEP :=
> > > $(HOST_ROOT)/bin/tao_idl$(EXEEXT)
> > >
> > >
> > >
> > > CONTENTS OF
> > > $ACE_ROOT/bin/MakeProjectCreator/config/default.features
> > > ???
> > >
> > > AREA/CLASS/EXAMPLE AFFECTED:
> > > Log_Record.cpp
> > >
> > > DOES THE PROBLEM AFFECT:
> > > COMPILATION?
> > > No
> > > LINKING?
> > > No
> > > EXECUTION?
> > > YES
> > > OTHER (please specify)?
> > > both
> > >
> > > SYNOPSIS:
> > > If ACE_USES_WCHAR is set, ACE_DEBUG does not work on Linux.
> > >
> > > DESCRIPTION:
> > > I know that ACE_USES_WCHAR is not tested on linux. But I
> > found a bug
> > > and a potential solution.
> > > If ACE_USES_WCHAR is set, ACE_DEBUG does not work on Linux.
> > >
> > > REPEAT BY:
> > >
> > > SAMPLE FIX/WORKAROUND:
> > > see my workaround also in attached file.
> > >
> > >
> > >
> > >
> > >
> > > int
> > > ACE_Log_Record::print (const ACE_TCHAR host_name[],
> > > u_long verbose_flag,
> > > FILE *fp)
> > > {
> > > if (ACE_LOG_MSG->log_priority_enabled (ACE_Log_Priority
> > > (this->type_)))
> > > {
> > > ACE_TCHAR *verbose_msg = 0;
> > > ACE_NEW_RETURN (verbose_msg,
> > > ACE_TCHAR[MAXVERBOSELOGMSGLEN], -1);
> > >
> > > int result = this->format_msg (host_name,
> > > verbose_flag,
> > > verbose_msg);
> > >
> > > if (result == 0)
> > > {
> > > if (fp != 0)
> > > {
> > > int verbose_msg_len =
> > > static_cast<int> (ACE_OS::strlen (verbose_msg));
> > > //************************************************************
> > > **********
> > > **
> > > // Hofmann-Patch: if Linux and WCHAR, "%ls" is needed
> > > //************************************************************
> > > **********
> > > **
> > > #if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
> > > int fwrite_result = ACE_OS::fprintf (fp,
> > >
> > > ACE_LIB_TEXT ("%s"),
> > >
> > verbose_msg); #else
> > > int fwrite_result = ACE_OS::fprintf (fp,
> > >
> > > ACE_LIB_TEXT ("%ls"),
> > > verbose_msg);
> > > #endif
> > > //************************************************************
> > > **********
> > > **
> > > // Hofmann-Patch finished
> > > //************************************************************
> > > **********
> > > **
> > > // We should have written everything
> > > if (fwrite_result != verbose_msg_len)
> > > result = -1;
> > > else
> > > ACE_OS::fflush (fp);
> > > }
> > > }
> > >
> > > delete [] verbose_msg;
> > >
> > > return result;
> > > }
> > > else
> > > return 0;
> > > }
> > >
> >
> >
>
> _______________________________________________
> ace-bugs mailing list
> ace-bugs at mail.cse.wustl.edu
> http://mail.cse.wustl.edu/mailman/listinfo/ace-bugs
>
More information about the Ace-users
mailing list