# GCC compatibility

This was SVN commit r3828.
This commit is contained in:
Ykkrosh 2006-04-28 04:53:23 +00:00
parent a8e200b4ac
commit a7594bb39c
7 changed files with 11 additions and 5 deletions

View File

@ -8,6 +8,7 @@ struct SPropPoint;
#include <map>
#include <vector>
#include <set>
#include "CStr.h"
#include "Overlay.h"

View File

@ -148,7 +148,7 @@ get_another_entry:
// we need the full pathname for this. don't use path_append because
// it would unnecessarily call strlen.
CHECK_ERR(stat(pdi->pp.path, &s));
CHECK_ERR(stat(pdi->pp->path, &s));
#endif
// skip "undesirable" entries that POSIX readdir returns:

View File

@ -2,6 +2,7 @@
#include "file_internal.h"
#include <queue>
static bool dirent_less(const DirEnt& d1, const DirEnt& d2)
{

View File

@ -41,6 +41,7 @@ LibError dir_add_watch(const char* const n_full_path, intptr_t* const watch)
{
initialized = -1;
DISPLAY_ERROR(L"Error initializing FAM; hotloading will be disabled");
return ERR_FAIL; // NOWARN
}
}

View File

@ -19,6 +19,7 @@
#define BASEENT_COLLECTION_INCLUDED
#include <vector>
#include <map>
#include "CStr.h"
#include "Singleton.h"
#include "ObjectEntry.h"

View File

@ -114,12 +114,14 @@ template<int x> struct static_assert_test{};
sizeof(REQUIRE_TYPE_TO_BE_SHAREABLE_FAILURE< T, (bool)(Shareable<T>::TypeIsShareable) >)> \
static_assert_typedef_
// Should be an empty string when cast to either char* or wchar_t*
// (which requires length >= 4, since GCC's sizeof(wchar_t)==4)
static const char empty_str[4] = { 0, 0, 0, 0 };
// Shareable strings:
template<typename C> class Shareable< std::basic_string<C> >
{
typedef std::basic_string<C> wrapped_type;
const static C null = 0; // for null strings of the right type
C* buf; // null-terminated string (perhaps with embedded nulls)
size_t length; // size of buf (including null)
@ -171,7 +173,7 @@ public:
// without constructing a new std::basic_string then calling c_str on that
const C* c_str() const
{
return buf ? buf : &null;
return buf ? buf : (C*)empty_str;
}
};