MSVC warning when building XPCOMInit.cpp: "media\libvpx\vpx_config_x86-win32-vs8.h: 'HAVE_STDINT_H' : macro redefinition"

RESOLVED FIXED in mozilla38

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks 1 bug)

Trunk
mozilla38
x86_64
Linux
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

The directory "xpcom/build" is nearly warning-free, except from one MSVC-only warning that it gets from (indirectly) #including some VPX headers (I suspect via the #include "vpx_mem/vpx_mem.h" in XPCOMInit.cpp).

The warning (treated as an error in my Try run) is as follows:
{
07:48:02     INFO -  Unified_cpp_xpcom_build0.cpp
07:48:02     INFO -  c:\builds\moz2_slave\try-w32-d-00000000000000000000\build\src\media\libvpx\vpx_config_x86-win32-vs8.h(36) : error C2220: warning treated as error - no 'object' file generated
07:48:02     INFO -  Warning: C4005 in c:\builds\moz2_slave\try-w32-d-00000000000000000000\build\src\media\libvpx\vpx_config_x86-win32-vs8.h: 'HAVE_STDINT_H' : macro redefinition
07:48:02     INFO -  c:\builds\moz2_slave\try-w32-d-00000000000000000000\build\src\media\libvpx\vpx_config_x86-win32-vs8.h(36) : warning C4005: 'HAVE_STDINT_H' : macro redefinition
07:48:02     INFO -          c:\builds\moz2_slave\try-w32-d-00000000000000000000\build\src\obj-firefox\xpcom\build\../../dist/include/mozilla-config.h(32) : see previous definition of 'HAVE_STDINT_H'
07:48:02     INFO -  c:/builds/moz2_slave/try-w32-d-00000000000000000000/build/src/config/rules.mk:930: recipe for target 'Unified_cpp_xpcom_build0.obj' failed
}

Sample build logs:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dholbert@mozilla.com-a4df29249c5a/try-win32/try-win32-bm87-try1-build19427.txt.gz
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dholbert@mozilla.com-a4df29249c5a/try-win32-debug/try-win32-debug-bm87-try1-build18263.txt.gz
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dholbert@mozilla.com-a4df29249c5a/try-win64/try-win64-bm87-try1-build3327.txt.gz
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dholbert@mozilla.com-a4df29249c5a/try-win64-debug/try-win64-debug-bm87-try1-build3046.txt.gz

So this is "mozilla-config.h" clashing with "vpx_config.h" -- they each try to define HAVE_STDINT_H for the things that #include them.  (and vpx_config.h uses platform-specific helper-headers to do that #defining).

I don't think there's really a "clean" solution here -- we should probably just undef 'HAVE_STDINT_H' at the top of vpx_config.h, to avoid this redefinition, IMHO.
(In reply to Daniel Holbert [:dholbert] from comment #0)
> I don't think there's really a "clean" solution here -- we should probably
> just undef 'HAVE_STDINT_H' at the top of vpx_config.h, to avoid this
> redefinition, IMHO.

(Alternately, we might be able to just #undef this in XPCOMInit.cpp, before its vpx include.)
(In reply to Daniel Holbert [:dholbert] from comment #0)
> The directory "xpcom/build" is nearly warning-free, except from one
> MSVC-only warning that it gets from (indirectly) #including some VPX headers
> (I suspect via the #include "vpx_mem/vpx_mem.h" in XPCOMInit.cpp).

So, I think this was caused by bug 682215, which introduced that #include.
Depends on: 682215
Here's a Try run with this warning treated as an error, FWIW:
  https://treeherder.mozilla.org/#/jobs?repo=try&revision=a4df29249c5a

Here's a Try run with the comment 1 solution (undef in XPCOMInit.cpp) -- we'll see if that works:
 https://treeherder.mozilla.org/#/jobs?repo=try&revision=102ca557d979
(In reply to Daniel Holbert [:dholbert] from comment #3)
> Here's a Try run with the comment 1 solution (undef in XPCOMInit.cpp) --
> we'll see if that works:
>  https://treeherder.mozilla.org/#/jobs?repo=try&revision=102ca557d979

Hooray, looks like that worked -- on WinXP, at least! (The win64 builds turned red before they even got to start building, due to bug 1119905, so we don't have any information for win64 yet; but I'm confident that this patch should work just as well on that platform.)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Component: Video/Audio → XPCOM
Summary: media\libvpx\vpx_config_x86-win32-vs8.h: 'HAVE_STDINT_H' : macro redefinition → MSVC warning when building XPCOMInit.cpp: "media\libvpx\vpx_config_x86-win32-vs8.h: 'HAVE_STDINT_H' : macro redefinition"
Posted patch fix v1Splinter Review
Attachment #8556030 - Flags: review?(nfroyd)
Attachment #8556030 - Flags: review?(nfroyd) → review+
https://hg.mozilla.org/mozilla-central/rev/e455a3559707
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.