diff options
author | Bernard Normier <bernard@zeroc.com> | 2008-02-23 10:47:35 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2008-02-23 10:47:35 -0500 |
commit | b8879524bd3a0067d4b09bcf71a8f7f7a28932b7 (patch) | |
tree | a86b2ae1fb4ddf0e24fd61d52986314dbfd801ff /cpp/src/Slice/Preprocessor.cpp | |
parent | IceBox & TestUtil.py Win32 fix (diff) | |
download | ice-b8879524bd3a0067d4b09bcf71a8f7f7a28932b7.tar.bz2 ice-b8879524bd3a0067d4b09bcf71a8f7f7a28932b7.tar.xz ice-b8879524bd3a0067d4b09bcf71a8f7f7a28932b7.zip |
Fixed GCC 4.3 build failures
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rwxr-xr-x | cpp/src/Slice/Preprocessor.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index 869dc5ca760..2a26aa026af 100755 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -18,6 +18,7 @@ #include <fstream> #include <sys/types.h> #include <sys/stat.h> +#include <cstring> #ifndef _WIN32 # include <sys/wait.h> @@ -113,7 +114,7 @@ Slice::Preprocessor::normalizeIncludePath(const string& path) result.replace(pos, 2, "/"); } - if(result == "/" || result.size() == 3 && isalpha(result[0]) && result[1] == ':' && result[2] == '/') + if(result == "/" || (result.size() == 3 && isalpha(result[0]) && result[1] == ':' && result[2] == '/')) { return result; } @@ -144,11 +145,11 @@ Slice::Preprocessor::preprocess(bool keepComments) } args.push_back(_fileName); - char** argv = new char*[args.size() + 1]; + const char** argv = new const char*[args.size() + 1]; argv[0] = "mcpp"; for(unsigned int i = 0; i < args.size(); ++i) { - argv[i + 1] = (char*) args[i].c_str(); + argv[i + 1] = args[i].c_str(); } // @@ -166,7 +167,7 @@ Slice::Preprocessor::preprocess(bool keepComments) // Call mcpp using memory buffer. // mcpp_use_mem_buffers(1); - mcpp_lib_main(static_cast<int>(args.size()) + 1, argv); + mcpp_lib_main(static_cast<int>(args.size()) + 1, const_cast<char**>(argv)); delete[] argv; // @@ -226,17 +227,17 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin args.push_back("-M"); args.push_back(_fileName); - char** argv = new char*[args.size() + 1]; + const char** argv = new const char*[args.size() + 1]; for(unsigned int i = 0; i < args.size(); ++i) { - argv[i + 1] = (char*) args[i].c_str(); + argv[i + 1] = args[i].c_str(); } // // Call mcpp using memory buffer. // mcpp_use_mem_buffers(1); - mcpp_lib_main(static_cast<int>(args.size() + 1), argv); + mcpp_lib_main(static_cast<int>(args.size() + 1), const_cast<char**>(argv)); delete[] argv; // |