Detect mode_t for safe use of chmod, and for scons/msvc

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15985 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2006-11-19 13:58:39 +00:00
parent cac3941537
commit c8429d4bbc
2 changed files with 2 additions and 1 deletions

View File

@ -1018,6 +1018,7 @@ return std::count(a, a+5, 'l');
('std::istreambuf_iterator<std::istream>', 'HAVE_DECL_ISTREAMBUF_ITERATOR', ('std::istreambuf_iterator<std::istream>', 'HAVE_DECL_ISTREAMBUF_ITERATOR',
'#include <streambuf>\n#include <istream>'), '#include <streambuf>\n#include <istream>'),
('wchar_t', 'HAVE_WCHAR_T', None), ('wchar_t', 'HAVE_WCHAR_T', None),
('mode_t', 'HAVE_MODE_T', "#include <sys/types.h>"),
], ],
libs = [ libs = [
('gdi32', 'HAVE_LIBGDI32'), ('gdi32', 'HAVE_LIBGDI32'),

View File

@ -33,7 +33,7 @@ using std::string;
bool lyx::support::chmod(string const & file, unsigned long int mode) bool lyx::support::chmod(string const & file, unsigned long int mode)
{ {
#ifdef HAVE_CHMOD #if defined (HAVE_CHMOD) && defined (HAVE_MODE_T)
if (::chmod(file.c_str(), mode_t(mode)) != 0) if (::chmod(file.c_str(), mode_t(mode)) != 0)
return false; return false;
#else #else