--- parser3/src/main/pa_common.C 2013/07/04 10:27:49 1.271 +++ parser3/src/main/pa_common.C 2013/07/23 07:51:30 1.274 @@ -36,7 +36,11 @@ #include "pcre.h" #include "pa_request.h" -volatile const char * IDENT_PA_COMMON_C="$Id: pa_common.C,v 1.271 2013/07/04 10:27:49 moko Exp $" IDENT_PA_COMMON_H IDENT_PA_HASH_H IDENT_PA_ARRAY_H IDENT_PA_STACK_H; +#ifdef _MSC_VER +#include +#endif + +volatile const char * IDENT_PA_COMMON_C="$Id: pa_common.C,v 1.274 2013/07/23 07:51:30 moko Exp $" IDENT_PA_COMMON_H IDENT_PA_HASH_H IDENT_PA_ARRAY_H IDENT_PA_STACK_H; // some maybe-undefined constants @@ -477,7 +481,7 @@ static void rmdir(const String& file_spe char* dir_spec=file_spec.taint_cstrm(String::L_FILE_SPEC); size_t length=strlen(dir_spec); while( (length=get_dir(dir_spec, length)) && (length > pos_after) ){ -#ifdef WIN32 +#ifdef _MSC_VER if(!entry_readable(dir_spec, true)) break; DWORD attrs=GetFileAttributes(dir_spec); @@ -634,7 +638,7 @@ enum FormatType { FormatUInt, FormatDouble }; -FormatType format_type(char* fmt){ +FormatType format_type(const char* fmt){ enum FormatState { Percent, Flags, @@ -645,7 +649,7 @@ FormatType format_type(char* fmt){ FormatType result=FormatInvalid; - char* pos=fmt; + const char* pos=fmt; while(char c=*(pos++)){ switch(state){ case Percent: @@ -689,7 +693,7 @@ FormatType format_type(char* fmt){ } -const char* format(double value, char* fmt) { +const char* format(double value, const char* fmt) { char local_buf[MAX_NUMBER]; int size=-1; @@ -839,14 +843,6 @@ void back_slashes_to_slashes(char* s) { if(*s=='\\') *s='/'; } -/* -void slashes_to_back_slashes(char* s) { - if(s) - for(; *s; s++) - if(*s=='/') - *s='\\'; -} -*/ #endif bool StrStartFromNC(const char* str, const char* substr, bool equal){ @@ -972,7 +968,7 @@ int __vsnprintf(char* b, size_t s, const if((ssize_t)s<0) return 0; -#if _MSC_VER +#ifdef _MSC_VER /* win32: mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2001APR\1033\vccore.chm::/html/_crt__vsnprintf.2c_._vsnwprintf.htm