Closed Bug 1201629 Opened 9 years ago Closed 9 years ago

VS2015 build fails in suite/shell/src/nsWindowsShellService.cpp: error C2679: binary '=': no operator found

Categories

(SeaMonkey :: General, defect)

Unspecified
Windows
defect
Not set
normal

Tracking

(seamonkey2.40 fixed)

RESOLVED FIXED
seamonkey2.40
Tracking Status
seamonkey2.40 --- fixed

People

(Reporter: frg, Assigned: frg)

References

Details

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38
Build ID: 20150829170953

Steps to reproduce:

Try to build Seamonkey suite with VS2015


Actual results:

Compiler error in:

nsWindowsShellService.cpp
c:/seamonkey/comm-central/suite/shell/src/nsWindowsShellService.cpp(476): error C2679: binary '=': no operator found which takes a right-hand operand of type 'wchar_t [4096]' (or there is no acceptable conversion)
c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringAPI.h(983): note: could be 'nsString_external::self_type &nsString_external::operator =(nsAString::char_type)'
c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringAPI.h(978): note: or       'nsString_external::self_type &nsString_external::operator =(const nsAString::char_type *)'
c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringAPI.h(973): note: or       'nsString_external::self_type &nsString_external::operator =(const nsString_external::abstract_string_type &)'
c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringAPI.h(968): note: or       'nsString_external::self_type &nsString_external::operator =(const nsString_external::self_type &)'
c:/seamonkey/comm-central/suite/shell/src/nsWindowsShellService.cpp(476): note: while trying to match the argument list '(nsString_external, wchar_t [4096])'
c:/seamonkey/comm-central/suite/shell/src/nsWindowsShellService.cpp(483): error C2679: binary '=': no operator found which takes a right-hand operand of type 'wchar_t [4096]' (or there is no acceptable conversion)
c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringAPI.h(983): note: could be 'nsString_external::self_type &nsString_external::operator =(nsAString::char_type)'
c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringAPI.h(978): note: or       'nsString_external::self_type &nsString_external::operator =(const nsAString::char_type *)'
c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringAPI.h(973): note: or       'nsString_external::self_type &nsString_external::operator =(const nsString_external::abstract_string_type &)'
c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringAPI.h(968): note: or       'nsString_external::self_type &nsString_external::operator =(const nsString_external::self_type &)'
c:/seamonkey/comm-central/suite/shell/src/nsWindowsShellService.cpp(483): note: while trying to match the argument list '(nsString_external, wchar_t [4096])'
c:/seamonkey/comm-central/mozilla/config/rules.mk:958: recipe for target 'nsWindowsShellService.obj' failed



Expected results:

Compile should have succeeded
Attached patch Patch for wchar_t casting (obsolete) — Splinter Review
Patch attached to bug https://bugzilla.mozilla.org/show_bug.cgi?id=1198936 needs to be applied first or you won't even get this far.
OS: Unspecified → Windows
Comment on attachment 8656714 [details] [diff] [review]
Patch for wchar_t casting

wwc(appPath) should work, shouldn't it?
No I tried first. 

With only wwc I get:

mozmake[5]: Entering directory 'c:/seamonkey/comm-central/mozilla/security/nss/lib/certdb'
nsWindowsShellService.cpp
c:/seamonkey/comm-central/suite/shell/src/nsWindowsShellService.cpp(477): error C3861: 'wwc': identifier not found
c:/seamonkey/comm-central/suite/shell/src/nsWindowsShellService.cpp(485): error C3861: 'wwc': identifier not found
c:/seamonkey/comm-central/mozilla/config/rules.mk:958: recipe for target 'nsWindowsShellService.obj' failed

If I also include nsString.h I get:

c:\seabuild\release\comm-central-15\obj-x86_64-pc-mingw32\dist\include\nsStringFwd.h(15): fatal error C1189: #error:  Internal string headers are not available from external-linkage code.
c:/seamonkey/comm-central/mozilla/config/rules.mk:958: recipe for target 'nsWindowsShellService.obj' failed
>  nsString mAppLongPath;
>  nsString mAppShortPath;
Would it help to get rid of nsString?
Sigh, wwc is only available with internal strings, but I've looked at nsStringAPI.h and I think we can use Assign() instead of operator=().
My C++ is more or less nonexistent. I am only doing some Java for a living.

Firefox uses an nsAutostring. This class initialisation works in 
mozilla\browser\components\shell\nsWindowsShellService.cpp:

  nsAutoString appLongPath(exePath);
Attached patch 1201629-vs2015-suite-v2.patch (obsolete) — Splinter Review
Patch for wchar_t V2
Attachment #8656714 - Attachment is obsolete: true
Assign seems to work fine.
patch for wchar_t conversion
Attachment #8658332 - Attachment is obsolete: true
Depends on: 1198936
Assignee: nobody → frgrahl
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8658361 - Flags: review?(neil)
Attachment #8658361 - Flags: review?(neil) → review+
Pushed to comm-central:
https://hg.mozilla.org/comm-central/rev/998a6fac4571

Thanks for the patch!
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: