Linux/GCC/glibc Compat
This was SVN commit r1532.
This commit is contained in:
parent
c9d89e964b
commit
46f5c61179
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
|
|
||||||
|
#include "lib.h"
|
||||||
|
|
||||||
#include "Patch.h"
|
#include "Patch.h"
|
||||||
#include "MiniPatch.h"
|
#include "MiniPatch.h"
|
||||||
#include "Terrain.h"
|
#include "Terrain.h"
|
||||||
|
@ -36,4 +36,4 @@ void CGUISpriteInstance::Invalidate()
|
|||||||
bool CGUISpriteInstance::IsEmpty() const
|
bool CGUISpriteInstance::IsEmpty() const
|
||||||
{
|
{
|
||||||
return m_SpriteName=="";
|
return m_SpriteName=="";
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,8 @@ gee@pyro.nu
|
|||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// Includes / Compiler directives
|
// Includes / Compiler directives
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
// I would like to just forward declare CSize, but it doesn't
|
// I would like to just forward declare CSize, but it doesn't
|
||||||
// seem to be defined anywhere in the predefined header.
|
// seem to be defined anywhere in the predefined header.
|
||||||
|
@ -41,4 +41,4 @@ TYPE(EAlign)
|
|||||||
#endif
|
#endif
|
||||||
#ifndef GUITYPE_IGNORE_EVAlign
|
#ifndef GUITYPE_IGNORE_EVAlign
|
||||||
TYPE(EVAlign)
|
TYPE(EVAlign)
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,6 +21,7 @@ gee@pyro.nu
|
|||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// Includes / Compiler directives
|
// Includes / Compiler directives
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
|
#include "GUIbase.h"
|
||||||
#include "Parser.h"
|
#include "Parser.h"
|
||||||
// TODO Gee: New
|
// TODO Gee: New
|
||||||
#include "Overlay.h"
|
#include "Overlay.h"
|
||||||
|
@ -236,7 +236,12 @@ struct DirEnt
|
|||||||
// in order of decl in VC2003 sys/stat.h.
|
// in order of decl in VC2003 sys/stat.h.
|
||||||
mode_t st_mode;
|
mode_t st_mode;
|
||||||
off_t st_size;
|
off_t st_size;
|
||||||
|
// glibc compat hack - they have st_mtime #defined to st_mtim.tv_sec
|
||||||
|
#ifdef st_mtime
|
||||||
|
struct timespec st_mtim;
|
||||||
|
#else
|
||||||
time_t st_mtime;
|
time_t st_mtime;
|
||||||
|
#endif
|
||||||
|
|
||||||
DirEnt(const char* _name, mode_t _st_mode, off_t _st_size, time_t _st_mtime)
|
DirEnt(const char* _name, mode_t _st_mode, off_t _st_size, time_t _st_mtime)
|
||||||
: name(_name)
|
: name(_name)
|
||||||
|
@ -329,7 +329,7 @@ struct TLoc
|
|||||||
// container must not invalidate iterators after insertion!
|
// container must not invalidate iterators after insertion!
|
||||||
// (we keep and pass around pointers to Mount.archive_locs elements)
|
// (we keep and pass around pointers to Mount.archive_locs elements)
|
||||||
// see below.
|
// see below.
|
||||||
typedef std::list<const TLoc> TLocs;
|
typedef std::list<TLoc> TLocs;
|
||||||
typedef TLocs::iterator TLocIt;
|
typedef TLocs::iterator TLocIt;
|
||||||
|
|
||||||
|
|
||||||
@ -1902,7 +1902,7 @@ int vfs_unmap(const Handle hf)
|
|||||||
|
|
||||||
|
|
||||||
// write a representation of the VFS tree to stdout.
|
// write a representation of the VFS tree to stdout.
|
||||||
inline void vfs_display()
|
void vfs_display()
|
||||||
{
|
{
|
||||||
tree_display();
|
tree_display();
|
||||||
}
|
}
|
||||||
|
@ -161,13 +161,16 @@ static int z_find_ecdr(const u8* file, size_t size, const u8*& ecdr_)
|
|||||||
if(*(u32*)ecdr == *(u32*)&ecdr_id)
|
if(*(u32*)ecdr == *(u32*)&ecdr_id)
|
||||||
goto found_ecdr;
|
goto found_ecdr;
|
||||||
|
|
||||||
// scan the last 66000 bytes of file for ecdr_id signature
|
// jump crosses init, blah blah
|
||||||
// (the Zip archive comment field, up to 64k, may follow ECDR).
|
{
|
||||||
// if the zip file is < 66000 bytes, scan the whole file.
|
// scan the last 66000 bytes of file for ecdr_id signature
|
||||||
const u8* start = file + size - MIN(66000, size);
|
// (the Zip archive comment field, up to 64k, may follow ECDR).
|
||||||
ecdr = z_find_id(file, size, start, ecdr_id, ECDR_SIZE);
|
// if the zip file is < 66000 bytes, scan the whole file.
|
||||||
if(!ecdr)
|
const u8* start = file + size - MIN(66000, size);
|
||||||
return ERR_CORRUPTED;
|
ecdr = z_find_id(file, size, start, ecdr_id, ECDR_SIZE);
|
||||||
|
if(!ecdr)
|
||||||
|
return ERR_CORRUPTED;
|
||||||
|
}
|
||||||
|
|
||||||
found_ecdr:
|
found_ecdr:
|
||||||
ecdr_ = ecdr;
|
ecdr_ = ecdr;
|
||||||
|
@ -23,13 +23,11 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// high resolution (> 1 µs) timestamp [s], starting at or near 0 s.
|
// high resolution (> 1 µs) timestamp [s], starting at or near 0 s.
|
||||||
extern double get_time();
|
extern double get_time();
|
||||||
|
|
||||||
extern double timer_res();
|
extern double timer_res();
|
||||||
|
|
||||||
|
|
||||||
// calculate fps (call once per frame)
|
// calculate fps (call once per frame)
|
||||||
// several smooth filters (tuned for ~100 FPS)
|
// several smooth filters (tuned for ~100 FPS)
|
||||||
// => less fluctuation, but rapid tracking
|
// => less fluctuation, but rapid tracking
|
||||||
@ -38,9 +36,9 @@ extern int fps;
|
|||||||
|
|
||||||
extern void calc_fps();
|
extern void calc_fps();
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -75,9 +73,4 @@ public:
|
|||||||
|
|
||||||
#define TIMER(name) ScopedTimer name(#name);
|
#define TIMER(name) ScopedTimer name(#name);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // #ifndef TIMER_H
|
#endif // #ifndef TIMER_H
|
||||||
|
@ -1086,4 +1086,4 @@ CParser& CParserCache::Get(const char* str)
|
|||||||
CParser* parser = it->second;
|
CParser* parser = it->second;
|
||||||
return *parser;
|
return *parser;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,6 +234,7 @@ private:
|
|||||||
template <typename T, typename P> class SDMap : public std::map<T,P>
|
template <typename T, typename P> class SDMap : public std::map<T,P>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
typedef typename std::map<T,P>::iterator iterator;
|
||||||
~SDMap()
|
~SDMap()
|
||||||
{
|
{
|
||||||
for (iterator it = begin(); it != end(); ++it) delete it->second;
|
for (iterator it = begin(); it != end(); ++it) delete it->second;
|
||||||
|
@ -265,4 +265,4 @@ jsval JSParseString( const CStrW& Native )
|
|||||||
return( BOOLEAN_TO_JSVAL( boolResult ) );
|
return( BOOLEAN_TO_JSVAL( boolResult ) );
|
||||||
|
|
||||||
return( ToJSVal( Native ) );
|
return( ToJSVal( Native ) );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user