]> arthur.barton.de Git - netatalk.git/commitdiff
Portability fixes
authorFrank Lahm <franklahm@googlemail.com>
Sun, 27 Feb 2011 09:28:52 +0000 (10:28 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Sun, 27 Feb 2011 09:28:52 +0000 (10:28 +0100)
libatalk/dsi/dsi_getsess.c
libatalk/util/socket.c

index f7b89c8e1cf3deee9e21402bcea3be109226cc35..747a880a6442c247299a0e7d85643c8106eff448 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif /* HAVE_UNISTD_H */
 #include <signal.h>
+#include <sys/types.h>
+#include <sys/socket.h>
 
 /* POSIX.1 sys/wait.h check */
 #include <sys/types.h>
index 0dfe1044249a2b21b07823d37c5d2b5e5ab54938..9edeb6c55c0cf34f380c121b77826a43d7c71972 100644 (file)
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600
+#endif
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__
+#endif
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
@@ -509,6 +518,11 @@ void fdset_del_fd(struct pollfd **fdsetp,
     }
 }
 
+/* Length of the space taken up by a padded control message of length len */
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
+#endif
+
 /*
  * Receive a fd on a suitable socket
  * @args fd          (r) PF_UNIX socket to receive on