]> git.lyx.org Git - features.git/commitdiff
sync with kdewin32
authorPeter Kümmel <syntheticpp@gmx.net>
Mon, 18 Sep 2006 18:57:42 +0000 (18:57 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Mon, 18 Sep 2006 18:57:42 +0000 (18:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15049 a592a061-630c-0410-9148-cb99ea01b6c8

development/Win32/aspell/dirent.c

index 42be761476f01102b0454deee44a8a4b363cfddb..c123c0e01d414e2746bd2cac5bcab9b011aca020 100755 (executable)
@@ -56,7 +56,6 @@
  * University of Illinois, Urbana-Champaign.
  */
 
-//#include <winposix_export.h>
 #include <windows.h>
 
 #include <malloc.h>
@@ -78,6 +77,7 @@
  * The DIR typedef is not compatible with Unix.
  **********************************************************************/
 
+#ifndef __MINGW32__
 
 KDEWIN32_EXPORT DIR * opendir(const char *dir)
 {
@@ -118,12 +118,17 @@ KDEWIN32_EXPORT struct dirent * readdir(DIR *dp)
     if (dp->offset != 0) {
         if (_findnext(dp->handle, &(dp->fileinfo)) < 0) {
             dp->finished = 1;
+            /* posix does not set errno in this case */
+            errno = 0;
             return NULL;
         }
     }
     dp->offset++;
 
     strncpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME);
+#ifdef KDEWIN32_HAVE_DIRENT_D_TYPE
+    dp->dent.d_type = DT_UNKNOWN;
+#endif    
     dp->dent.d_ino = 1;
     dp->dent.d_reclen = strlen(dp->dent.d_name);
     dp->dent.d_off = dp->offset;
@@ -131,13 +136,6 @@ KDEWIN32_EXPORT struct dirent * readdir(DIR *dp)
     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;
@@ -148,3 +146,12 @@ KDEWIN32_EXPORT int closedir(DIR *dp)
     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;
+}