diff --git a/src/common b/src/common index bb5b62d92df..9f6f0d41417 100644 --- a/src/common +++ b/src/common @@ -105,10 +105,10 @@ else ifeq ($(BUILD_ENV_),Cygwin) CP_CXXFLAGS += -MMD -MP -std=c++11 -U__STRICT_ANSI__ # Cygwin-g++ has problems with statically linking exception code. # If linking fails, remove -static. - LINKFLAGS = -static -std=c++11 + LINKFLAGS = -std=c++11 LINKLIB = ar rcT $@ $^ - LINKBIN = $(CXX) $(LINKFLAGS) -o $@ -Wl,--start-group $^ -Wl,--end-group $(LIBS) - LINKNATIVE = $(HOSTCXX) -std=c++11 -o $@ $^ -static + LINKBIN = $(CXX) $(LINKFLAGS) -o $@ -Wl,--start-group $^ -Wl,--end-group -limagehlp $(LIBS) + LINKNATIVE = $(HOSTCXX) -std=c++11 -o $@ $^ ifeq ($(origin CC),default) #CC = gcc CC = x86_64-w64-mingw32-gcc diff --git a/src/util/invariant.cpp b/src/util/invariant.cpp index 7007711dd5a..9f32a8fea8e 100644 --- a/src/util/invariant.cpp +++ b/src/util/invariant.cpp @@ -22,6 +22,7 @@ Author: Martin Brain, martin.brain@diffblue.com // clang-format off #include #include +#include // clang-format on #endif @@ -117,9 +118,9 @@ void print_backtrace( // for the rationale behind the size of 'symbol' const auto max_name_len = 255; auto symbol = static_cast( - calloc(sizeof SYMBOL_INFO + (max_name_len - 1) * sizeof(TCHAR), 1)); + calloc(sizeof(SYMBOL_INFO) + (max_name_len - 1) * sizeof(TCHAR), 1)); symbol->MaxNameLen = max_name_len; - symbol->SizeOfStruct = sizeof SYMBOL_INFO; + symbol->SizeOfStruct = sizeof(SYMBOL_INFO); for(std::size_t i = 0; i < number_of_frames; i++) { diff --git a/src/util/run.cpp b/src/util/run.cpp index 922265c08ae..5549e7a970d 100644 --- a/src/util/run.cpp +++ b/src/util/run.cpp @@ -448,43 +448,10 @@ int run( #endif } +#ifndef _WIN32 /// quote a string for bash and CMD static std::string shell_quote(const std::string &src) { - #ifdef _WIN32 - // first check if quoting is needed at all - - if(src.find(' ')==std::string::npos && - src.find('"')==std::string::npos && - src.find('&')==std::string::npos && - src.find('|')==std::string::npos && - src.find('(')==std::string::npos && - src.find(')')==std::string::npos && - src.find('<')==std::string::npos && - src.find('>')==std::string::npos && - src.find('^')==std::string::npos) - { - // seems fine -- return as is - return src; - } - - std::string result; - - result+='"'; - - for(const char ch : src) - { - if(ch=='"') - result+='"'; // quotes are doubled - result+=ch; - } - - result+='"'; - - return result; - - #else - // first check if quoting is needed at all if(src.find(' ')==std::string::npos && @@ -519,8 +486,8 @@ static std::string shell_quote(const std::string &src) result+='\''; return result; - #endif } +#endif int run( const std::string &what,