   [bugfix attached] AS_USE_NAMESPACE causes build errors under linux
  tested with 2.6.13:-DAS_USE_NAMESPACE causes this under linux (x86):In file included from angelscript/source/as_array.h:37,  from angelscript/source/as_memory.h:78,  from angelscript/source/as_config.h:626,  from angelscript/source/as_callfunc_ppc.cpp:42:/usr/include/string.h:121: error: '__locale_t' has not been declared/usr/include/string.h:122: error: nonnull argument references non-pointer operand (argument 1, operand 3)/usr/include/string.h:125: error: '__locale_t' has not been declared/usr/include/string.h:125: error: nonnull argument references non-pointer operand (argument 1, operand 4)/usr/include/string.h:288: error: '__locale_t' has not been declared/usr/include/string.h:343: error: '__locale_t' has not been declared/usr/include/string.h:344: error: nonnull argument references non-pointer operand (argument 1, operand 3)/usr/include/string.h:347: error: '__locale_t' has not been declared/usr/include/string.h:348: error: nonnull argument references non-pointer operand (argument 1, operand 4)make[2]: *** [dependencies/angelscript/CMakeFiles/angelscript.dir/source/as_callfunc_ppc.cpp.o] Error 1make[1]: *** [dependencies/angelscript/CMakeFiles/angelscript.dir/all] Error 2make: *** [all] Error 2while it works perfectly under windows. When i remove the definition again, the build error disappears under linux.Any ideas what it could be? :-/edit: the as_config.h is the default version, no modifications.[Edited by - tdev on August 3, 2009 5:56:53 AM]
  fixed the problem by moving the namespace macro before string.h:--- /home/thomas/temp/sdk/angelscript/source/as_array.h2009-06-01 19:20:30.000000000 +0200+++ ./source/as_array.h2009-08-03 13:07:07.000000000 +0200@@ -31,6 +31,8 @@ #ifndef AS_ARRAY_H #define AS_ARRAY_H+BEGIN_AS_NAMESPACE+ #if !defined(AS_NO_MEMORY_H) #include <memory.h> #endif@@ -40,8 +42,6 @@ #pragma warning(disable:4345) // warning about a change in how the code is handled in this version #endif-BEGIN_AS_NAMESPACE- template <class T> class asCArray { public:and fixed another problem with scriptstring_utils.cpp missing the namespace macros:--- /home/thomas/temp/sdk/add_on/scriptstring/scriptstring_utils.cpp2009-05-09 12:02:26.000000000 +0200+++ ./add_on/scriptstring/scriptstring_utils.cpp2009-08-03 12:51:52.000000000 +0200@@ -2,7 +2,7 @@ #include "scriptstring.h" #include <string.h> // strstr-+BEGIN_AS_NAMESPACE // This function returns a string containing the substring of the input string // determined by the starting index and count of characters.@@ -329,7 +329,7 @@ void StringJoin_Generic(asIScriptGeneric //  int64    parseInt(const string &in str, int &out bytesParsed); //  double   parseDouble(const string &in str, int &out bytesParsed); //  string @ formatString(int64, const string &in format);  // should use sprintf to format the string-//  string @ formatDouble(double, const string &in format);+//  string @ formatDouble(double, const string &in format); // //  int16    byteStringToInt16(const string &in str, int start); //  int32    byteStringToInt32(const string &in str, int start);@@ -367,3 +367,5 @@ void RegisterScriptStringUtils(asIScriptr = engine->RegisterGlobalFunction("string@[]@ split(const string &in, const string &in)", asFUNCTION(StringSplit_Generic), asCALL_GENERIC); assert(r >= 0);r = engine->RegisterGlobalFunction("string@ join(const string@[] &in, const string &in)", asFUNCTION(StringJoin_Generic), asCALL_GENERIC); assert(r >= 0); }++END_AS_NAMESPACE;  Your solution of moving the BEGIN_AS_NAMESPACE in as_array.h before the include directives is not correct since it would change the namespace of all functions declared in the header. It's just by chance that it worked. Looking through the files, I could find only one possible cause for this problem. The as_criticalsection.h is including the pthread.h and windows.h headers within the AngelScript namespace. Try adding END_AS_NAMESPACE and BEGIN_AS_NAMESPACE around the includes so that they are outside the namespace, i.e:...END_AS_NAMESPACE#include <pthread.h>BEGIN_AS_NAMESPACE...END_AS_NAMESPACE#define WIN32_LEAN_AND_MEAN#include <windows.h>BEGIN_AS_NAMESPACE...