]> git.lyx.org Git - lyx.git/commitdiff
Detect mode_t for safe use of chmod, and for scons/msvc
authorBo Peng <bpeng@lyx.org>
Sun, 19 Nov 2006 13:58:39 +0000 (13:58 +0000)
committerBo Peng <bpeng@lyx.org>
Sun, 19 Nov 2006 13:58:39 +0000 (13:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15985 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/SConstruct
src/support/copy.C

index bd13109e53832790c1913ecae996803054ae2f60..6d7ea195780e433790b16b7bd2f6e13009922ab3 100644 (file)
@@ -1018,6 +1018,7 @@ return std::count(a, a+5, 'l');
         ('std::istreambuf_iterator<std::istream>', 'HAVE_DECL_ISTREAMBUF_ITERATOR',
             '#include <streambuf>\n#include <istream>'),
         ('wchar_t', 'HAVE_WCHAR_T', None),
+        ('mode_t', 'HAVE_MODE_T', "#include <sys/types.h>"),
     ],
     libs = [
         ('gdi32', 'HAVE_LIBGDI32'),
index ceb2db196800006519a88b3be374f39fa484eae9..3b6d328bd7e7a491ed7be39404a5c45bc6a8a2a4 100644 (file)
@@ -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