diff --git a/bin/ad/ad.h b/bin/ad/ad.h index ee22654c42..6e41a9c02b 100644 --- a/bin/ad/ad.h +++ b/bin/ad/ad.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2009 Frank Lahm + Copyright (c) 2009,2011 Frank Lahm 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 @@ -15,9 +15,7 @@ #ifndef AD_H #define AD_H -#if !defined(__FreeBSD__) -# define _XOPEN_SOURCE 600 -#endif +#include #include #include diff --git a/configure.ac b/configure.ac index e9facb2f13..05711b088f 100644 --- a/configure.ac +++ b/configure.ac @@ -756,8 +756,10 @@ fi 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 ----- diff --git a/etc/cnid_dbd/comm.c b/etc/cnid_dbd/comm.c index bc8e46fd00..dbe8da14c0 100644 --- a/etc/cnid_dbd/comm.c +++ b/etc/cnid_dbd/comm.c @@ -9,17 +9,7 @@ #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 #include #include diff --git a/etc/uams/uams_dhx2_passwd.c b/etc/uams/uams_dhx2_passwd.c index 0f07333b1a..1392f0a75e 100644 --- a/etc/uams/uams_dhx2_passwd.c +++ b/etc/uams/uams_dhx2_passwd.c @@ -12,19 +12,14 @@ #ifdef UAM_DHX2 +#include + #include #include #include #include #include -#ifdef NETBSD -#define _XOPEN_SOURCE 500 /* for crypt() */ -#endif -#ifdef FREEBSD -#define _XOPEN_SOURCE /* for crypt() */ -#endif - #ifdef HAVE_UNISTD_H #include #endif diff --git a/etc/uams/uams_dhx_passwd.c b/etc/uams/uams_dhx_passwd.c index bc91aca60c..465f28972e 100644 --- a/etc/uams/uams_dhx_passwd.c +++ b/etc/uams/uams_dhx_passwd.c @@ -10,12 +10,7 @@ #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 #include #include diff --git a/etc/uams/uams_passwd.c b/etc/uams/uams_passwd.c index d026a50dab..db9be446cf 100644 --- a/etc/uams/uams_passwd.c +++ b/etc/uams/uams_passwd.c @@ -10,15 +10,9 @@ #include #endif /* HAVE_CONFIG_H */ -#include -/* 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 +#include #include #include /* STDC check */ diff --git a/etc/uams/uams_pgp.c b/etc/uams/uams_pgp.c index e3892573f2..ec6d4095e1 100644 --- a/etc/uams/uams_pgp.c +++ b/etc/uams/uams_pgp.c @@ -12,8 +12,8 @@ #ifdef UAM_PGP -/* for crypt() */ -#define _XOPEN_SOURCE +#include + #include #include #include diff --git a/include/atalk/Makefile.am b/include/atalk/Makefile.am index 6058e6ec75..3c1feda3c8 100644 --- a/include/atalk/Makefile.am +++ b/include/atalk/Makefile.am @@ -8,4 +8,4 @@ atalkinclude_HEADERS = \ 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 diff --git a/include/atalk/adouble.h b/include/atalk/adouble.h index 278dd4ba26..78a35b0290 100644 --- a/include/atalk/adouble.h +++ b/include/atalk/adouble.h @@ -34,32 +34,7 @@ #include #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 #include #include diff --git a/include/atalk/paths.h b/include/atalk/paths.h index f4efd5f981..98eb44b068 100644 --- a/include/atalk/paths.h +++ b/include/atalk/paths.h @@ -16,7 +16,7 @@ /* 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 @@ -51,7 +51,7 @@ */ #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") @@ -61,7 +61,7 @@ * 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") @@ -72,7 +72,7 @@ */ #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") @@ -81,7 +81,7 @@ /* * 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") diff --git a/libatalk/util/socket.c b/libatalk/util/socket.c index c80a023d76..88101020f1 100644 --- a/libatalk/util/socket.c +++ b/libatalk/util/socket.c @@ -21,17 +21,8 @@ #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 + #include #include #include