Bug 817267 - dirfd() is a macro on some BSDs, fix build there. r=yoric

This commit is contained in:
Jan Beich 2012-12-01 21:25:24 -05:00
parent 49b3f0b8d9
commit 6cdae25103

View File

@ -41,6 +41,11 @@
#include "OSFileConstants.h"
#include "nsIOSFileConstantsService.h"
#if defined(__DragonFly__) || defined(__FreeBSD__) \
|| defined(__NetBSD__) || defined(__OpenBSD__)
#define __dd_fd dd_fd
#endif
/**
* This module defines the basic libc constants (error numbers, open modes,
* etc.) used by OS.File and possibly other OS-bound JavaScript libraries.
@ -383,8 +388,8 @@ static dom::ConstantSpec gLibcProperties[] =
{ "OSFILE_OFFSETOF_DIRENT_D_TYPE", INT_TO_JSVAL(offsetof (struct dirent, d_type)) },
#endif // defined(DT_UNKNOWN)
// Under MacOS X, |dirfd| is a macro rather than a function, so we
// need a little help to get it to work
// Under MacOS X and BSDs, |dirfd| is a macro rather than a
// function, so we need a little help to get it to work
#if defined(dirfd)
{ "OSFILE_SIZEOF_DIR", INT_TO_JSVAL(sizeof (DIR)) },