r25867: libreplace: solaris has different prototypes for getpwent_r and getgrent_r
authorStefan Metzmacher <metze@samba.org>
Tue, 6 Nov 2007 08:15:11 +0000 (09:15 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:44:33 +0000 (05:44 +0100)
metze
(This used to be commit 44250ac6f987ba98e1efe8cd81b4e7eaa8017ed0)

source4/lib/replace/system/config.m4

index 2b2f76a8e6d766ff4fda86ffddc1dcf73d40027b..6500535982c6a8459f9acca5523a68162b0e2043 100644 (file)
@@ -19,7 +19,39 @@ AC_CHECK_HEADERS(sys/capability.h)
 # passwd
 AC_CHECK_HEADERS(grp.h sys/id.h compat.h shadow.h sys/priv.h pwd.h sys/security.h)
 AC_CHECK_FUNCS(getpwnam_r getpwuid_r getpwent_r)
+AC_HAVE_DECL(getpwent_r, [
+       #include <unistd.h>
+       #include <pwd.h>
+       ])
+AC_VERIFY_C_PROTOTYPE([struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)],
+       [
+       #ifndef HAVE_GETPWENT_R_DECL
+       #error missing getpwent_r prototype
+       #endif
+       return NULL;
+       ],[
+       AC_DEFINE(SOLARIS_GETPWENT_R, 1, [getpwent_r solaris function prototype])
+       ],[],[
+       #include <unistd.h>
+       #include <pwd.h>
+       ])
 AC_CHECK_FUNCS(getgrnam_r getgrgid_r getgrent_r)
+AC_HAVE_DECL(getgrent_r, [
+       #include <unistd.h>
+       #include <grp.h>
+       ])
+AC_VERIFY_C_PROTOTYPE([struct group *getgrent_r(struct group *src, char *buf, int buflen)],
+       [
+       #ifndef HAVE_GETGRENT_R_DECL
+       #error missing getgrent_r prototype
+       #endif
+       return NULL;
+       ],[
+       AC_DEFINE(SOLARIS_GETGRENT_R, 1, [getgrent_r solaris function prototype])
+       ],[],[
+       #include <unistd.h>
+       #include <grp.h>
+       ])
 
 # locale
 AC_CHECK_HEADERS(ctype.h locale.h)