[hatari-devel] VC6 compatibility changes?
Thomas Huth
th.huth at gmx.de
Tue Feb 10 23:05:39 CET 2009
On Sun, 8 Feb 2009 20:07:43 +0200
Eero Tamminen <eerot at users.berlios.de> wrote:
> On Saturday 07 February 2009, hatari-tracking at lists.berlios.de wrote:
> > --- a/config-default.h Wed Feb 04 23:39:50 2009 +0200
> > +++ b/config-default.h Sat Feb 07 08:46:04 2009 +0100
> > @@ -1,5 +1,11 @@
> > /* Default config.h for Hatari */
> >
> > +/* Define to `__inline__' or `__inline' if that's what the C
> > compiler
> > + calls it, or to nothing if 'inline' is not supported under any
> > name. */
> > +#if defined(_MSC_VER)
> > +# define inline __inline
> > +#endif
> > +
>
> This may need to check for a version. Inline is a standard C99
> keyword so I would assume future MS C-compilers (VC7? VC8?) to
> support it.
I don't think that a version it is really required here. Even if they
support the inline keyword one day, they'll certainly continue to
support the __inline keyword, too, so this define should continue to
work.
> > --- a/src/change.c Wed Feb 04 23:39:50 2009 +0200
> > +++ b/src/change.c Sat Feb 07 08:46:04 2009 +0100
> > @@ -350,7 +350,7 @@
> > bool Change_ApplyCommandline(char *cmdline)
> > {
> > int i, argc, inarg;
> > - const char **argv;
> > + char **argv;
> > bool ret;
> >
> > /* count args */
> > @@ -409,7 +409,7 @@
> > argv[argc] = NULL;
> >
> > /* do args */
> > - ret = Change_Options(argc, argv);
> > + ret = Change_Options(argc, (const char**)argv);
> > free(argv);
> > return ret;
> > }
>
> What's the problem with this?
> (non-const pointer to const char* pointers?)
The first change ("const char **argv" to "char *argv") comes from
Kenneth patch. Kenneth, could you elaborate why this was necessary? Did
VC6 produce an error or just a warning?
The second change (the cast) has been added by myself, because without
it, my GCC (4.2.4) spilled out a warning (don't know why, IMHO there is
no problem when a char** gets passed to a const char** parameter).
Thomas
More information about the hatari-devel
mailing list