From: Bo Peng Date: Sun, 19 Nov 2006 13:58:39 +0000 (+0000) Subject: Detect mode_t for safe use of chmod, and for scons/msvc X-Git-Tag: 1.6.10~11820 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c8429d4bbc2e9291a6b5742233aecb089a3eece1;p=lyx.git 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 --- diff --git a/development/scons/SConstruct b/development/scons/SConstruct index bd13109e53..6d7ea19578 100644 --- a/development/scons/SConstruct +++ b/development/scons/SConstruct @@ -1018,6 +1018,7 @@ return std::count(a, a+5, 'l'); ('std::istreambuf_iterator', 'HAVE_DECL_ISTREAMBUF_ITERATOR', '#include \n#include '), ('wchar_t', 'HAVE_WCHAR_T', None), + ('mode_t', 'HAVE_MODE_T', "#include "), ], libs = [ ('gdi32', 'HAVE_LIBGDI32'), diff --git a/src/support/copy.C b/src/support/copy.C index ceb2db1968..3b6d328bd7 100644 --- a/src/support/copy.C +++ b/src/support/copy.C @@ -33,7 +33,7 @@ using std::string; 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) return false; #else