# GCC compatibility
This was SVN commit r3828.
This commit is contained in:
parent
a8e200b4ac
commit
a7594bb39c
@ -8,6 +8,7 @@ struct SPropPoint;
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include "CStr.h"
|
||||
#include "Overlay.h"
|
||||
|
||||
|
@ -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:
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "file_internal.h"
|
||||
|
||||
#include <queue>
|
||||
|
||||
static bool dirent_less(const DirEnt& d1, const DirEnt& d2)
|
||||
{
|
||||
@ -303,4 +304,4 @@ void next_numbered_filename(const char* fn_fmt,
|
||||
do
|
||||
snprintf(next_fn, PATH_MAX, fn_fmt, nfi->next_num++);
|
||||
while(exists(next_fn));
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define BASEENT_COLLECTION_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "CStr.h"
|
||||
#include "Singleton.h"
|
||||
#include "ObjectEntry.h"
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -61,4 +61,4 @@ template<typename T> void ShareableDelete(T* p)
|
||||
#endif
|
||||
|
||||
|
||||
#endif // SHAREDMEMORY_H__
|
||||
#endif // SHAREDMEMORY_H__
|
||||
|
Loading…
Reference in New Issue
Block a user