summaryrefslogtreecommitdiffstats
path: root/extra/fltk/scandir_posix.patch
diff options
context:
space:
mode:
authortnut <thierryn1 at hispeed dot ch>2009-12-16 23:16:46 +0100
committertnut <thierryn1 at hispeed dot ch>2009-12-16 23:16:46 +0100
commit83d1b5bf752f26bcb12cf722b54d4d170a32ba4d (patch)
treec039360edd3af87125d43224d4ae0c9a80e3795a /extra/fltk/scandir_posix.patch
parent0a8468ce9113dae86146a129d547030d0f875aa8 (diff)
downloadnutyx-pakxe-83d1b5bf752f26bcb12cf722b54d4d170a32ba4d.tar.gz
nutyx-pakxe-83d1b5bf752f26bcb12cf722b54d4d170a32ba4d.tar.bz2
nutyx-pakxe-83d1b5bf752f26bcb12cf722b54d4d170a32ba4d.tar.xz
nutyx-pakxe-83d1b5bf752f26bcb12cf722b54d4d170a32ba4d.zip
Ajout de fltk#r6960-1
Diffstat (limited to 'extra/fltk/scandir_posix.patch')
-rw-r--r--extra/fltk/scandir_posix.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/extra/fltk/scandir_posix.patch b/extra/fltk/scandir_posix.patch
new file mode 100644
index 000000000..1ac986e35
--- /dev/null
+++ b/extra/fltk/scandir_posix.patch
@@ -0,0 +1,56 @@
+Index: configh.in
+===================================================================
+--- configh.in (revision 6827)
++++ configh.in (working copy)
+@@ -182,6 +182,7 @@
+ #undef HAVE_SYS_DIR_H
+ #undef HAVE_NDIR_H
+ #undef HAVE_SCANDIR
++#undef HAVE_SCANDIR_POSIX
+
+ /* If not set fltk will define it's own versions of these string
+ functions. By including the fltk/string.h header file you will
+Index: src/filename_list.cxx
+===================================================================
+--- src/filename_list.cxx (revision 6826)
++++ src/filename_list.cxx (working copy)
+@@ -62,6 +62,9 @@
+ // This version is when we define our own scandir (WIN32 and perhaps
+ // some Unix systems):
+ int n = scandir(d, list, 0, sort);
++#elif defined(HAVE_SCANDIR_POSIX)
++ // POSIX (2008) defines the comparison function like this:
++ int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
+ #elif defined(__linux) || defined (__FreeBSD__) || defined (__NetBSD__)
+ int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
+ #elif defined(__hpux) || defined(__CYGWIN__)
+Index: configure.in
+===================================================================
+--- configure.in (revision 6826)
++++ configure.in (working copy)
+@@ -333,6 +333,25 @@
+ AC_DEFINE(HAVE_SCANDIR)
+ fi])
+
++dnl Do we have the POSIX compatible scandir() prototype?
++AC_CACHE_CHECK([whether we have the POSIX compatible scandir() prototype],
++ ac_cv_cxx_scandir_posix,[
++ AC_LANG_SAVE
++ AC_LANG_CPLUSPLUS
++ AC_TRY_COMPILE([
++ # include <dirent.h>
++ int func (const char *d, dirent ***list, void *sort) {
++ int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
++ }
++ ],[
++ ], ac_cv_cxx_scandir_posix=yes, ac_cv_cxx_scandir_posix=no)
++ AC_LANG_RESTORE
++ ])
++
++if test "$ac_cv_cxx_scandir_posix" = yes; then
++ AC_DEFINE(HAVE_SCANDIR_POSIX)
++fi
++
+ dnl String headers and functions...
+ AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
+ AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))