# Linux ICC compatibility.

Don't disable PCH in AtlasUI for non-GCC builds.
Prevented some excessive warnings ("implicitly-signed bit field of
length 1").
Removed (wcs|str)nlen functions on OS_UNIX, since they were already
removed from the .h.

This was SVN commit r5125.
This commit is contained in:
Ykkrosh 2007-06-01 00:34:36 +00:00
parent d90975ee1e
commit 6b6b6198f9
5 changed files with 21 additions and 12 deletions

View File

@ -32,12 +32,14 @@ else
-- It's too late to do this test by the time we start compiling the PCH file, so
-- do the test in this build script instead (which is kind of ugly - please fix if
-- you have a better idea)
os.execute("gcc -dumpversion > .gccver.tmp")
f = io.open(".gccver.tmp")
major, dot, minor = f:read(1, 1, 1)
major = 0+major -- coerce to number
minor = 0+minor
has_broken_pch = (major < 4 or (major == 4 and minor < 2))
if not options["icc"] then
os.execute("gcc -dumpversion > .gccver.tmp")
f = io.open(".gccver.tmp")
major, dot, minor = f:read(1, 1, 1)
major = 0+major -- coerce to number
minor = 0+minor
has_broken_pch = (major < 4 or (major == 4 and minor < 2))
end
end
source_root = "../../../source/" -- default for most projects - overridden by local in others

View File

@ -133,7 +133,7 @@ switch(x % 2)
*
* @param expression that is expected to evaluate to non-zero at compile-time.
**/
#define cassert(expr) struct UID__ { int CASSERT_FAILURE: (expr); }
#define cassert(expr) struct UID__ { unsigned int CASSERT_FAILURE: (expr); }
/**
* compile-time debug_assert. causes a compile error if the expression

View File

@ -89,6 +89,7 @@ STMT( \
#if !HAVE_SECURE_CRT
#if !OS_UNIX
// return length [in characters] of a string, not including the trailing
// null character. to protect against access violations, only the
// first <max_len> characters are examined; if the null character is
@ -107,6 +108,7 @@ size_t tnlen(const tchar* str, size_t max_len)
return len;
}
#endif // !OS_UNIX
// copy at most <max_src_chars> (not including trailing null) from

View File

@ -77,10 +77,14 @@ public:
}
break;
case TAG_DOUBLE:
// Ehm. I think this works, but I can't say as it's something I've tried before.
{
u64 ival = *( (u64*)JSVAL_TO_DOUBLE( m_data ) );
Serialize_int_8( buffer, ival );
union {
u64 ival;
double dval;
} val;
cassert(sizeof(u64) == sizeof(double));
val.dval = *JSVAL_TO_DOUBLE( m_data );
Serialize_int_8( buffer, val.ival );
}
break;
case TAG_STRING:
@ -116,7 +120,7 @@ public:
u64 ival;
double dval;
} val;
cassert(sizeof(val.ival) == sizeof(val.dval));
cassert(sizeof(u64) == sizeof(double));
Deserialize_int_8( buffer, val.ival );
JS_NewDoubleValue( g_ScriptingHost.GetContext(), val.dval, &m_data );
}

View File

@ -163,7 +163,8 @@ bool BeginAtlas(const CmdLineArgs& args, const DllLoader& dll)
else
{
debug_warn("Unrecognised message");
// TODO: CLogger might not be initialised
// CLogger might not be initialised, but this error will be sent
// to the debug output window anyway so people can still see it
LOG(ERROR, "atlas", "Unrecognised message (%s)", name.c_str());
}