[Box Backup-commit] COMMIT r1998 - in box/trunk: . lib/common
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sat Dec 15 17:02:58 GMT 2007
Author: chris
Date: 2007-12-15 17:02:55 +0000 (Sat, 15 Dec 2007)
New Revision: 1998
Modified:
box/trunk/configure.ac
box/trunk/lib/common/BoxPlatform.h
Log:
Fix definition of dirfd(x) macro (autoconf doesn't like defining macros
with parameters).
Modified: box/trunk/configure.ac
===================================================================
--- box/trunk/configure.ac 2007-12-15 00:09:27 UTC (rev 1997)
+++ box/trunk/configure.ac 2007-12-15 17:02:55 UTC (rev 1998)
@@ -165,13 +165,11 @@
AC_CHECK_DECLS([O_BINARY],,,)
AC_CHECK_DECLS([optreset],,, [[#include <getopt.h>]])
-AC_CHECK_DECL([dirfd],
- [],
- AC_DEFINE([dirfd(x)], [(x)->d_fd], [dirfd() replacement for Solaris]),
- [
+AC_CHECK_DECLS([dirfd],,,
+ [[
#include <getopt.h>
#include <dirent.h>
- ])
+ ]])
AC_HEADER_TIME
AC_STRUCT_TM
Modified: box/trunk/lib/common/BoxPlatform.h
===================================================================
--- box/trunk/lib/common/BoxPlatform.h 2007-12-15 00:09:27 UTC (rev 1997)
+++ box/trunk/lib/common/BoxPlatform.h 2007-12-15 17:02:55 UTC (rev 1998)
@@ -165,4 +165,12 @@
#include "emu.h"
#endif
+// Solaris has no dirfd(x) macro or function, and we need one.
+// We cannot define macros with arguments directly using AC_DEFINE,
+// so do it here instead of in configure.ac.
+
+#ifndef HAVE_DECL_DIRFD
+ #define dirfd(x) (x)->d_fd
+#endif
+
#endif // BOXPLATFORM__H
More information about the Boxbackup-commit
mailing list