Closed Bug 754795 Opened 9 years ago Closed 9 years ago

OSFileConstants.cpp fails to compile on mingw-w64

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: jacek, Assigned: jacek)

References

Details

Attachments

(1 file)

Attached patch fix v1.0Splinter Review
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)
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
Closed: 9 years ago
Resolution: --- → FIXED
Component: DOM: Other → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.