Closed Bug 951984 Opened 11 years ago Closed 11 years ago

mozilla/Char16.h(36): error C2371: 'char16_t' :

Categories

(Core :: MFBT, defect)

27 Branch
x86_64
Windows 7
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mohd.rozi.zafar, Unassigned)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 Steps to reproduce: Download latest xulrunner (27 beta 2) : http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/27.0b2/sdk/xulrunner-27.0b2.en-US.win32.sdk.zip Actual results: Build started 12/19/2013 1:05:57 PM. InitializeBuildStatus: Touching "C:\project\src\Release\Output\WebPlugin.unsuccessfulbuild". ClCompile: stdafx.cpp c:\project\gecko-sdk-win32-27.0\include\mozilla/Char16.h(36): error C2371: 'char16_t' : redefinition; different basic types C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\yvals.h(576) : see declaration of 'char16_t' c:\project\gecko-sdk-win32-27.0\include\nsError.h(137): warning C4480: nonstandard extension used: specifying underlying type for enum 'tag_nsresult' c:\project\gecko-sdk-win32-27.0\include\nsError.h(235): warning C4800: 'uint32_t' : forcing value to bool 'true' or 'false' (performance warning) c:\project\gecko-sdk-win32-27.0\include\nsStringAPI.h(1079): error C3861: 'char16_t': identifier not found stdafx.cpp(233): warning C4130: '!=' : logical operation on address of string constant stdafx.cpp(283): warning C4130: '!=' : logical operation on address of string constant stdafx.cpp(285): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data stdafx.cpp(306): warning C4130: '!=' : logical operation on address of string constant Build FAILED. Expected results: Build should compile successful. Previous release was compiled OK (Xulrunner 26).
Severity: normal → major
OS: All → Windows 7
Hardware: All → x86_64
(In reply to Mohd Rozi from comment #0) > User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, > like Gecko) Chrome/31.0.1650.63 Safari/537.36 > > Steps to reproduce: > > Download latest xulrunner (27 beta 2) : > http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/27.0b2/sdk/ > xulrunner-27.0b2.en-US.win32.sdk.zip > > > Actual results: > > Build started 12/19/2013 1:05:57 PM. > InitializeBuildStatus: > Touching "C:\project\src\Release\Output\WebPlugin.unsuccessfulbuild". > ClCompile: > stdafx.cpp > c:\project\gecko-sdk-win32-27.0\include\mozilla/Char16.h(36): error C2371: > 'char16_t' : redefinition; different basic types > C:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\include\yvals.h(576) : see declaration of 'char16_t' > c:\project\gecko-sdk-win32-27.0\include\nsError.h(137): warning C4480: > nonstandard extension used: specifying underlying type for enum > 'tag_nsresult' > c:\project\gecko-sdk-win32-27.0\include\nsError.h(235): warning C4800: > 'uint32_t' : forcing value to bool 'true' or 'false' (performance warning) > c:\project\gecko-sdk-win32-27.0\include\nsStringAPI.h(1079): error C3861: > 'char16_t': identifier not found > stdafx.cpp(233): warning C4130: '!=' : logical operation on address of > string constant > stdafx.cpp(283): warning C4130: '!=' : logical operation on address of > string constant > stdafx.cpp(285): warning C4244: '=' : conversion from 'double' to 'float', > possible loss of data > stdafx.cpp(306): warning C4130: '!=' : logical operation on address of > string constant > > Build FAILED. > > > Expected results: > > Build should compile successful. Previous release was compiled OK (Xulrunner > 26). Is this compiling your plugin or application using xulrunner?
My plugin.
Attached patch workaround.diffSplinter Review
I created a simple workaround patch (workaround.diff), at least my progam can compile successfully using Visual Studio 2010. I just revert some code section to previous version (xulrunner 26). But we still need a proper fix for this issue.
Component: XULRunner → MFBT
Product: Toolkit → Core
Can you please test this with the mozilla-central code? I remember fixing something like this a while ago, perhaps that patch was not backported to the Firefox 27 branch?
Hi Akhgari, sorry for the late reply. I tested using http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-mozilla-central/xulrunner-29.0a1.en-US.win32.sdk.zip, still failing : error C2371: 'char16_t' : redefinition; different basic types
Oh, I bet I know where the problem comes from. In Mozilla code, we force-include mozilla/Char16.h before all other headers in every .cpp file that we compile, which ensures that the char16_t type is available everywhere. Can you please modify your plugin code to ensure that mozilla/Char16.h is included as the first header in every .cpp file? (Note that including it after things like windows.h will cause compilation errors similar to what you are seeing here.)
Shouldn't he already be picking this up through mozilla-config.h, which should be part of the CXXFLAGS equivalent on Windows? Or is there no such equivalent on Windows?
(In reply to comment #8) > Shouldn't he already be picking this up through mozilla-config.h, which should > be part of the CXXFLAGS equivalent on Windows? Or is there no such equivalent > on Windows? I think that depends on the build system. If the plugin is built using our build system then things should work out of the box.
@Ehsan Akhgari, Perfect! I put #include <mozilla/Char16.h> in my stdafx.h and everything is OK :)
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
See Also: → 979847
SDK : xulrunner-28.0.1.en-US.win32.sdk, xulrunner-29.0.1.en-US.win32.sdk VS : VS2005 SP1 OS : windows 7 64bit ServicePack 1 I put #include <mozilla/Char16.h> in my stdafx.h and everything is OK but, error C3861: 'CreateEvent'; undefined (atlbase.h) Help me......
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: