DIR struct on MinGW

Peter Kümmel syntheticpp at gmx.net
Wed Aug 2 16:39:51 CEST 2006


Paulo Jorge Guedes wrote:
>> -----Original Message-----
>> From: Peter Kümmel [mailto:syntheticpp at gmx.net]
>> Sent: quarta-feira, 2 de Agosto de 2006 15:18
>> To: kde-buildsystem at kde.org
>> Subject: Re: DIR struct on MinGW
>>
>> Paulo Jorge Guedes wrote:
>>>> I've renamed readir.h because it is not a posix file. Have a look at
>> the
>>>> msvc version of dirent.h and copy the missing definitions to the mingw
>>>> version.
>>> And stop including the mingw version?
>>>
>>> Paulo
>> No, I would add the missing symbols without removing the mingw version.
> 
> But the mingw header already defines the DIR struct...
> 
> Paulo

Seems in src/dirent.c only readdir_r is needed by mingw,
so a "#ifndef __MINGW32__" would be the best solution, without
changing include/mingw/dirent.h:


Index: dirent.c
===================================================================
--- dirent.c    (revision 566907)
+++ dirent.c    (working copy)
@@ -78,6 +78,8 @@
  * The DIR typedef is not compatible with Unix.
  **********************************************************************/

+#ifndef __MINGW32__
+
 KDEWIN32_EXPORT DIR * opendir(const char *dir)
 {
     DIR *dp;
@@ -135,13 +137,6 @@
     return &(dp->dent);
 }

-KDEWIN32_EXPORT struct dirent* readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
-{
-       //todo: remove this when readdir_r.c will be ported
-       result = 0;
-       return 0;
-}
-
 KDEWIN32_EXPORT int closedir(DIR *dp)
 {
     if (!dp) return 0;
@@ -152,3 +147,12 @@
     return 0;
 }

+#endif // #ifndef __MINGW32__
+
+
+KDEWIN32_EXPORT struct dirent* readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
+{
+       //todo: remove this when readdir_r.c will be ported
+       result = 0;
+       return 0;
+}




More information about the Kde-buildsystem mailing list