Re: [AD] dat/grabber and pack_fopen_chunk

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> > Index: src/file.c
> > ===================================================================
> > --- src/file.c (revision 5662)
> > +++ src/file.c (working copy)
> > @@ -1904,13 +1904,56 @@
> >  
> >        /* write a sub-chunk */ 
> >        int tmp_fd = -1;
> > +      char *tmp_dir = NULL;
> > +      char *tmp_name = NULL;
> > +      #ifndef HAVE_MKSTEMP
> > +      char* tmpnam_string;
> > +      #endif
> >  
> > +      #ifdef ALLEGRO_WINDOWS
> > +         int size;
> > +         int new_size = 64;
> > +         
> > +         /* Get the path of the temporary directory */
> > +         do {
> > +            size = new_size;
> > +            tmp_dir = realloc(tmp_dir, size);
> > +            new_size = GetTempPath(size, tmp_dir);
> 
> When compiling with mingw (WARNMODE=1)
> 
> src/file.c: In function `pack_fopen_chunk':
> src/file.c:1921: warning: implicit declaration of function `GetTempPath'
> src/file.c:1926: warning: zero-length printf format string

Hmm... yes, I obviously neglected to test the thing in Windows... :-x

> src/file.c:1969: warning: implicit declaration of function `mkstemp'
> make: *** [obj/mingw32/alld/file.o] Error 1

Bleh! That line should just go (see below).

> > +         tmp_fd = mkstemp(tmp_name);
> 
> Er, this appears in the #if_n_def HAVE_MKSTEMP section.

Yeah; it's left over from the editing of the source file; I clearly 
HAVE_MKSTEMP and never saw the error.

I'll fix the printf() and mkstemp() errors now, but I can't really fix the 
GetTempPath one immediately. It probably just needs an #ifdef 
ALLEGRO_WINDOWS #include <windowsheaders> #endif somewhere.

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/