diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/bbackupquery/makedocumentation.pl.in | 2 | ||||
-rw-r--r-- | lib/common/BoxPlatform.h | 10 | ||||
-rw-r--r-- | lib/common/Test.h | 16 | ||||
-rw-r--r-- | lib/common/Utils.cpp | 27 | ||||
-rw-r--r-- | lib/win32/emu.h | 4 |
5 files changed, 19 insertions, 40 deletions
diff --git a/lib/bbackupquery/makedocumentation.pl.in b/lib/bbackupquery/makedocumentation.pl.in index 1def0768..503ac9c8 100755 --- a/lib/bbackupquery/makedocumentation.pl.in +++ b/lib/bbackupquery/makedocumentation.pl.in @@ -3,7 +3,7 @@ use strict; print "Creating built-in documentation for bbackupquery...\n"; -open DOC,"Documentation.txt" or die "Can't open Documentation.txt file: $!"; +open DOC, "Documentation.txt" or die "Can't open Documentation.txt file: $!"; my $section; my %help; my @in_order; diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h index f8720587..f7c74bfc 100644 --- a/lib/common/BoxPlatform.h +++ b/lib/common/BoxPlatform.h @@ -21,11 +21,13 @@ #define PLATFORM_DEV_NULL "/dev/null" -#ifdef _MSC_VER -#include "BoxConfig-MSVC.h" -#define NEED_BOX_VERSION_H +#if defined BOX_CMAKE +# include "BoxConfig.cmake.h" +#elif defined _MSC_VER +# include "BoxConfig-MSVC.h" +# define NEED_BOX_VERSION_H #else -#include "BoxConfig.h" +# include "BoxConfig.h" #endif #ifdef WIN32 diff --git a/lib/common/Test.h b/lib/common/Test.h index 36cd6a59..4b5cef61 100644 --- a/lib/common/Test.h +++ b/lib/common/Test.h @@ -243,12 +243,14 @@ void safe_sleep(int seconds); std::auto_ptr<Configuration> load_config_file(const std::string& config_file, const ConfigurationVerify& verify); -#ifdef _MSC_VER - // Our CMakeFiles compile tests to different executable filenames, - // e.g. test_common.exe instead of _test.exe. - #define TEST_EXECUTABLE BOX_MODULE ".exe" -#else - #define TEST_EXECUTABLE "./_test" -#endif +#ifndef TEST_EXECUTABLE +# ifdef _MSC_VER + // Our CMakeFiles compile tests to different executable filenames, + // e.g. test_common.exe instead of _test.exe. + #define TEST_EXECUTABLE BOX_MODULE ".exe" +# else + #define TEST_EXECUTABLE "./_test" +# endif +#endif // TEST_EXECUTABLE #endif // TEST__H diff --git a/lib/common/Utils.cpp b/lib/common/Utils.cpp index 4325dd88..0915f29a 100644 --- a/lib/common/Utils.cpp +++ b/lib/common/Utils.cpp @@ -381,30 +381,3 @@ std::string FormatUsageLineStart(const std::string& rName, return result.str(); } -std::string BoxGetTemporaryDirectoryName() -{ -#ifdef WIN32 - // http://msdn.microsoft.com/library/default.asp? - // url=/library/en-us/fileio/fs/creating_and_using_a_temporary_file.asp - - DWORD dwRetVal; - char lpPathBuffer[1024]; - DWORD dwBufSize = sizeof(lpPathBuffer); - - // Get the temp path. - dwRetVal = GetTempPath(dwBufSize, // length of the buffer - lpPathBuffer); // buffer for path - if (dwRetVal > dwBufSize) - { - THROW_EXCEPTION(CommonException, TempDirPathTooLong) - } - - return std::string(lpPathBuffer); -#elif defined TEMP_DIRECTORY_NAME - return std::string(TEMP_DIRECTORY_NAME); -#else - #error non-static temporary directory names not supported yet -#endif -} - - diff --git a/lib/win32/emu.h b/lib/win32/emu.h index d0b7081b..91793004 100644 --- a/lib/win32/emu.h +++ b/lib/win32/emu.h @@ -18,7 +18,9 @@ #define EMU_INCLUDE // Need feature detection macros below -#ifdef _MSC_VER +#if defined BOX_CMAKE +# include "../common/BoxConfig.cmake.h" +#elif defined _MSC_VER # include "../common/BoxConfig-MSVC.h" # define NEED_BOX_VERSION_H #else |