Closed Bug 266105 Opened 20 years ago Closed 20 years ago

nsNativeAppSupportOS2.cpp does not compile

Categories

(SeaMonkey :: UI Design, defect)

x86
OS/2
defect
Not set
blocker

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mozilla, Assigned: mkaply)

Details

Attachments

(1 file, 5 obsolete files)

Due to the XPCOM changes in bug 262218, nsNativeAppSupportOS2.cpp does not
compile any more on OS/2. I see a similar error in the OS/2 tinderbox so I doubt
that it is just me. I made a few small changes (small patch coming) but still
get these errors. It seems that the string methods in nsStringSupport.h are not
sufficient for OS/2:

nsNativeAppSupportOS2.cpp
g++ -o nsNativeAppSupportOS2.o -c -DXPCOM_GLUE -DMOZILLA_STRICT_API
-DOSTYPE=\"OS22\" -DOSARCH=\"OS2\" -IM:/trunk/mozilla/xpfe/bootstrap -I.
-I../../dist/include/xpcom -I../../dist/include/string
-I../../dist/include/webbrwsr -I../../dist/include/widget
-I../../dist/include/dom -I../../dist/include/necko -I../../dist/include/content
-I../../dist/include/pref -I../../dist/include/appshell -I../../dist/include/gfx
-I../../dist/include/xpinstall -I../../dist/include/uriloader
-I../../dist/include/windowwatcher -I../../dist/include/embed_base
-I../../dist/include/embedcomponents -I../../dist/include/docshell
-I../../dist/include/locale -I../../dist/include/profile
-I../../dist/include/chrome -I../../dist/include/jprof
-I../../dist/include/xpconnect -I../../dist/include/intl
-I../../dist/include/profile -I../../dist/include/apprunner -I../../dist/include
-IM:/trunk/obj_opt/dist/include/nspr    -DMNG_BUILD_FULL_MNG        -fno-rtti
-fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align
-Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
-Wno-long-long -pedantic -Zomf -pipe  -DNDEBUG -DTRIMMED -O2 -s
-DWIDGET_DLL=\"wdgtos2.dll\" -DGFXWIN_DLL=\"gfx_os2.dll\"    -DMOZILLA_CLIENT
-include ../../mozilla-config.h -Uunix -U__unix -U__unix__
-Wp,-MD,.deps/nsNativeAppSupportOS2.pp
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In static 
   member function `static HDDEDATA 
   nsNativeAppSupportOS2::HandleDDENotification(long unsigned int, short 
   unsigned int, short unsigned int, long unsigned int, long unsigned int, long 
   unsigned int, long unsigned int, long unsigned int, long unsigned int)':
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:1570: no 
   matching function for call to `nsDependentString_local::
   nsDependentString_local(const wchar_t[18])'
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:162: candidates 
   are: nsDependentString_local::nsDependentString_local(const 
   nsDependentString_local&)
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:165:               
     nsDependentString_local::nsDependentString_local(const PRUnichar*) <near 
   match>
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In static 
   member function `static nsCString_local 
   nsNativeAppSupportOS2::ParseDDEArg(long unsigned int, int)':
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:1767: no 
   matching function for call to `nsCString_local::SetLength(long unsigned int)
   '
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:1769: no 
   matching function for call to `nsCString_local::BeginWriting()'
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In static 
   member function `static void nsNativeAppSupportOS2::ActivateLastWindow()':
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:1809: no 
   matching function for call to `nsDependentString_local::
   nsDependentString_local(const wchar_t[18])'
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:162: candidates 
   are: nsDependentString_local::nsDependentString_local(const 
   nsDependentString_local&)
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:165:               
     nsDependentString_local::nsDependentString_local(const PRUnichar*) <near 
   match>
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In static 
   member function `static void nsNativeAppSupportOS2::HandleRequest(BYTE*, 
   int)':
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:1979: no 
   matching function for call to `nsCAutoString_local::AssignWithConversion(
   nsXPIDLString_local&)'
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In static 
   member function `static nsresult 
   nsNativeAppSupportOS2::GetCmdLineArgs(BYTE*, nsICmdLineService**)':
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2014: `
   isspace' undeclared (first use this function)
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2014: (Each
   undeclared identifier is reported only once for each function it appears 
   in.)
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In static 
   member function `static nsresult nsNativeAppSupportOS2::OpenWindow(const 
   char*, const char*)':
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2196: `
   do_CreateInstance' undeclared (first use this function)
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In static 
   member function `static nsresult 
   nsNativeAppSupportOS2::OpenBrowserWindow(const char*, int)':
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2299: no 
   matching function for call to `nsDependentString_local::
   nsDependentString_local(const wchar_t[18])'
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:162: candidates 
   are: nsDependentString_local::nsDependentString_local(const 
   nsDependentString_local&)
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:165:               
     nsDependentString_local::nsDependentString_local(const PRUnichar*) <near 
   match>
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In member 
   function `virtual nsresult nsNativeAppSupportOS2::StartServerMode()':
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2398: no 
   matching function for call to `nsDependentString_local::
   nsDependentString_local(const wchar_t[12])'
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:162: candidates 
   are: nsDependentString_local::nsDependentString_local(const 
   nsDependentString_local&)
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:165:               
     nsDependentString_local::nsDependentString_local(const PRUnichar*) <near 
   match>
M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2399: no 
   matching function for call to `nsDependentString_local::
   nsDependentString_local(const wchar_t[10])'
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:162: candidates 
   are: nsDependentString_local::nsDependentString_local(const 
   nsDependentString_local&)
M:/trunk/mozilla/xpfe/bootstrap/nsStringSupport.h:165:               
     nsDependentString_local::nsDependentString_local(const PRUnichar*) <near 
   match>
make: *** [nsNativeAppSupportOS2.o] Error 1
make: Leaving directory `M:/trunk/obj_opt/xpfe/bootstrap'
Attached patch 1st try (obsolete) — Splinter Review
This fixes a warning about "hab", and finds do_getService().
The other stuff seems very similar in nsNativeAppSupportWin.cpp, but obviously
it works there?!
>M:/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:1809: no 
>   matching function for call to `nsDependentString_local::
>   nsDependentString_local(const wchar_t[18])'

sounds like darin's patch...

I can't find a -fshort-wchar option in the g++ commandline, I suspect that
wchar_t is thus 4 byte, which means incompatible with PRUnichar. maybe L"foo"
should not be used here, or triggered by some other check.
Attached patch Beginning of a fix (obsolete) — Splinter Review
OK, this is requiring some major ficing to the StringSupport.h that darin
created.

OS/2 does NOT have HAVE_CPP_2BYTE_WCHAR_T defined, so we can't take the Windows
case here. We need the full code from nsLiteralString.h.

After these changes, we still don't compile because I need an implementation of
NS_ASCIItoUTF16
Attachment #163408 - Attachment is obsolete: true
NS_ASCIItoUTF16 ->

  nsEmbedString result;
  NS_CStringToUTF16(nsDependentCString("foo"),
                    NS_CSTRING_ENCODING_ASCII,
                    result);
Attached patch v1 patch (obsolete) — Splinter Review
Implement NS_ConvertASCIItoUTF16 and use it to implement NS_LITERAL_STRING when
HAVE_CPP_2BYTE_WCHAR_T
Attachment #163422 - Attachment is obsolete: true
Attached patch Full patch (obsolete) — Splinter Review
Peter, please test this.
Assignee: jag → mkaply
Attachment #163444 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attached patch Full patch, work around warnings (obsolete) — Splinter Review
Yes, thanks a lot! Now it compiles and works fine. There still is a double
#include "nsXPCOM.h"
and I get these warnings

G:/MozCompile/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In member

   function `virtual nsresult nsNativeAppSupportOS2::Start(PRBool*)':
G:/MozCompile/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:1235:
warning: `
   HAB hab' might be used uninitialized in this function
G:/MozCompile/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp: In 
   function `static nsresult nsNativeAppSupportOS2::GetCmdLineArgs(BYTE*, 
   nsICmdLineService**)':
G:/MozCompile/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2006:
warning: `
   int between' might be used uninitialized in this function
G:/MozCompile/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2006:
warning: `
   int quoted' might be used uninitialized in this function
G:/MozCompile/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2006:
warning: `
   int bSlashCount' might be used uninitialized in this function
G:/MozCompile/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2007:
warning: `
   int argc' might be used uninitialized in this function
G:/MozCompile/trunk/mozilla/xpfe/bootstrap/nsNativeAppSupportOS2.cpp:2008:
warning: `
   char*p' might be used uninitialized in this function

While not most likely not important we could try to get rid of the warnings
while working on this file. I updated your patch with a suggestion how to do
that, mostly by shuffling around the init "section" of
nsNativeAppSupportOS2::GetCmdLineArgs().
Strange. I don't get those warnings on my build. I wonder if I have something
turned off?

The double nsXPCOM.h was copied straight from Windows - I removed the last one.

I'm checking this puppy in.
Attached patch final finalSplinter Review
Attachment #163448 - Attachment is obsolete: true
Attachment #163468 - Attachment is obsolete: true
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Mozilla Application Suite
Verified with multiple builds since then, including 1.8a5.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: