Review Request 124760: Do not overwrite _WIN32_WINNT in our custom shared-mime-info unistd.c

Michael Abrahams miabraha at gmail.com
Sat Aug 22 12:29:28 UTC 2015



> On Aug. 18, 2015, 5:51 p.m., Kevin Funk wrote:
> > We have a patch that fixes a crash in shared-mime-info:
> > 
> > ```
> > From 83e045ee8df2ab408af585712d11db960d4de502 Mon Sep 17 00:00:00 2001
> > From: Gleb Popov <6yearold at gmail.com>
> > Date: Tue, 18 Aug 2015 19:36:44 +0300
> > Subject: [PATCH] Fix update-mime-info. VS was picking wrong function types for
> >  opendir/readdir because there was no prototypes for them in dirent.h, which
> >  lead to crash. The second crash was due to writing 8-byte intptr_t value
> >  returned by _findfirst() into a 4-byte long variable. No idea how it was
> >  working before.
> > 
> > ---
> >  portage/win32libs/shared-mime-info/dirent.c | 2 +-
> >  portage/win32libs/shared-mime-info/dirent.h | 7 ++++++-
> >  2 files changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/portage/win32libs/shared-mime-info/dirent.c b/portage/win32libs/shared-mime-info/dirent.c
> > index 2ca945a..c35ae29 100644
> > --- a/portage/win32libs/shared-mime-info/dirent.c
> > +++ b/portage/win32libs/shared-mime-info/dirent.c
> > @@ -83,7 +83,7 @@ DIR * opendir(const char *dir)
> >  {
> >      DIR *dp;
> >      char *filespec;
> > -    long handle;
> > +    intptr_t handle;
> >      int index;
> >  
> >      filespec = malloc(strlen(dir) + 2 + 1);
> > diff --git a/portage/win32libs/shared-mime-info/dirent.h b/portage/win32libs/shared-mime-info/dirent.h
> > index b98296a..bb4b837 100644
> > --- a/portage/win32libs/shared-mime-info/dirent.h
> > +++ b/portage/win32libs/shared-mime-info/dirent.h
> > @@ -73,7 +73,7 @@ struct dirent {
> >  
> >  /* typedef DIR - not the same as Unix */
> >  typedef struct {
> > -    long handle;                /* _findfirst/_findnext handle */
> > +    intptr_t handle;                /* _findfirst/_findnext handle */
> >      short offset;                /* offset into directory */
> >      short finished;             /* 1 if there are not more files */
> >      struct _finddata_t fileinfo;  /* from _findfirst/_findnext */
> > @@ -81,6 +81,11 @@ typedef struct {
> >      struct dirent dent;         /* the dirent to return */
> >  } DIR;
> >  
> > +#ifndef __MINGW32__
> > +DIR * opendir(const char *dir);
> > +struct dirent * readdir(DIR *dp);
> > +#endif
> > +
> >  #ifdef __cplusplus
> >  }
> >  #endif
> > -- 
> > 1.8.3.msysgit.0
> > ```
> > 
> > Does that tackle the same issue? Do you know?
> 
> Michael Abrahams wrote:
>     The intptr_t definition conflict seems familiar. I can try building again with that revision included, and perhaps the issue will be resolved. I will share compiler logs if it fails.

I built after reverting the change and everything seemed fine. This patch can be relinquished as a mystery lost to time.


- Michael


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124760/#review84005
-----------------------------------------------------------


On Aug. 15, 2015, 10:47 p.m., Michael Abrahams wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124760/
> -----------------------------------------------------------
> 
> (Updated Aug. 15, 2015, 10:47 p.m.)
> 
> 
> Review request for kdewin.
> 
> 
> Repository: emerge
> 
> 
> Description
> -------
> 
> These additions are part of my recent work building Krita on Windows with MSVC2013 and KDE Frameworks 5.
> 
> 
> Diffs
> -----
> 
>   portage/win32libs/shared-mime-info/unistd.c 440b9e9 
> 
> Diff: https://git.reviewboard.kde.org/r/124760/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Michael Abrahams
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-windows/attachments/20150822/a8535644/attachment.html>


More information about the Kde-windows mailing list