Closed Bug 566869 Opened 15 years ago Closed 15 years ago

prefapi.h does not like Chromium's prtypes.h

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: fred23, Assigned: fred23)

Details

Attachments

(1 file, 1 obsolete file)

when MOZ_IPC, chromium's basictypes.h explicitly disables NSPR_10 support before including prtypes.h. Here are first lines of basictypes.h : ****************** // Chromium includes a prtypes.h also, but it has been modified to include // their build_config.h as well. We can therefore test for both to determine // if someone screws up the include order. #if defined(prtypes_h___) && !defined(BUILD_BUILD_CONFIG_H_) #error You_must_include_basictypes.h_before_prtypes.h! #endif #ifndef NO_NSPR_10_SUPPORT #define NO_NSPR_10_SUPPORT #define NO_NSPR_10_SUPPORT_SAVE #endif #include "prtypes.h" #ifdef NO_NSPR_10_SUPPORT_SAVE #undef NO_NSPR_10_SUPPORT_SAVE #undef NO_NSPR_10_SUPPORT #endif ****************** ... This keeps "NSPR_BEGIN_EXTERN_C" from being properly defined and make prefapi.h build fail.
I defer to bent's judgment here re: NSPR_10. One solution is to just s/extern "C" {/namespace mozilla { namespace Pref {/ and get rid of the ugly PREF_ prefix on its functions. libpref isn't an external API afaict and it's only used from C++ code in gecko.
Or just replace the (2!) uses of NSPR_BEGIN_EXTERN_C with PR_BEGIN_EXTERN_C. I guess I can't approve that (bsmedberg maybe?) but I'd certainly vote for it!
Attached patch patch (obsolete) — Splinter Review
Here's the quick fix Ben suggested. This makes all my troubles go away ;-) I'm not sure who's entitled to r+ that... setting Bent as reviewer for now.
Assignee: nobody → bugzillaFred
Attachment #446498 - Flags: review?(bent.mozilla)
Attachment #446498 - Flags: review?(bent.mozilla) → review?(benjamin)
Attachment #446498 - Flags: review?(benjamin) → review+
I think we should push that directly to m-c, instead of getting it merged later on from e10s. Could someone push that for me ? thanks :-)
Attachment #446498 - Attachment is obsolete: true
Attachment #446900 - Flags: review+
Keywords: checkin-needed
(In reply to comment #4) > Created an attachment (id=446900) [details] > patch_to_push (with commit info) There's no commit info.
http://hg.mozilla.org/projects/electrolysis/rev/216fccb29929 Pushed to e10s; we'll let it sync up to m-c in good time.
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: