Linux/GCC compat, a few newlines at end of file, minor changes
This was SVN commit r353.
This commit is contained in:
parent
e511599f8b
commit
c0d33d3330
@ -1 +1 @@
|
|||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
|
@ -24,4 +24,6 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable:4996) // function is deprecated
|
#pragma warning(disable:4996) // function is deprecated
|
||||||
#pragma warning(disable:4786) // identifier truncated to 255 chars
|
#pragma warning(disable:4786) // identifier truncated to 255 chars
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
@ -511,7 +511,9 @@ ssize_t ll_wait_io(ll_cb* lcb, void*& p)
|
|||||||
while(aio_error(cb) == EINPROGRESS)
|
while(aio_error(cb) == EINPROGRESS)
|
||||||
aio_suspend(&cb, 1, NULL);
|
aio_suspend(&cb, 1, NULL);
|
||||||
|
|
||||||
p = cb->aio_buf;
|
// posix has aio_buf as volatile void, and gcc doesn't like to cast it
|
||||||
|
// implicitly
|
||||||
|
p = (void *)cb->aio_buf;
|
||||||
|
|
||||||
// return how much was actually transferred,
|
// return how much was actually transferred,
|
||||||
// or -1 if the transfer failed.
|
// or -1 if the transfer failed.
|
||||||
|
@ -107,4 +107,4 @@ extern ssize_t file_io(File* f, size_t ofs, size_t size, void** p,
|
|||||||
FILE_IO_CB cb = 0, uintptr_t ctx = 0);
|
FILE_IO_CB cb = 0, uintptr_t ctx = 0);
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef FILE_H
|
#endif // #ifndef FILE_H
|
||||||
|
@ -305,4 +305,4 @@ ssize_t mem_size(void* p)
|
|||||||
Handle hm = find_alloc(p);
|
Handle hm = find_alloc(p);
|
||||||
H_DEREF(hm, Mem, m);
|
H_DEREF(hm, Mem, m);
|
||||||
return (ssize_t)m->size;
|
return (ssize_t)m->size;
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,4 @@ int res_reload(const char* const fn)
|
|||||||
|
|
||||||
// purpose of this routine (intended to be called once a frame):
|
// purpose of this routine (intended to be called once a frame):
|
||||||
// file notification may come at any time. by forcing the reloads
|
// file notification may come at any time. by forcing the reloads
|
||||||
// to take place here, we don't require everything to be thread-safe.
|
// to take place here, we don't require everything to be thread-safe.
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
#include "res/file.h"
|
#include "res/file.h"
|
||||||
#include "res/zip.h"
|
#include "res/zip.h"
|
||||||
|
|
||||||
extern int res_reload(const char* fn);
|
extern int res_reload(const char* fn);
|
||||||
|
@ -39,9 +39,13 @@
|
|||||||
#define WINAPIV __cdecl
|
#define WINAPIV __cdecl
|
||||||
|
|
||||||
#ifndef NO_PNG
|
#ifndef NO_PNG
|
||||||
# include <libpng10/png.h>
|
# ifdef _WIN32
|
||||||
# ifdef _MSC_VER
|
# include <libpng10/png.h>
|
||||||
# pragma comment(lib, "libpng10.lib")
|
# else
|
||||||
|
# include <png.h>
|
||||||
|
# ifdef _MSC_VER
|
||||||
|
# pragma comment(lib, "libpng10.lib")
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -126,7 +130,7 @@ DDSURFACEDESC2;
|
|||||||
static inline bool dds_valid(const u8* ptr, size_t size)
|
static inline bool dds_valid(const u8* ptr, size_t size)
|
||||||
{
|
{
|
||||||
UNUSED(size) // only need first 4 chars
|
UNUSED(size) // only need first 4 chars
|
||||||
|
|
||||||
return *(u32*)ptr == FOURCC('D','D','S',' ');
|
return *(u32*)ptr == FOURCC('D','D','S',' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,4 +88,4 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __VFS_H__
|
#endif // #ifndef __VFS_H__
|
||||||
|
@ -57,7 +57,7 @@ double get_time()
|
|||||||
gettimeofday(&start, 0);
|
gettimeofday(&start, 0);
|
||||||
|
|
||||||
gettimeofday(&cur, 0);
|
gettimeofday(&cur, 0);
|
||||||
t = (cur.tv_sec - start.tv_sec) + (cur.tv_nsec - start.tv_nsec)*1e-6;
|
t = (cur.tv_sec - start.tv_sec) + (cur.tv_usec - start.tv_usec)*1e-6;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -7,9 +7,12 @@
|
|||||||
|
|
||||||
// defines instead of typedefs so we can #undef conflicting decls
|
// defines instead of typedefs so we can #undef conflicting decls
|
||||||
|
|
||||||
#define ulong unsigned long
|
// Workaround: GCC won't parse constructor-casts with multi-word types, while
|
||||||
|
// visual studio will. Define uint/long to a namespaced one-word typedef.
|
||||||
#define uint unsigned int
|
typedef unsigned long PS_ulong;
|
||||||
|
typedef unsigned int PS_uint;
|
||||||
|
#define ulong PS_ulong
|
||||||
|
#define uint PS_uint
|
||||||
|
|
||||||
#define i8 int8_t
|
#define i8 int8_t
|
||||||
#define i16 int16_t
|
#define i16 int16_t
|
||||||
|
@ -83,7 +83,7 @@ int CStr::ToInt() const
|
|||||||
|
|
||||||
unsigned int CStr::ToUInt() const
|
unsigned int CStr::ToUInt() const
|
||||||
{
|
{
|
||||||
return unsigned int(_ttoi(m_String.c_str()));
|
return uint(_ttoi(m_String.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
long CStr::ToLong() const
|
long CStr::ToLong() const
|
||||||
@ -93,7 +93,7 @@ long CStr::ToLong() const
|
|||||||
|
|
||||||
unsigned long CStr::ToULong() const
|
unsigned long CStr::ToULong() const
|
||||||
{
|
{
|
||||||
return unsigned long(_ttol(m_String.c_str()));
|
return ulong(_ttol(m_String.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -446,4 +446,4 @@ const u8 *CStr::Deserialize(const u8 *buffer, const u8 *bufferend)
|
|||||||
return NULL;
|
return NULL;
|
||||||
*this=(char *)buffer;
|
*this=(char *)buffer;
|
||||||
return strend+1;
|
return strend+1;
|
||||||
}
|
}
|
||||||
|
@ -27,4 +27,4 @@ char *EncryptData(char *Data, long DataLength, char *Key, long KeyLength);
|
|||||||
// Simple Decryption function
|
// Simple Decryption function
|
||||||
char *DecryptData(char *Data, long DataLength, char *Key, long KeyLength);
|
char *DecryptData(char *Data, long DataLength, char *Key, long KeyLength);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -40,4 +40,4 @@ private:
|
|||||||
std::vector<u8> m_Data;
|
std::vector<u8> m_Data;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -53,4 +53,4 @@ private:
|
|||||||
u32 m_Version;
|
u32 m_Version;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -152,4 +152,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -57,4 +57,4 @@ inline bool ErrorMechanism_Error();
|
|||||||
|
|
||||||
#define GetError() GError.ErrorMechanism_GetError()
|
#define GetError() GError.ErrorMechanism_GetError()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,4 +61,4 @@ class Singleton
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
T* Singleton<T>::ms_singleton = 0;
|
T* Singleton<T>::ms_singleton = 0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -96,4 +96,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user