Opened 16 years ago

Closed 16 years ago

Last modified 8 months ago

#8305 closed patch

GUI::OptionsDialog base class calls under MSVC6

Reported by: SF/jamieson630 Owned by: fingolfin
Priority: normal Component: GUI
Keywords: Cc:
Game:

Description

The attached patch works around MSVC6's difficulties
with the notation of explicit base class function calls in
cases where the namespace of the base class is
different than that of the derived class. Specifically, the
patch is meant to correct [erroneous] compile-time
errors related to calls made by Scumm::OptionsDialog to
base class GUI::OptionsDialog methods of the same
name. The trouble functions are open(), close() and
handleCommand().

The patch creates "internal" versions of the necessary
base class methods and puts the actual implementation
there. The override functions just call the internal
methods. In this way, the derived class can also call the
base class implementation by using the internal methods,
and thus avoid a name ambiguity.

This definitely muddies up the code a bit, and I'm not
happy with that because we could find ourselves having
to do in a variety of situations in the future, given our
new namespace design. Any other ideas? Is this where
we need to throw in the towel and abandon MSVC6
support entirely? :-)

Ticket imported from: #858731. Ticket imported from: patches/410.

Attachments (2)

options_dialog.diff (3.3 KB) - added by SF/jamieson630 16 years ago.
Rev. 1 patch against December 12 CVS
options_dialog.rev2.diff (3.3 KB) - added by SF/jamieson630 16 years ago.
Rev. 2 patch against December 12 CVS

Download all attachments as: .zip

Change History (10)

Changed 16 years ago by SF/jamieson630

Attachment: options_dialog.diff added

Rev. 1 patch against December 12 CVS

comment:1 Changed 16 years ago by SF/jamieson630

By the way, just to be completely clear -- the changes made
in this patch do compile AND RUN PROPERLY under MSVC6,
unlike my earlier solution that compiled but then crashed at
run time. I had a bit more time to test this one properly. :)

comment:2 Changed 16 years ago by SF/ender

I really would prefer to keep MSVC6 support - as that's the only
version of MSVC I have if I *do* need to do anything
windows-related :)

comment:3 Changed 16 years ago by fingolfin

This patch is really really sick, though, and will cause us some
nightmares in the future if we apply it, I fear (but of course I
understand the motivation behind it).

Anyway, did you try this:
1) Rename Scumm::OptionsDialog to e.g. Scumm::ConfigDialog
2) Then, do a "typedef GUI::OptionsDialog OptionsDialog"

comment:4 Changed 16 years ago by SF/jamieson630

Changing Scumm::OptionsDialog to Scumm::ConfigDialog and
creating the appropriate typedef for GUI::OptionsDialog also
fixes the problem. Revised patch coming shortly. (In the
middle of preparing for a three-day open-house starting in
three hours.)

Changed 16 years ago by SF/jamieson630

Attachment: options_dialog.rev2.diff added

Rev. 2 patch against December 12 CVS

comment:5 Changed 16 years ago by SF/jamieson630

Rev 2 patch, based on Fingolfin's recommended solution, is
now attached.

comment:6 Changed 16 years ago by fingolfin

Put into CVS. Not a really nice solution, but faaar better than the
other approach :-)

comment:7 Changed 16 years ago by fingolfin

Status: newclosed

comment:8 Changed 8 months ago by digitall

Component: GUI
Note: See TracTickets for help on using tickets.