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

RESOLVED FIXED in seamonkey2.40

Status

SeaMonkey
General
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: frg, Assigned: frg)

Tracking

Trunk
seamonkey2.40
Unspecified
Windows

SeaMonkey Tracking Flags

(seamonkey2.40 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

3 years ago
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
(Assignee)

Comment 1

3 years ago
Created attachment 8656714 [details] [diff] [review]
Patch for wchar_t casting
(Assignee)

Comment 2

3 years ago
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.
(Assignee)

Updated

3 years ago
OS: Unspecified → Windows

Comment 3

3 years ago
Comment on attachment 8656714 [details] [diff] [review]
Patch for wchar_t casting

wwc(appPath) should work, shouldn't it?
(Assignee)

Comment 4

3 years ago
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

Comment 6

3 years ago
>  nsString mAppLongPath;
>  nsString mAppShortPath;
Would it help to get rid of nsString?

Comment 7

3 years ago
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=().
(Assignee)

Comment 8

3 years ago
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);
(Assignee)

Comment 9

3 years ago
Created attachment 8658332 [details] [diff] [review]
1201629-vs2015-suite-v2.patch

Patch for wchar_t V2
Attachment #8656714 - Attachment is obsolete: true
(Assignee)

Comment 10

3 years ago
Assign seems to work fine.
(Assignee)

Comment 11

3 years ago
Created attachment 8658361 [details] [diff] [review]
1201629-vs2015-suite-v2a.patch

patch for wchar_t conversion
Attachment #8658332 - Attachment is obsolete: true

Updated

3 years ago
Duplicate of this bug: 1203006
Depends on: 1198936

Updated

3 years ago
Assignee: nobody → frgrahl
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Updated

3 years ago
Attachment #8658361 - Flags: review?(neil)

Updated

3 years ago
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
Last Resolved: 3 years ago
status-seamonkey2.40: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.40
You need to log in before you can comment on or make changes to this bug.