[pyicu-dev] [PATCH] Add correct namespace declarations everywhere

Steven R. Loomis srl at icu-project.org
Tue Sep 11 12:00:09 PDT 2007


the namespace could b e icu or icu_3_8 depending on what the rename  
settings are, so I would not use icu:: statically

from uversion.h:
> #   ifndef U_USING_ICU_NAMESPACE
> #       define U_USING_ICU_NAMESPACE 1
> #   endif
> #   if U_USING_ICU_NAMESPACE
>         U_NAMESPACE_USE
> #   endif

so, pyicu could, I suppose, have:

#if !U_USING_ICU_NAMESPACE
    U_NAMESPACE_USE
#endif

whose sole purpose is to "ignore the -DU_USING_ICU_NAMESPACE=0"

the above also has no effect outside if namespace is used.

I would do the above instead of static icu::

-s


On 11 Set 2007, at 11:51, Fredrik Roubert wrote:
> On 9/11/07, Steven R. Loomis <srl at icu-project.org> wrote:
>> Why are you compiling with -DU_USING_ICU_NAMESPACE=0?
> It's not my decision, it's the way it is in the codebase I'm  
> working in.
>
>> You can build ICU with that same option and then it will be  
>> consistent.
> I don't follow you. Setting U_USING_ICU_NAMESPACE=0 while building ICU
> won't change the ICU header files in any way, will it?
>
>> in any event your patch should probably use the U_NAMESPACE_QUALIFIER
>> instead of the static string icu::
> That might certainly be a good idea, but I choose to just use icu:: as
> that was the way it was already done in PyICU (there are 762
> occurrences of icu:: in SVN revision 78).
>
>> So, i think the patch should not be needed.
> But how do you then propose that I build PyICU with  
> U_USING_ICU_NAMESPACE=0?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/pyicu-dev/attachments/20070911/205785ff/attachment.htm


More information about the pyicu-dev mailing list