~dexter/fakechroot/natty

« back to all changes in this revision

Viewing changes to m4/scandir64_argtypes.m4

  • Committer: piotr.roszatycki at gmail
  • Date: 2010-09-12 18:21:38 UTC
  • mfrom: (0.1.7 upstream)
  • Revision ID: piotr.roszatycki@gmail.com-20100912182138-dpjazxgvcscsgd7e
* New upstream release:
  - All Debian patches were applied upstream.
  - Fixed getsockname(2) and getpeername(2) functions and bug when
    "host 127.0.0.1" is called. Closes: #596435.
  - Fixed canonicalize_file_name(3) function and bug when "man-db" command
    is called.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl  AC_FUNC_SCANDIR64_ARGTYPES
2
 
dnl  -------------------------
3
 
dnl  Determine the correct type to be passed to each of the `scandir64'
4
 
dnl  function's arguments, and define those types in `SCANDIR64_TYPE_ARG1',
5
 
dnl  `SCANDIR64_TYPE_ARG2', `SCANDIR64_TYPE_ARG3' and `SCANDIR64_TYPE_ARG4'.
6
 
AN_FUNCTION([scandir64], [AC_FUNC_SCANDIR64_ARGTYPES])
7
 
AC_DEFUN([AC_FUNC_SCANDIR64_ARGTYPES],
8
 
[AC_CHECK_HEADERS(dirent.h)
9
 
AC_CACHE_CHECK([types of arguments for scandir64],
10
 
[ac_cv_func_scandir64_args],
11
 
[for ac_return in 'int'; do
12
 
 for ac_arg1 in 'const char *name'; do
13
 
  for ac_arg2 in 'struct dirent64 ***name'; do
14
 
   for ac_arg3 in 'int(*name)(const struct dirent64 *)' 'int(*name)(struct dirent64 *)'; do
15
 
    for ac_arg4 in 'int(*name)(const void *,const void *)' 'int(*name)(const struct dirent64 **, const struct dirent64 **)'; do
16
 
     AC_COMPILE_IFELSE(
17
 
       [AC_LANG_PROGRAM(
18
 
[AC_INCLUDES_DEFAULT
19
 
#include <dirent.h>
20
 
],
21
 
            [
22
 
#define ac_arg1(name) $ac_arg1
23
 
#define ac_arg2(name) $ac_arg2
24
 
#define ac_arg3(name) $ac_arg3
25
 
#define ac_arg4(name) $ac_arg4
26
 
extern $ac_return scandir64 (ac_arg1(dirp), ac_arg2(namelist), ac_arg3(filter), ac_arg4(compar));])],
27
 
            [ac_cv_func_scandir64_args="$ac_return;$ac_arg1;$ac_arg2;$ac_arg3;$ac_arg4"; break 5])
28
 
    done
29
 
   done
30
 
  done
31
 
 done
32
 
done
33
 
# Provide a safe default value.
34
 
: ${ac_cv_func_scandir64_args='(default) int;const char *name;struct dirent64 ***name;int(*name)(const struct dirent64 *);int(*name)(const void *,const void *)'}
35
 
])
36
 
ac_save_IFS=$IFS; IFS=';'
37
 
set dummy `echo "$ac_cv_func_scandir64_args" | sed 's/^(default) //' | sed 's/\*/\*/g'`
38
 
IFS=$ac_save_IFS
39
 
shift
40
 
AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_RETURN, $[1],
41
 
                   [Define to the type of return value for `scandir64'.])
42
 
AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG1(name), $[2],
43
 
                   [Define to the type of arg 1 for `scandir64'.])
44
 
AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG2(name), $[3],
45
 
                   [Define to the type of arg 2 for `scandir64'.])
46
 
AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG3(name), $[4],
47
 
                   [Define to the type of arg 3 for `scandir64'.])
48
 
AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG4(name), $[5],
49
 
                   [Define to the type of arg 4 for `scandir64'.])
50
 
rm -f conftest*
51
 
])