Prechádzať zdrojové kódy

Build x64 versions only if LFS is enabled

Peter S. Mazinger 18 rokov pred
rodič
commit
81c39339ef

+ 5 - 2
libc/misc/dirent/Makefile.in

@@ -7,8 +7,11 @@
 #
 
 CSRC:=	alphasort.c closedir.c dirfd.c opendir.c readdir.c rewinddir.c scandir.c \
-	seekdir.c telldir.c readdir64.c alphasort64.c scandir64.c readdir_r.c \
-	readdir64_r.c
+	seekdir.c telldir.c readdir_r.c
+
+ifeq ($(UCLIBC_HAS_LFS),y)
+CSRC+=	readdir64.c alphasort64.c scandir64.c readdir64_r.c
+endif
 
 MISC_DIRENT_DIR:=$(top_srcdir)libc/misc/dirent
 MISC_DIRENT_OUT:=$(top_builddir)libc/misc/dirent

+ 1 - 3
libc/misc/dirent/alphasort64.c

@@ -1,5 +1,5 @@
 #include <features.h>
-#ifdef __UCLIBC_HAS_LFS__
+
 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
 #undef _FILE_OFFSET_BITS
 #define	_FILE_OFFSET_BITS   64
@@ -22,5 +22,3 @@ int alphasort64(const void * a, const void * b)
     return __strcmp ((*(const struct dirent64 **) a)->d_name,
 	    (*(const struct dirent64 **) b)->d_name);
 }
-#endif /* __UCLIBC_HAS_LFS__ */
-

+ 2 - 0
libc/misc/dirent/dirstream.h

@@ -72,8 +72,10 @@ struct __dirstream {
 
 
 extern ssize_t __getdents(int fd, char *buf, size_t count) attribute_hidden;
+extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden;
 #ifdef __UCLIBC_HAS_LFS__
 extern ssize_t __getdents64 (int fd, char *buf, size_t count) attribute_hidden;
+extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden;
 #endif
 
 #endif /* dirent.h  */

+ 2 - 1
libc/misc/dirent/readdir.c

@@ -1,3 +1,5 @@
+#include <features.h>
+
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
@@ -5,7 +7,6 @@
 #include <dirent.h>
 #include "dirstream.h"
 
-#undef readdir
 struct dirent attribute_hidden *__readdir(DIR * dir)
 {
 	ssize_t bytes;

+ 1 - 4
libc/misc/dirent/readdir64.c

@@ -1,5 +1,5 @@
 #include <features.h>
-#ifdef __UCLIBC_HAS_LFS__
+
 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
 #undef _FILE_OFFSET_BITS
 #define	_FILE_OFFSET_BITS   64
@@ -20,7 +20,6 @@
 #include <dirent.h>
 #include "dirstream.h"
 
-#undef readdir64
 struct dirent64 attribute_hidden *__readdir64(DIR * dir)
 {
 	ssize_t bytes;
@@ -62,5 +61,3 @@ all_done:
 	return de;
 }
 strong_alias(__readdir64,readdir64)
-
-#endif /* __UCLIBC_HAS_LFS__ */

+ 1 - 4
libc/misc/dirent/readdir64_r.c

@@ -1,5 +1,5 @@
 #include <features.h>
-#ifdef __UCLIBC_HAS_LFS__
+
 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
 #undef _FILE_OFFSET_BITS
 #define	_FILE_OFFSET_BITS   64
@@ -19,7 +19,6 @@
 #include <dirent.h>
 #include "dirstream.h"
 
-
 int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result)
 {
 	int ret;
@@ -69,5 +68,3 @@ all_done:
 	__pthread_mutex_unlock(&(dir->dd_lock));
         return((de != NULL)? 0 : ret);
 }
-#endif /* __UCLIBC_HAS_LFS__ */
-

+ 1 - 3
libc/misc/dirent/scandir64.c

@@ -25,7 +25,7 @@
 #define closedir __closedir
 
 #include <features.h>
-#ifdef __UCLIBC_HAS_LFS__
+
 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
 #undef _FILE_OFFSET_BITS
 #define	_FILE_OFFSET_BITS   64
@@ -114,5 +114,3 @@ int scandir64(const char *dir, struct dirent64 ***namelist,
     *namelist = names;
     return pos;
 }
-#endif /* __UCLIBC_HAS_LFS__ */
-