Closed Bug 1186784 Opened 9 years ago Closed 9 years ago

Failed to compile fft_fixed.c: fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration

Categories

(Firefox Build System :: General, defect)

x86_64
Windows 10
defect
Not set
normal

Tracking

(firefox42 fixed)

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: xavier114fch, Assigned: xidorn)

References

Details

Attachments

(1 file)

I have compiled Firefox Trunk using VS 2015 RTM and Windows 10 SDK RTM versions. 
fft_fixed.c failed to compile with the following error:

 8:44.37 fft_fixed.c
 8:44.37 C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
 8:44.37 C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): note: command-line arguments:  see previous definition of 'snprintf'
 8:44.37 C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
 8:44.38
 8:44.41 In the directory  /h/mozilla-inbound/obj/media/libav
 8:44.41 The following command failed to execute properly:
 8:44.41 h:/mozilla-inbound/obj/_virtualenv/Scripts/python.exe -m mozbuild.action.cl cl -Fofft_fixed.obj -c -D_USE_MATH_DEFINES -Dinline=__inline -Dsnprintf=_snprintf -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -Ih:/mozilla-inbound/media/libav -I. -Ih:/mozilla-inbound/media/libav -I../../dist/include -Ih:/mozilla-inbound/obj/dist/include/nspr -Ih:/mozilla-inbound/obj/dist/include/nss -MD -FI ../../dist/include/mozilla-config.h -DMOZILLA_CLIENT -TC -nologo -Wv:18 -wd4091 -D_HAS_EXCEPTIONS=0 -DNOMINMAX -W3 -Gy -FS -wd4244 -wd4267 -wd4819 -we4553 -DNDEBUG -DTRIMMED -Zi -UDEBUG -DNDEBUG -O1 -Oi -Oy -Fdgenerated.pdb h:/mozilla-inbound/media/libav/libavcodec/fft_fixed.c
 8:44.41 h:/mozilla-inbound/config/rules.mk:917: recipe for target 'fft_fixed.obj' failed
 8:44.41 mozmake.EXE[5]: *** [fft_fixed.obj] Error 1
 8:44.41 h:/mozilla-inbound/config/recurse.mk:71: recipe for target 'media/libav/target' failed
 8:44.42 mozmake.EXE[4]: *** [media/libav/target] Error 2
 8:44.42 h:/mozilla-inbound/config/recurse.mk:32: recipe for target 'compile' failed
 8:44.42 mozmake.EXE[3]: *** [compile] Error 2
 8:44.42 h:/mozilla-inbound/config/rules.mk:549: recipe for target 'default' failed
 8:44.42 mozmake.EXE[2]: *** [default] Error 2
 8:44.42 h:/mozilla-inbound/client.mk:401: recipe for target 'realbuild' failed
 8:44.42 mozmake.EXE[1]: *** [realbuild] Error 2
 8:44.42 client.mk:171: recipe for target 'build' failed
 8:44.42 mozmake.EXE: *** [build] Error 2

It built well with previous VS 2015 CTP and RC versions, using an earlier Windows 10 SDK.
Blocks: VC14
I hit exactly the same error with VS2015 Community Edition with SDK 10.0.10150.0.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Bug 1186784 - Disable snprintf definition in libav on VC2015.
Attachment #8638260 - Flags: review?(mh+mozilla)
FYI we have disabled this definition elsewhere in our code for VS2015, like https://dxr.mozilla.org/mozilla-central/source/b2g/app/nsBrowserApp.cpp#31
Assignee: nobody → quanxunzhen
Comment on attachment 8638260 [details]
MozReview Request: Bug 1186784 - Disable snprintf definition in libav on VC2015.

https://reviewboard.mozilla.org/r/14083/#review12617

Ship It!

::: media/libav/libavcommon.mozbuild:16
(Diff revision 1)
> -    # snprintf is prefixed with an underscore on windows.
> +        # snprintf is prefixed with an underscore on windows.

Can you update this comment to say msvc 2013 instead of windows?
Attachment #8638260 - Flags: review?(mh+mozilla) → review+
Component: Build Config → General
Product: Firefox → Firefox Build System
Target Milestone: Firefox 42 → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: