/*
- Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
+ Copyright (c) 2009,2011 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#ifndef AD_H
#define AD_H
-#if !defined(__FreeBSD__)
-# define _XOPEN_SOURCE 600
-#endif
+#include <atalk/standards.h>
#include <sys/types.h>
#include <sys/stat.h>
dnl ----- OpenBSD specific -----
if test x"$this_os" = "xopenbsd"; then
AC_MSG_RESULT([ * OpenBSD specific configuration])
+ AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
+ AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
fi
dnl ----- Solaris specific -----
#include "config.h"
#endif
-#if !defined(__FreeBSD__) && !defined(__NetBSD__)
-#ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE 600
-#endif
-#ifndef __EXTENSIONS__
-# define __EXTENSIONS__
-#endif
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-#endif
+#include <atalk/standards.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef UAM_DHX2
+#include <atalk/standards.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <pwd.h>
-#ifdef NETBSD
-#define _XOPEN_SOURCE 500 /* for crypt() */
-#endif
-#ifdef FREEBSD
-#define _XOPEN_SOURCE /* for crypt() */
-#endif
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#ifdef NETBSD
-#define _XOPEN_SOURCE 500 /* for crypt() */
-#endif
-#ifdef FREEBSD
-#define _XOPEN_SOURCE /* for crypt() */
-#endif
+#include <atalk/standards.h>
#include <stdio.h>
#include <stdlib.h>
#include <config.h>
#endif /* HAVE_CONFIG_H */
-#include <sys/types.h>
-/* crypt needs _XOPEN_SOURCE (500) at least on BSD, but that breaks Solaris compile */
-#ifdef NETBSD
-#define _XOPEN_SOURCE 500 /* for crypt() */
-#endif
-#ifdef FREEBSD
-#define _XOPEN_SOURCE /* for crypt() */
-#endif
+#include <atalk/standards.h>
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
/* STDC check */
#ifdef UAM_PGP
-/* for crypt() */
-#define _XOPEN_SOURCE
+#include <atalk/standards.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
server_ipc.h tdb.h uam.h unicode.h util.h uuid.h volinfo.h \
zip.h ea.h acl.h unix.h directory.h hash.h volume.h
-noinst_HEADERS = cnid_dbd_private.h cnid_private.h bstradd.h bstrlib.h errchk.h ftw.h globals.h fce_api.h
+noinst_HEADERS = cnid_dbd_private.h cnid_private.h bstradd.h bstrlib.h errchk.h ftw.h globals.h fce_api.h standards.h
#include <config.h>
#endif
-/* -------------------
- * need pread() and pwrite()
- */
-#ifdef HAVE_PREAD
-
-#ifndef HAVE_PWRITE
-#undef HAVE_PREAD
-#endif
-
-#endif
-
-#ifdef HAVE_PWRITE
-#ifndef HAVE_PREAD
-#undef HAVE_PWRITE
-#endif
-#endif
-
-/*
- Still have to figure out which platforms really
- need _XOPEN_SOURCE defined for pread.
-*/
-#if defined(HAVE_PREAD) && !defined(SOLARIS) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(TRU64)
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-#endif
+#include <atalk/standards.h>
#include <sys/types.h>
#include <sys/stat.h>
/* lock file path. this should be re-organized a bit. */
#if ! defined (_PATH_LOCKDIR)
-# if defined (FHS_COMPATIBILITY) || defined (__NetBSD__)
+# if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__)
# define _PATH_LOCKDIR "/var/run/"
# elif defined (BSD4_4)
# ifdef MACOSX_SERVER
*/
#define _PATH_ATALKDEBUG "/tmp/atalkd.debug"
#define _PATH_ATALKDTMP "atalkd.tmp"
-#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__)
+#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__)
# define _PATH_ATALKDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"atalkd.pid")
#else
# define _PATH_ATALKDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"atalkd")
* psorder paths
*/
#define _PATH_TMPPAGEORDER "/tmp/psorderXXXXXX"
-#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__)
+#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__)
# define _PATH_PAPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"papd.pid")
#else
# define _PATH_PAPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"papd")
*/
#define _PATH_AFPTKT "/tmp/AFPtktXXXXXX"
#define _PATH_AFP_IPC ATALKPATHCAT(_PATH_LOCKDIR,"afpd_ipc")
-#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__)
+#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__)
# define _PATH_AFPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"afpd.pid")
#else
# define _PATH_AFPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"afpd")
/*
* cnid_metad paths
*/
-#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__)
+#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) || defined (__OpenBSD__)
# define _PATH_CNID_METAD_LOCK ATALKPATHCAT(_PATH_LOCKDIR,"cnid_metad.pid")
#else
# define _PATH_CNID_METAD_LOCK ATALKPATHCAT(_PATH_LOCKDIR,"cnid_metad")
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#if !defined(__FreeBSD__) && !defined(__NetBSD__)
-# ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE 600
-# endif
-# ifndef __EXTENSIONS__
-# define __EXTENSIONS__
-# endif
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-# endif
-#endif
+#include <atalk/standards.h>
+
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>