Closed Bug 346679 Opened 18 years ago Closed 18 years ago

NormalizationTest.cpp doesn't need MOZILLA_INTERNAL_API

Categories

(Core :: Internationalization, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: benjamin, Assigned: benjamin)

References

Details

Attachments

(2 files)

The only reason I can see it currently uses MOZILLA_INTERNAL_API is because IS_SURROGATE and friends are declared in nsCharTraits.h instead of somewhere more generic. I've moved them to nscore.h
Ignore the #if 0 change in nscore.h, that's from the firefox --enable-libxul testing.
Attachment #231412 - Flags: superreview?(darin)
Attachment #231412 - Flags: review?(smontagu)
Attachment #231412 - Flags: review?(smontagu) → review+
since these are sort of string-specific, wouldn't something like nsReadableUtils.h be a better place?
nsReadableUtils.h is internal-linkage only... we don't really have a good header for string util macros that are available in both the external and internal linkage, except for nsStringGlue.h, and I didn't want to do a tree-wide search for consumers of these macros.
Comment on attachment 231412 [details] [diff] [review]
Fix NormalizationTest.cpp

I really don't think we want nscore.h to define all of those macros that do not start with the NS_ namespace.  That doesn't play nicely at all with folks who are using our SDK.
Attachment #231412 - Flags: superreview?(darin) → superreview-
Comment on attachment 231412 [details] [diff] [review]
Fix NormalizationTest.cpp

By the way, it would make my life easier if you could do

#ifdef DEBUG_smontagu
#define MOZILLA_INTERNAL_API
#endif
...
#ifdef DEBUG_smontagu
#include "nsString.h"
#else
#include "nsStringAPI.h"
#endif

Why does CharAt() require MOZILLA_INTERNAL_API anyway?
smontagu, that's a bad idea; internal linkage for code that doesn't actually live in libxul is going away quickly. I discovered this problem because xulrunner build with tests enabled wouldn't link.

What CharAt() signature do you need? The frozen API has

http://lxr.mozilla.org/mozilla/source/xpcom/glue/nsStringAPI.h#71 and an nsACString equivalent.
> I really don't think we want nscore.h to define all of those macros that do not
> start with the NS_ namespace.

What do you suggest? 

1) put the existing macros in nsStringGlue.h?
2) Rename the macros with NS_ prefixes (and put them in nscore.h)?
3) Create a new header for them?
(In reply to comment #6)
> What CharAt() signature do you need? The frozen API has
> 
> http://lxr.mozilla.org/mozilla/source/xpcom/glue/nsStringAPI.h#71 and an
> nsACString equivalent.

Yeah, well, you only checked that in yesterday, didn't you?

Is there any reason why we shouldn't just #include nsCharTraits.h explicitly?
> Yeah, well, you only checked that in yesterday, didn't you?

I guess I did ;-)

> Is there any reason why we shouldn't just #include nsCharTraits.h explicitly?

Good question... it looks like it's linkage-safe... let me try it.
> 2) Rename the macros with NS_ prefixes (and put them in nscore.h)?

That seems like the best choice to me.
Attachment #231650 - Flags: review?(smontagu)
Attachment #231650 - Flags: review?(smontagu) → review+
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: