The default bug view has changed. See this FAQ.

OSFileConstants.cpp fails to compile on mingw-w64

RESOLVED FIXED in mozilla15

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: Jacek Caban, Assigned: Jacek Caban)

Tracking

Trunk
mozilla15
x86_64
Windows Vista
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 623619 [details] [diff] [review]
fix v1.0

GCC considers direct 64-bit pointer to 32-bit integer as an error and that's what happens with INVALID_HANDLE_VALUE. INVALID_HANDLE_VALUE is of type HANDLE, which is void*, but guaranteed to be 32-bit value. Thus casting is fine, but needs to be done a bit differently. The attached patch changes the cast to use INT_PTR, which is later implicitly casted to 32-bit int.
Attachment #623619 - Flags: review?(dteller)
Comment on attachment 623619 [details] [diff] [review]
fix v1.0

Fine with me. I assume that you have tested that this does not prevent compilation with VC++?
Attachment #623619 - Flags: review?(dteller) → review+
Comment on attachment 623619 [details] [diff] [review]
fix v1.0

Review of attachment 623619 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/OSFileConstants.cpp
@@ +216,5 @@
>    INT_CONSTANT(FILE_ATTRIBUTE_READONLY),
>    INT_CONSTANT(FILE_ATTRIBUTE_TEMPORARY),
>  
>    // SetFilePointer error constant
> +  { "INVALID_HANDLE_VALUE", INT_TO_JSVAL((INT_PTR)INVALID_HANDLE_VALUE) },

This should be INT_PTR(INVALID_HANDLE_VALUE)
(Assignee)

Comment 3

5 years ago
Thanks for the reviews. Yes, I've tested compilation with VC++. Pushed to m-i addressing Ms2ger's comment:

https://hg.mozilla.org/integration/mozilla-inbound/rev/26fd69b1eec3
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/26fd69b1eec3
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Component: DOM: Other → DOM
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.