forked from 0ad/0ad
# GCC 4.1.1 compatibility
which is just "class C { void C::f(); }" code, which other compilers seem to have ignored. Also removed HAVE_PCH from GCC because our build system doesn't have PCH. Added necessary headers to make it compile again. This was SVN commit r4437.
This commit is contained in:
parent
fa505ba028
commit
a2432adad3
@ -1,6 +1,7 @@
|
||||
#include "precompiled.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <queue>
|
||||
|
||||
#include "ObjectBase.h"
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace GUIRenderer
|
||||
void clear();
|
||||
DrawCalls();
|
||||
DrawCalls(const DrawCalls&);
|
||||
const DrawCalls& DrawCalls::operator=(const DrawCalls&);
|
||||
const DrawCalls& operator=(const DrawCalls&);
|
||||
~DrawCalls();
|
||||
};
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
/**
|
||||
* Choosing which color of the following according to
|
||||
*/
|
||||
CColor IGUIButtonBehavior::ChooseColor();
|
||||
CColor ChooseColor();
|
||||
|
||||
|
||||
protected:
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <queue>
|
||||
|
||||
/*
|
||||
Cache for items of variable size and value/"cost".
|
||||
|
@ -332,7 +332,7 @@
|
||||
#endif
|
||||
|
||||
// precompiled headers (affects what precompiled.h pulls in; see there)
|
||||
#if MSC_VERSION || (GCC_VERSION > 304)
|
||||
#if MSC_VERSION
|
||||
# define HAVE_PCH 1
|
||||
#else
|
||||
# define HAVE_PCH 0
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h> // abs
|
||||
#include <errno.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
struct LibErrorAssociation
|
||||
{
|
||||
|
@ -1122,7 +1122,7 @@ void free_dbg(const void* user_p, AllocType type, const char* file, int line, co
|
||||
if(!a)
|
||||
{
|
||||
log("[!] mmgr_free: not allocated by this memory manager\n");
|
||||
DEBUG_WARN_ERR(ERR::ALLOC_NOT_FOUND);
|
||||
DEBUG_WARN_ERR(ERR::MEM_ALLOC_NOT_FOUND);
|
||||
goto fail;
|
||||
}
|
||||
// .. overrun? (note: alloc_is_valid already asserts if invalid)
|
||||
|
@ -27,7 +27,7 @@ LibError dir_add_watch(const char* const n_full_path, intptr_t* const watch)
|
||||
{
|
||||
// init already failed; don't try again or complain
|
||||
if(initialized == -1)
|
||||
return ERR_FAIL; // NOWARN
|
||||
return ERR::FAIL; // NOWARN
|
||||
|
||||
if(!initialized)
|
||||
{
|
||||
@ -41,7 +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
|
||||
return ERR::FAIL; // NOWARN
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,34 +50,34 @@ LibError dir_add_watch(const char* const n_full_path, intptr_t* const watch)
|
||||
{
|
||||
*watch = -1;
|
||||
debug_warn("res_watch_dir failed!");
|
||||
WARN_RETURN(ERR_FAIL); // no way of getting error code?
|
||||
WARN_RETURN(ERR::FAIL); // no way of getting error code?
|
||||
}
|
||||
|
||||
*watch = (intptr_t)req.reqnum;
|
||||
dirs[*watch] = n_full_path;
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
|
||||
LibError dir_cancel_watch(const intptr_t watch)
|
||||
{
|
||||
if(initialized == -1)
|
||||
return ERR_FAIL; // NOWARN
|
||||
return ERR::FAIL; // NOWARN
|
||||
if(!initialized)
|
||||
WARN_RETURN(ERR_LOGIC);
|
||||
WARN_RETURN(ERR::LOGIC);
|
||||
|
||||
FAMRequest req;
|
||||
req.reqnum = (int)watch;
|
||||
RETURN_ERR(FAMCancelMonitor(&fc, &req));
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
int dir_get_changed_file(char* fn)
|
||||
{
|
||||
if(initialized == -1)
|
||||
return ERR_FAIL; // NOWARN
|
||||
return ERR::FAIL; // NOWARN
|
||||
if(!initialized)
|
||||
WARN_RETURN(ERR_LOGIC);
|
||||
WARN_RETURN(ERR::LOGIC);
|
||||
|
||||
FAMEvent e;
|
||||
while(FAMPending(&fc) > 0)
|
||||
@ -90,11 +90,11 @@ int dir_get_changed_file(char* fn)
|
||||
const char* dir = dirs[e.fr.reqnum].c_str();
|
||||
snprintf(n_path, PATH_MAX, "%s%c%s", dir, DIR_SEP, e.filename);
|
||||
RETURN_ERR(file_make_portable_path(n_path, fn));
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// just nothing new; try again later
|
||||
return ERR_AGAIN; // NOWARN
|
||||
return ERR::AGAIN; // NOWARN
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <cassert>
|
||||
|
||||
#include <bfd.h>
|
||||
#include <cxxabi.h>
|
||||
@ -39,11 +40,11 @@
|
||||
|
||||
// Hard-coded - yuck :P
|
||||
#if defined(TESTING)
|
||||
#define EXE_NAME "ps_test"
|
||||
#define EXE_NAME "pyrogenesis_test"
|
||||
#elif defined(NDEBUG)
|
||||
#define EXE_NAME "ps"
|
||||
#define EXE_NAME "pyrogenesis"
|
||||
#else
|
||||
#define EXE_NAME "ps_dbg"
|
||||
#define EXE_NAME "pyrogenesis_dbg"
|
||||
#endif
|
||||
|
||||
struct symbol_file_context
|
||||
@ -159,7 +160,7 @@ LibError debug_dump_stack(wchar_t* buf, size_t max_chars, uint skip, void* UNUSE
|
||||
bufpos += len;
|
||||
}
|
||||
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
static int slurp_symtab(symbol_file_context *ctx)
|
||||
@ -317,7 +318,7 @@ static LibError debug_resolve_symbol_dladdr(void *ptr, char* sym_name, char* fil
|
||||
|
||||
int res=dladdr(ptr, &syminfo);
|
||||
if (res == 0)
|
||||
WARN_RETURN(ERR_FAIL);
|
||||
WARN_RETURN(ERR::FAIL);
|
||||
|
||||
if (sym_name)
|
||||
{
|
||||
@ -341,7 +342,7 @@ static LibError debug_resolve_symbol_dladdr(void *ptr, char* sym_name, char* fil
|
||||
*line=0;
|
||||
}
|
||||
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
LibError debug_resolve_symbol(void* ptr_of_interest, char* sym_name, char* file, int* line)
|
||||
@ -406,7 +407,7 @@ LibError debug_resolve_symbol(void* ptr_of_interest, char* sym_name, char* file,
|
||||
*line = ctx.line;
|
||||
}
|
||||
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
void debug_puts(const char* text)
|
||||
|
@ -34,11 +34,11 @@ LibError sys_get_executable_name(char* n_path, size_t buf_size)
|
||||
if (!dladdr((void *)sys_get_executable_name, &dl_info) ||
|
||||
!dl_info.dli_fname )
|
||||
{
|
||||
return ERR_NO_SYS;
|
||||
return ERR::NO_SYS;
|
||||
}
|
||||
|
||||
strncpy(n_path, dl_info.dli_fname, buf_size);
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
extern int cpus;
|
||||
@ -58,7 +58,7 @@ LibError sys_on_each_cpu(void(*cb)())
|
||||
{
|
||||
UNUSED2(cb);
|
||||
|
||||
return ERR_NO_SYS;
|
||||
return ERR::NO_SYS;
|
||||
}
|
||||
|
||||
ErrorReaction sys_display_error(const wchar_t* text, uint flags)
|
||||
@ -123,7 +123,7 @@ LibError sys_error_description_r(int err, char* buf, size_t max_chars)
|
||||
// don't need to do anything: lib/errors.cpp already queries
|
||||
// libc's strerror(). if we ever end up needing translation of
|
||||
// e.g. Qt or X errors, that'd go here.
|
||||
return ERR_FAIL;
|
||||
return ERR::FAIL;
|
||||
}
|
||||
|
||||
// stub for sys_cursor_create - we don't need to implement this (SDL/X11 only
|
||||
@ -141,7 +141,7 @@ LibError sys_cursor_create(uint w, uint h, void* bgra_img,
|
||||
UNUSED2(bgra_img);
|
||||
|
||||
*cursor = 0;
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
// creates an empty cursor
|
||||
@ -154,9 +154,9 @@ LibError sys_cursor_create_empty(void **cursor)
|
||||
// size 8x1 (cursor size must be a whole number of bytes ^^)
|
||||
// hotspot at 0,0
|
||||
// SDL will make its own copies of data and mask
|
||||
*cursor=SDL_CreateCursor(data, mask, 8, 1, 0, 0);
|
||||
*cursor = SDL_CreateCursor(data, mask, 8, 1, 0, 0);
|
||||
|
||||
return cursor?INFO_OK:ERR_FAIL;
|
||||
return cursor ? INFO::OK : ERR::FAIL;
|
||||
}
|
||||
|
||||
SDL_Cursor *defaultCursor=NULL;
|
||||
@ -174,7 +174,7 @@ LibError sys_cursor_set(void* cursor)
|
||||
|
||||
SDL_SetCursor((SDL_Cursor *)cursor);
|
||||
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
// destroys the indicated cursor and frees its resources. if it is
|
||||
@ -183,7 +183,7 @@ LibError sys_cursor_free(void* cursor)
|
||||
{
|
||||
// bail now to prevent potential confusion below; there's nothing to do.
|
||||
if(!cursor)
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
|
||||
// if the cursor being freed is active, restore the default cursor
|
||||
// (just for safety).
|
||||
@ -192,7 +192,7 @@ LibError sys_cursor_free(void* cursor)
|
||||
|
||||
SDL_FreeCursor((SDL_Cursor *)cursor);
|
||||
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
// note: just use the sector size: Linux aio doesn't really care about
|
||||
|
@ -35,7 +35,7 @@ LibError gfx_get_video_mode(int* xres, int* yres, int* bpp, int* freq)
|
||||
{
|
||||
Display* disp = XOpenDisplay(0);
|
||||
if(!disp)
|
||||
WARN_RETURN(ERR_FAIL);
|
||||
WARN_RETURN(ERR::FAIL);
|
||||
|
||||
int screen = XDefaultScreen(disp);
|
||||
|
||||
@ -59,7 +59,7 @@ LibError gfx_get_video_mode(int* xres, int* yres, int* bpp, int* freq)
|
||||
if(freq)
|
||||
*freq = 0;
|
||||
XCloseDisplay(disp);
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ LibError gfx_get_monitor_size(int& width_mm, int& height_mm)
|
||||
{
|
||||
Display* disp = XOpenDisplay(0);
|
||||
if(!disp)
|
||||
WARN_RETURN(ERR_FAIL);
|
||||
WARN_RETURN(ERR::FAIL);
|
||||
|
||||
int screen = XDefaultScreen(disp);
|
||||
|
||||
@ -77,7 +77,7 @@ LibError gfx_get_monitor_size(int& width_mm, int& height_mm)
|
||||
height_mm=XDisplayHeightMM(disp, screen);
|
||||
|
||||
XCloseDisplay(disp);
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -190,7 +190,7 @@ wchar_t *sys_clipboard_get()
|
||||
LibError sys_clipboard_free(wchar_t *clip_buf)
|
||||
{
|
||||
free(clip_buf);
|
||||
return INFO_OK;
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -205,7 +205,7 @@ Setting the Selection (i.e. "copy")
|
||||
LibError sys_clipboard_set(const wchar_t *clip_str)
|
||||
{
|
||||
// Not Implemented, see comment before clipboard_get, above
|
||||
WARN_RETURN(ERR_FAIL);
|
||||
WARN_RETURN(ERR::FAIL);
|
||||
}
|
||||
|
||||
#endif // #ifdef HAVE_X
|
||||
|
@ -7,12 +7,14 @@
|
||||
// Mark Thompson (mot20@cam.ac.uk / mark@wildfiregames.com)
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "Singleton.h"
|
||||
#include "simulation/EntityHandles.h"
|
||||
#include "ps/Vector2D.h"
|
||||
#include "lib/input.h"
|
||||
#include "lib/res/handle.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
class CVector3D;
|
||||
class CUnit;
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
CVertexBuffer::VBChunk* Allocate(size_t vertexSize,size_t numVertices,bool dynamic);
|
||||
|
||||
// return given chunk to it's owner
|
||||
void CVertexBufferManager::Release(CVertexBuffer::VBChunk* chunk);
|
||||
void Release(CVertexBuffer::VBChunk* chunk);
|
||||
|
||||
// empty out the batch lists of all vertex buffers
|
||||
void ClearBatchIndices();
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
|
||||
jsval CallFunction(const std::string & functionName, jsval * params, int numParams);
|
||||
|
||||
jsval ScriptingHost::ExecuteScript(const CStrW& script, const CStrW& calledFrom = CStrW( L"Console" ), JSObject* contextObject = NULL );
|
||||
jsval ExecuteScript(const CStrW& script, const CStrW& calledFrom = CStrW( L"Console" ), JSObject* contextObject = NULL );
|
||||
|
||||
void RegisterFunction(const std::string & functionName, JSNative function, int numArgs);
|
||||
|
||||
|
@ -485,4 +485,4 @@ inline void CAStarEngine::SetPassableFlag(AStarNodeFlag* flag)
|
||||
inline void CAStarEngine::SetBlockedFlag(AStarNodeFlag* flag)
|
||||
{
|
||||
*flag |= kBlocked;
|
||||
}
|
||||
}
|
||||
|
@ -172,4 +172,4 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include "EntityHandles.h"
|
||||
#include "maths/Vector4D.h"
|
||||
#include "scripting/SpiderMonkey.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
class CEntity;
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
class CEntity;
|
||||
class CPlayer;
|
||||
class CStrW;
|
||||
|
||||
#include "EntityHandles.h"
|
||||
|
||||
struct rayIntersectionResults
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef ENTITY_MANAGER_INCLUDED
|
||||
#define ENTITY_MANAGER_INCLUDED
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "ps/Singleton.h"
|
||||
#include "EntityHandles.h"
|
||||
#include "EntityPredicate.h"
|
||||
|
@ -62,7 +62,7 @@ float CEntity::chooseMovementSpeed( float distance )
|
||||
|
||||
// Modify the speed based on the slope of the terrain in our direction (obtained from our x orientation)
|
||||
float angle = m_orientation_unclamped.x;
|
||||
int sector = ia32_rintf( angle / (PI/2) * m_base->m_pitchDivs );
|
||||
int sector = rintf( angle / (PI/2) * m_base->m_pitchDivs );
|
||||
speed -= sector * m_base->m_pitchValue;
|
||||
|
||||
// TODO: the animation code requires unicode for now. will be changed to
|
||||
|
@ -3,6 +3,8 @@
|
||||
#ifndef ENTITY_SUPPORT_INCLUDED
|
||||
#define ENTITY_SUPPORT_INCLUDED
|
||||
|
||||
#include "ps/CStr.h"
|
||||
|
||||
#include "EntityHandles.h"
|
||||
|
||||
class CEntityManager;
|
||||
|
@ -9,6 +9,8 @@
|
||||
class CStrW;
|
||||
class CScriptEvent;
|
||||
|
||||
#include "scripting/SpiderMonkey.h"
|
||||
|
||||
class CScriptObject
|
||||
{
|
||||
JSFunction* Function;
|
||||
|
@ -87,4 +87,4 @@ private:
|
||||
bool hasReqTechs();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -4,6 +4,7 @@
|
||||
struct ActorViewerImpl;
|
||||
struct SColor4ub;
|
||||
class CUnit;
|
||||
class CStrW;
|
||||
|
||||
class ActorViewer
|
||||
{
|
||||
|
@ -37,4 +37,4 @@ extern Brush g_CurrentBrush;
|
||||
|
||||
}
|
||||
|
||||
#endif // BRUSHES_H__
|
||||
#endif // BRUSHES_H__
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "CommandProc.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
// so cheat and undefine its include-guard
|
||||
#undef MESSAGES_H__
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "SharedTypes.h"
|
||||
#include "Shareable.h"
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "GameLoop.h"
|
||||
#include "Messages.h"
|
||||
|
||||
#include "graphics/GameView.h"
|
||||
#include "graphics/SColor.h"
|
||||
#include "graphics/UnitManager.h"
|
||||
#include "renderer/Renderer.h"
|
||||
|
@ -1,6 +1,10 @@
|
||||
#ifndef VIEW_H__
|
||||
#define VIEW_H__
|
||||
|
||||
#include "graphics/Camera.h"
|
||||
|
||||
#include "Messages.h"
|
||||
|
||||
class CUnit;
|
||||
|
||||
class ViewGame;
|
||||
|
Loading…
Reference in New Issue
Block a user