From f478b1d40b6329b43ea88ab3a10c82e3ca5c4ae6 Mon Sep 17 00:00:00 2001 From: Stephen Hutchinson Date: Sun, 14 Nov 2021 00:12:14 -0500 Subject: [PATCH] Clean up NEW_AVSVALUE defines NEW_AVSVALUE has been unconditionally enabled on all platforms for some time now, so just treat it as normal code. A few comments still refer to the value, but as other comments explicitly state what NEW_AVSVALUE was for originally, that context is probably enough. --- avs_core/core/FilterConstructor.cpp | 7 ---- avs_core/core/FilterGraph.cpp | 9 ----- avs_core/core/PluginManager.cpp | 8 ----- avs_core/core/avisynth.cpp | 15 -------- avs_core/core/avisynth_c.cpp | 7 +--- avs_core/core/interface.cpp | 36 ------------------- avs_core/core/parser/expression.h | 4 --- avs_core/core/parser/script.cpp | 5 --- avs_core/core/parser/script.h | 2 -- avs_core/core/parser/scriptparser.cpp | 10 ------ avs_core/filters/conditional/conditional.cpp | 2 -- .../conditional/conditional_functions.cpp | 7 +--- .../conditional/conditional_functions.h | 3 -- .../intel/conditional_functions_sse.cpp | 4 --- avs_core/filters/source.cpp | 5 +-- avs_core/include/avisynth.h | 2 -- avs_core/include/avs/config.h | 6 ---- 17 files changed, 3 insertions(+), 129 deletions(-) diff --git a/avs_core/core/FilterConstructor.cpp b/avs_core/core/FilterConstructor.cpp index b4dcc8139d..cea8ac54ff 100644 --- a/avs_core/core/FilterConstructor.cpp +++ b/avs_core/core/FilterConstructor.cpp @@ -8,16 +8,11 @@ FilterConstructor::FilterConstructor(IScriptEnvironment2 * env, IScriptEnvironme #if 1 ArgStorage(std::move(*argStorage)), CtorArgs(std::move(*ctorArgs)) -#else -#ifndef NEW_AVSVALUE - ArgStorage(std::move(*argStorage)), - CtorArgs(std::move(*ctorArgs)) #else // no need to move, subarrays could not be returned ArgStorage(*argStorage), CtorArgs(*ctorArgs) #endif -#endif { } @@ -30,7 +25,6 @@ AVSValue FilterConstructor::InstantiateFilter() const AVSValue retval = Func->apply(funcArgs, Func->user_data, Func->isAvs25 ? (IScriptEnvironment *)Env25 : Env); // pass back proper ScriptEnvironment, because a 2.5 plugin e.g. GRunT can back-Invoke ScriptClip -#ifdef NEW_AVSVALUE if (Func->isAvs25) { // After instantiate a v2.5 "baked code" filter @@ -61,6 +55,5 @@ AVSValue FilterConstructor::InstantiateFilter() const // e.g. VirtualDub consecutively press "script reload"s. Memory will leak even 50-80Mbytes so after a while // memory gets full. } -#endif return retval; } diff --git a/avs_core/core/FilterGraph.cpp b/avs_core/core/FilterGraph.cpp index 66d22f463c..08deb0c09f 100644 --- a/avs_core/core/FilterGraph.cpp +++ b/avs_core/core/FilterGraph.cpp @@ -19,7 +19,6 @@ static AVSValue DeepCopyValue(std::vector>& arrays, const AVSValue& src) { if (src.IsArray()) { -#ifdef NEW_AVSVALUE AVSValue* copy = new AVSValue[src.ArraySize()]; for (int i = 0; i < src.ArraySize(); ++i) { copy[i] = src[i]; // NEW_AVSVALUE is already doing deep copy @@ -27,14 +26,6 @@ static AVSValue DeepCopyValue(std::vector>& arrays, } arrays.emplace_back(std::unique_ptr(copy)); return AVSValue(copy, src.ArraySize()); -#else - AVSValue* copy = new AVSValue[src.ArraySize()]; - for (int i = 0; i < src.ArraySize(); ++i) { - copy[i] = DeepCopyValue(arrays, src[i]); - } - arrays.emplace_back(std::unique_ptr(copy)); - return AVSValue(copy, src.ArraySize()); -#endif } return src; } diff --git a/avs_core/core/PluginManager.cpp b/avs_core/core/PluginManager.cpp index ee133ef165..9e1beb8c28 100644 --- a/avs_core/core/PluginManager.cpp +++ b/avs_core/core/PluginManager.cpp @@ -120,9 +120,7 @@ static bool IsParameterTypeSpecifier(char c) { switch (c) { case 'b': case 'i': case 'f': case 's': case 'c': case '.': case 'n': -#ifdef NEW_AVSVALUE case 'a': // Arrays as function parameters -#endif return true; default: return false; @@ -293,9 +291,7 @@ bool AVSFunction::SingleTypeMatch(char type, const AVSValue& arg, bool strict) { case 's': return arg.IsString(); case 'c': return arg.IsClip(); case 'n': return arg.IsFunction(); -#ifdef NEW_AVSVALUE case 'a': return arg.IsArray(); // PF 161028 AVS+ script arrays -#endif default: return false; } } @@ -366,7 +362,6 @@ bool AVSFunction::TypeMatch(const char* param_types, const AVSValue* args, size_ switch (*param_types) { case 'b': case 'i': case 'f': case 's': case 'c': case 'n': -#ifdef NEW_AVSVALUE case 'a': // PF 2016: 'a' is special letter for script arrays, but if possible we are using .* and .+ (legacy Avisynth style) instead // Note (2021): 'a' is still not used @@ -374,7 +369,6 @@ bool AVSFunction::TypeMatch(const char* param_types, const AVSValue* args, size_ // no type check (array of int) // cannot be used in plugins which are intended to work for Avisynth 2.6 Classic. ("a" is invalid in function signature -> plugin load error) // pros: clean syntax, accept _only_ arrays when required, no comma-delimited-list-to-array option (like in old Avisynth syntax) -#endif // array arguments are not necessarily "flattened" when TypeMatch is called. if (param_types[1] == '+' // parameter indicates an array-type args[i] && args[i].IsArray() // allow single e.g. 'c' parameter in place of a 'c+' requirement @@ -401,7 +395,6 @@ bool AVSFunction::TypeMatch(const char* param_types, const AVSValue* args, size_ ++i; break; case '+': case '*': -#ifdef NEW_AVSVALUE // check array content type if required if (args[i].IsArray() && param_types[-1] != '.') { // A script can provide an array argument in an direct array-type variable. @@ -416,7 +409,6 @@ bool AVSFunction::TypeMatch(const char* param_types, const AVSValue* args, size_ ++i; } else -#endif // Legacy Avisynth array check. // Array of arguments of known types last until an argument of another type is found. // This is the reason why an .+ or .* (array of anything) must only appear at the end diff --git a/avs_core/core/avisynth.cpp b/avs_core/core/avisynth.cpp index 5c77f61cbd..c09207d18c 100644 --- a/avs_core/core/avisynth.cpp +++ b/avs_core/core/avisynth.cpp @@ -1602,9 +1602,6 @@ class ThreadScriptEnvironment : public InternalEnvironment AVSValue __stdcall Invoke25(const char* name, const AVSValue args, const char* const* arg_names) { -#ifndef NEW_AVSVALUE - return Invoke(name, args, arg_names); -#else AVSValue result; // MarkArrayAsC: signing for destructor: don't free array elements. // Reason: CPP 2.5 plugins have "baked code" in their avisynth.h and do not know @@ -1621,7 +1618,6 @@ class ThreadScriptEnvironment : public InternalEnvironment throw NotFound(); return result; -#endif } @@ -4018,9 +4014,7 @@ bool ScriptEnvironment::PlanarChromaAlignment(IScriptEnvironment::PlanarChromaAl static size_t Flatten(const AVSValue& src, AVSValue* dst, size_t index, int level, const char* const* arg_names = NULL) { // level is starting from zero if (src.IsArray() -#ifdef NEW_AVSVALUE && level == 0 -#endif ) { // flatten for the first arg level const int array_size = src.ArraySize(); for (int i=0; iIsArray()) { // signing for destructor: don't free array elements ((AVSValue*)&v)->MarkArrayAsC(); } -#endif + ((AVSValue*)&v)->~AVSValue(); } diff --git a/avs_core/core/interface.cpp b/avs_core/core/interface.cpp index bcedaa06d5..6689e06ac9 100644 --- a/avs_core/core/interface.cpp +++ b/avs_core/core/interface.cpp @@ -725,9 +725,6 @@ void AVSValue::CONSTRUCTOR8(const AVSValue* a, int size) { type = 'a'; array_size = (short)size; -#ifndef NEW_AVSVALUE - array = a; -#else if (a == nullptr || size == 0) { array = nullptr; } @@ -737,30 +734,17 @@ void AVSValue::CONSTRUCTOR8(const AVSValue* a, int size) const_cast(array)[i].Assign(&a[i], true); // init from source } } -#endif } AVSValue::AVSValue(const AVSValue& v) { CONSTRUCTOR9(v); } void AVSValue::CONSTRUCTOR9(const AVSValue& v) { Assign(&v, true); } -#ifdef NEW_AVSVALUE AVSValue::AVSValue(const AVSValue& v, bool c_arrays) { CONSTRUCTOR10(v, c_arrays); } void AVSValue::CONSTRUCTOR10(const AVSValue& v, bool c_arrays) { Assign2(&v, true, c_arrays); } -#endif AVSValue::AVSValue(const PFunction& n) { CONSTRUCTOR11(n); } void AVSValue::CONSTRUCTOR11(const PFunction& n) { type = 'n'; array_size = 0; function = n.GetPointerWithAddRef(); } -#ifndef NEW_AVSVALUE -AVSValue::~AVSValue() { DESTRUCTOR(); } -void AVSValue::DESTRUCTOR() -{ - if (IsClip() && clip) - clip->Release(); - if (IsFunction() && function) - function->Release(); -} -#else AVSValue::~AVSValue() { DESTRUCTOR(); } void AVSValue::DESTRUCTOR() { @@ -782,8 +766,6 @@ void AVSValue::MarkArrayAsC() array_size = -array_size; } -#endif - AVSValue& AVSValue::operator=(const AVSValue& v) { return OPERATOR_ASSIGN(v); } AVSValue& AVSValue::OPERATOR_ASSIGN(const AVSValue& v) { Assign(&v, false); return *this; } @@ -848,23 +830,6 @@ const AVSValue& AVSValue::OPERATOR_INDEX(int index) const { return (IsArray() && index>=0 && indexIsClip() && src->clip) - src->clip->AddRef(); - if (!init && IsClip() && clip) - clip->Release(); - - if (src->IsFunction() && src->function) - src->function->AddRef(); - if (!init && IsFunction() && function) - function->Release(); - - this->type = src->type; - this->array_size = src->array_size; - this->clip = src->clip; // "clip" is the largest member of the union, making sure we copy everything -} -#else // this Assign copies array elements for new AVSVALUE handling // For C interface, we use Assign2 through CONSTRUCTOR10 void AVSValue::Assign(const AVSValue* src, bool init) { @@ -943,7 +908,6 @@ void AVSValue::Assign2(const AVSValue* src, bool init, bool c_arrays) { if (shouldReleaseFunction) ((IFunction *)prev_pointer_to_release)->Release(); } -#endif // end class AVSValue diff --git a/avs_core/core/parser/expression.h b/avs_core/core/parser/expression.h index b6d98e204a..3f72615268 100644 --- a/avs_core/core/parser/expression.h +++ b/avs_core/core/parser/expression.h @@ -38,9 +38,7 @@ #include #include "../function.h" -#ifdef NEW_AVSVALUE #include -#endif #include /******************************************************************** @@ -109,9 +107,7 @@ class ExpRootBlock : public Expression class ExpConstant : public Expression { public: -#ifdef NEW_AVSVALUE ExpConstant(std::vector* v) : val(v->data(), (int)(v->size())) {} // array of AVSValue* -#endif ExpConstant(AVSValue v) : val(v) {} ExpConstant(int i) : val(i) {} ExpConstant(float f) : val(f) {} diff --git a/avs_core/core/parser/script.cpp b/avs_core/core/parser/script.cpp index cd670050dd..2d3c6b47d8 100644 --- a/avs_core/core/parser/script.cpp +++ b/avs_core/core/parser/script.cpp @@ -299,7 +299,6 @@ extern const AVSFunction Script_functions[] = { { "VarExist", BUILTIN_FUNC_PREFIX, "s", VarExist }, // 180606- -#ifdef NEW_AVSVALUE // Creates script array from zero or more anything. // Direct array constant syntax e.g. x = [arg1,arg2,...] is translated to x = Array(arg1,arg2,...) { "Array", BUILTIN_FUNC_PREFIX, ".*", ArrayCreate }, @@ -316,7 +315,6 @@ extern const AVSFunction Script_functions[] = { /* { "IsArrayOf", BUILTIN_FUNC_PREFIX, ".s", IsArrayOf }, */ -#endif { 0 } }; @@ -2163,8 +2161,6 @@ AVSValue VarExist(AVSValue args, void*, IScriptEnvironment* env) } -#ifdef NEW_AVSVALUE - AVSValue ArrayCreate(AVSValue args, void*, IScriptEnvironment* env) { return args[0]; @@ -2286,4 +2282,3 @@ AVSValue ArrayDel(AVSValue args, void*, IScriptEnvironment* env) return AVSValue(new_val.data(), orig_size - 1); } -#endif diff --git a/avs_core/core/parser/script.h b/avs_core/core/parser/script.h index 2fe3f9c35c..21227ff591 100644 --- a/avs_core/core/parser/script.h +++ b/avs_core/core/parser/script.h @@ -287,13 +287,11 @@ AVSValue IsFloatUvZeroBased(AVSValue args, void*, IScriptEnvironment* env); // a AVSValue BuildPixelType(AVSValue args, void*, IScriptEnvironment* env); // avs+ 180517 AVSValue VarExist(AVSValue args, void*, IScriptEnvironment* env); // avs+ 180606 -#ifdef NEW_AVSVALUE AVSValue ArrayCreate(AVSValue args, void*, IScriptEnvironment* env); AVSValue IsArray(AVSValue args, void*, IScriptEnvironment* env); AVSValue ArrayGet(AVSValue args, void*, IScriptEnvironment* env); AVSValue ArraySize(AVSValue args, void*, IScriptEnvironment* env); AVSValue ArrayIns(AVSValue args, void*, IScriptEnvironment* env); AVSValue ArrayDel(AVSValue args, void*, IScriptEnvironment* env); -#endif #endif // __Script_H__ diff --git a/avs_core/core/parser/scriptparser.cpp b/avs_core/core/parser/scriptparser.cpp index 66de1ef52a..c66a018acf 100644 --- a/avs_core/core/parser/scriptparser.cpp +++ b/avs_core/core/parser/scriptparser.cpp @@ -161,7 +161,6 @@ PExpression ScriptParser::ParseFunctionDefinition(void) else if (tokenizer.IsIdentifier("string")) type = 's'; else if (tokenizer.IsIdentifier("clip")) type = 'c'; else if (tokenizer.IsIdentifier("func")) type = 'n'; -#ifdef NEW_AVSVALUE // AVS+ 161028 array type in user defined functions else if (tokenizer.IsIdentifier("array") || tokenizer.IsIdentifier("val_array")) { array_kind = '*'; type = '.'; @@ -207,7 +206,6 @@ PExpression ScriptParser::ParseFunctionDefinition(void) else if (tokenizer.IsIdentifier("func_array_nz")) { array_kind = '+'; type = 'n'; } -#endif else env->ThrowError("Script error: expected \"val\", \"bool\", \"int\", \"float\", \"string\", \"array\", or \"clip\" (or their \"_array\" or \"_array_nz\" versions"); tokenizer.NextToken(); } @@ -661,13 +659,6 @@ PExpression ScriptParser::ParseUnary(void) { PExpression ScriptParser::ParseOOP(void) { -#ifndef NEW_AVSVALUE - PExpression left = ParseFunction(nullptr); - while (tokenizer.IsOperator('.')) { - tokenizer.NextToken(); - left = ParseFunction(left); - } -#else // check if need convert [] brackets to function calls: Array() and ArrayGet() // no context and [: e.g. x = [23,2] --> x = Array(23,2) PExpression left; @@ -687,7 +678,6 @@ PExpression ScriptParser::ParseOOP(void) else left = ParseFunction(left); } -#endif return left; } diff --git a/avs_core/filters/conditional/conditional.cpp b/avs_core/filters/conditional/conditional.cpp index dfb10afead..273f954ffa 100644 --- a/avs_core/filters/conditional/conditional.cpp +++ b/avs_core/filters/conditional/conditional.cpp @@ -84,9 +84,7 @@ extern const AVSFunction Conditional_filters[] = { { "propSet", BUILTIN_FUNC_PREFIX, "csi[mode]i", SetProperty::Create, (void*)10 }, { "propSet", BUILTIN_FUNC_PREFIX, "csf[mode]i", SetProperty::Create, (void*)11 }, { "propSet", BUILTIN_FUNC_PREFIX, "css[mode]i", SetProperty::Create, (void*)12 }, -#ifdef NEW_AVSVALUE { "propSet", BUILTIN_FUNC_PREFIX, "csa", SetProperty::Create, (void*)13 }, // no mode parameter, full entry refresh -#endif { "propSet", BUILTIN_FUNC_PREFIX, "csc[mode]i", SetProperty::Create, (void*)14 }, { "propDelete", BUILTIN_FUNC_PREFIX, "cs", DeleteProperty::Create }, diff --git a/avs_core/filters/conditional/conditional_functions.cpp b/avs_core/filters/conditional/conditional_functions.cpp index 3814f79dc7..226787045c 100644 --- a/avs_core/filters/conditional/conditional_functions.cpp +++ b/avs_core/filters/conditional/conditional_functions.cpp @@ -135,10 +135,8 @@ extern const AVSFunction Conditional_funtions_filters[] = { { "propNumKeys", BUILTIN_FUNC_PREFIX, "c[offset]i", GetPropertyNumKeys::Create}, { "propGetKeyByIndex", BUILTIN_FUNC_PREFIX, "c[index]i[offset]i", GetPropertyKeyByIndex::Create}, { "propGetType", BUILTIN_FUNC_PREFIX, "cs[offset]i", GetPropertyType::Create}, -#ifdef NEW_AVSVALUE { "propGetAsArray", BUILTIN_FUNC_PREFIX, "cs[offset]i", GetPropertyAsArray::Create}, { "propGetAll", BUILTIN_FUNC_PREFIX, "c[offset]i", GetAllProperties::Create}, -#endif { 0 } }; @@ -969,7 +967,6 @@ AVSValue GetProperty::Create(AVSValue args, void* user_data, IScriptEnvironment* return AVSValue(); } -#ifdef NEW_AVSVALUE AVSValue GetPropertyAsArray::Create(AVSValue args, void* , IScriptEnvironment* env) { AVSValue clip = args[0]; @@ -1147,14 +1144,12 @@ AVSValue GetAllProperties::Create(AVSValue args, void*, IScriptEnvironment* env) } pair[1] = elem; - result[index] = AVSValue(pair.data(), 2); // NEW_AVSVALUE: arrays in arrays, automatic deep copy + result[index] = AVSValue(pair.data(), 2); // arrays in arrays, automatic deep copy } return AVSValue(result.data(), propNum); // array deep copy } -#endif - // e.g. string length AVSValue GetPropertyDataSize::Create(AVSValue args, void* , IScriptEnvironment* env) { AVSValue clip = args[0]; diff --git a/avs_core/filters/conditional/conditional_functions.h b/avs_core/filters/conditional/conditional_functions.h index c28cf527ea..5018600152 100644 --- a/avs_core/filters/conditional/conditional_functions.h +++ b/avs_core/filters/conditional/conditional_functions.h @@ -77,7 +77,6 @@ class GetProperty { static AVSValue Create(AVSValue args, void* user_data, IScriptEnvironment* env); }; -#ifdef NEW_AVSVALUE class GetPropertyAsArray { public: static AVSValue Create(AVSValue args, void* user_data, IScriptEnvironment* env); @@ -88,8 +87,6 @@ class GetAllProperties { static AVSValue Create(AVSValue args, void* user_data, IScriptEnvironment* env); }; -#endif - class GetPropertyDataSize { public: static AVSValue Create(AVSValue args, void* , IScriptEnvironment* env); diff --git a/avs_core/filters/conditional/intel/conditional_functions_sse.cpp b/avs_core/filters/conditional/intel/conditional_functions_sse.cpp index 4e4a48b1e6..4b73abec08 100644 --- a/avs_core/filters/conditional/intel/conditional_functions_sse.cpp +++ b/avs_core/filters/conditional/intel/conditional_functions_sse.cpp @@ -144,7 +144,3 @@ size_t get_sad_rgb_isse(const uint8_t* src_ptr, const uint8_t* other_ptr, size_t #endif - - - - diff --git a/avs_core/filters/source.cpp b/avs_core/filters/source.cpp index cdebbbb90b..db414e4ba3 100644 --- a/avs_core/filters/source.cpp +++ b/avs_core/filters/source.cpp @@ -455,7 +455,7 @@ static AVSValue __cdecl Create_BlankClip(AVSValue args, void*, IScriptEnvironmen int colors[4] = { 0 }; float colors_f[4] = { 0.0 }; bool color_is_array = false; -#ifdef NEW_AVSVALUE + if (args.ArraySize() >= 14) { // new colors parameter if (args[13].Defined()) // colors @@ -481,7 +481,6 @@ static AVSValue __cdecl Create_BlankClip(AVSValue args, void*, IScriptEnvironmen color_is_array = true; } } -#endif PClip clip = new StaticImage(vi, CreateBlankFrame(vi, color, mode, colors, colors_f, color_is_array, env), parity); @@ -2163,10 +2162,8 @@ extern const AVSFunction Source_filters[] = { #endif { "BlankClip", BUILTIN_FUNC_PREFIX, "[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[stereo]b[sixteen_bit]b[color]i[color_yuv]i[clip]c", Create_BlankClip }, { "BlankClip", BUILTIN_FUNC_PREFIX, "[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[channels]i[sample_type]s[color]i[color_yuv]i[clip]c", Create_BlankClip }, -#ifdef NEW_AVSVALUE { "BlankClip", BUILTIN_FUNC_PREFIX, "[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[stereo]b[sixteen_bit]b[color]i[color_yuv]i[clip]c[colors]f+", Create_BlankClip }, { "BlankClip", BUILTIN_FUNC_PREFIX, "[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[channels]i[sample_type]s[color]i[color_yuv]i[clip]c[colors]f+", Create_BlankClip }, -#endif { "Blackness", BUILTIN_FUNC_PREFIX, "[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[stereo]b[sixteen_bit]b[color]i[color_yuv]i[clip]c", Create_BlankClip }, { "Blackness", BUILTIN_FUNC_PREFIX, "[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[channels]i[sample_type]s[color]i[color_yuv]i[clip]c", Create_BlankClip }, { "MessageClip", BUILTIN_FUNC_PREFIX, "s[width]i[height]i[shrink]b[text_color]i[halo_color]i[bg_color]i", Create_MessageClip }, diff --git a/avs_core/include/avisynth.h b/avs_core/include/avisynth.h index 53d509f8e8..431f4a00ef 100644 --- a/avs_core/include/avisynth.h +++ b/avs_core/include/avisynth.h @@ -1277,12 +1277,10 @@ class AVSValue { double AsFloat2(float def) const; const char* AsString2(const char* def) const; -#ifdef NEW_AVSVALUE void MarkArrayAsC(); // for C interface, no deep-copy and deep-free void CONSTRUCTOR10(const AVSValue& v, bool c_arrays); AVSValue(const AVSValue& v, bool c_arrays); void Assign2(const AVSValue* src, bool init, bool c_arrays); -#endif #endif }; // end class AVSValue diff --git a/avs_core/include/avs/config.h b/avs_core/include/avs/config.h index bcf5b8c09e..6484cb08f2 100644 --- a/avs_core/include/avs/config.h +++ b/avs_core/include/avs/config.h @@ -148,12 +148,6 @@ #endif -#if defined(AVS_POSIX) -#define NEW_AVSVALUE -#else -#define NEW_AVSVALUE -#endif - #if defined(AVS_WINDOWS) && defined(_USING_V110_SDK71_) // Windows XP does not have proper initialization for // thread local variables.