Closed Bug 1080297 Opened 10 years ago Closed 10 years ago

Visual Studio 2013 build fails (error C2371: 'imaxdiv_t'; error C2375: '_abs64'; error C2375: 'imaxdiv')

Categories

(Firefox Build System :: General, defect)

x86
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla35

People

(Reporter: briansmith, Assigned: away)

References

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

Attached file log
Some checkin between revision 0097b4ffaf33 and revision c4c2742d3d26 today broke my local Visual Studio 2013 debug build. I will attach a log.

 0:46.93 Unified_cpp_signaling_ecc0.cpp
 0:46.93 Warning: C4005 in c:\p\firefox\ff-dbg\dist\include\mozilla-config.h: 'WINVER' : macro redefinition
 0:46.93 c:\p\firefox\ff-dbg\media\webrtc\signalingtest\signaling_ecc\../../../../dist/include/mozilla-config.h(140) : warning C4005: 'WINVER' : macro redefinition
 0:46.93         command-line arguments :  see previous definition of 'WINVER'
 0:46.93 Warning: C4005 in c:\p\firefox\ff-dbg\dist\include\mozilla-config.h: '_WIN32_WINNT' : macro redefinition
 0:46.93 c:\p\firefox\ff-dbg\media\webrtc\signalingtest\signaling_ecc\../../../../dist/include/mozilla-config.h(149) : warning C4005: '_WIN32_WINNT' : macro redefinition
 0:46.93         command-line arguments :  see previous definition of '_WIN32_WINNT'
 0:46.93 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\inttypes.h(34) : error C2371: 'imaxdiv_t' : redefinition; different basic types
 0:46.93         c:\p\firefox\ff-dbg\dist\include\mozilla/MSIntTypes.h(50) : see declaration of 'imaxdiv_t'
 0:46.93 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\inttypes.h(36) : error C2375: '_abs64' : redefinition; different linkage
 0:46.93         C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\stdlib.h(388) : see declaration of '_abs64'
 0:46.93 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\inttypes.h(37) : error C2375: 'imaxdiv' : redefinition; different linkage
 0:46.93         c:\p\firefox\ff-dbg\dist\include\mozilla/MSIntTypes.h(173) : see declaration of 'imaxdiv'
 0:46.94 Warning: C4005 in C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\inttypes.h: 'PRId8' : macro redefinition
revision 7037d68868eb also fails.

I'm guessing this is caused by bug 806819.
Blocks: 806819
I don't have W8.1 w/ VS2013 to test with, you could try reverting https://hg.mozilla.org/mozilla-central/rev/7b16babf6a73 to see if that's what's causing your issue. If that's the case I'd probably just add anything with "win32" in it's path in that patch back into the non-unified sources and call it good.
(In reply to Eric Rahm [:erahm] from comment #2)
> I don't have W8.1 w/ VS2013 to test with, you could try reverting
> https://hg.mozilla.org/mozilla-central/rev/7b16babf6a73 to see if that's
> what's causing your issue.

Reverting this changeset fixes the build for me.
The real issue is that VS2013 provides a usable inttypes.h, but MFBT tries to provide MSIntTypes.h for older Visual Studios that didn't have it. The WebRTC change merely exposed it.
Attached patch inttypes fix (obsolete) — Splinter Review
Comment on attachment 8502233 [details] [diff] [review]
inttypes fix

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

::: mfbt/IntegerPrintfMacros.h
@@ +31,5 @@
>   */
>  
>  #if defined(MOZ_CUSTOM_INTTYPES_H)
>  #  include MOZ_CUSTOM_INTTYPES_H
> +#elif defined(_MSC_VER) && _MSC_VER < 1800

I think it would be better to add that test to MSIntTypes.h instead, and make it include inttypes.h if _MSC_VER >= 1800. And in case that's the not right test (I don't know what the preview releases are numbered), it might be worth skipping the definitions if _INTTYPES is defined.
Attachment #8502233 - Attachment is obsolete: true
Attachment #8502262 - Flags: review?(mh+mozilla)
Oh, forgot to add - I don't think we need to worry about oddball versions, all VC12 is just 1800. (There is _MSC_FULL_VER for the rare cases where build number actually matters)
Attachment #8502262 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/d6d74761dbb2
Assignee: nobody → dmajor
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.