1
1
forked from 0ad/0ad

Linux/GCC compat, a few newlines at end of file, minor changes

This was SVN commit r353.
This commit is contained in:
Simon Brenner 2004-06-02 15:31:55 +00:00
parent e511599f8b
commit c0d33d3330
19 changed files with 37 additions and 26 deletions

View File

@ -1 +1 @@
#include "precompiled.h"
#include "precompiled.h"

View File

@ -24,4 +24,6 @@
#ifdef _MSC_VER
#pragma warning(disable:4996) // function is deprecated
#pragma warning(disable:4786) // identifier truncated to 255 chars
#endif
#endif
#include "config.h"

View File

@ -511,7 +511,9 @@ ssize_t ll_wait_io(ll_cb* lcb, void*& p)
while(aio_error(cb) == EINPROGRESS)
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,
// or -1 if the transfer failed.

View File

@ -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);
#endif // #ifndef FILE_H
#endif // #ifndef FILE_H

View File

@ -305,4 +305,4 @@ ssize_t mem_size(void* p)
Handle hm = find_alloc(p);
H_DEREF(hm, Mem, m);
return (ssize_t)m->size;
}
}

View File

@ -13,4 +13,4 @@ int res_reload(const char* const fn)
// purpose of this routine (intended to be called once a frame):
// 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.

View File

@ -6,4 +6,4 @@
#include "res/file.h"
#include "res/zip.h"
extern int res_reload(const char* fn);
extern int res_reload(const char* fn);

View File

@ -39,9 +39,13 @@
#define WINAPIV __cdecl
#ifndef NO_PNG
# include <libpng10/png.h>
# ifdef _MSC_VER
# pragma comment(lib, "libpng10.lib")
# ifdef _WIN32
# include <libpng10/png.h>
# else
# include <png.h>
# ifdef _MSC_VER
# pragma comment(lib, "libpng10.lib")
# endif
# endif
#endif
@ -126,7 +130,7 @@ DDSURFACEDESC2;
static inline bool dds_valid(const u8* ptr, size_t size)
{
UNUSED(size) // only need first 4 chars
return *(u32*)ptr == FOURCC('D','D','S',' ');
}

View File

@ -88,4 +88,4 @@ enum
};
#endif // #ifndef __VFS_H__
#endif // #ifndef __VFS_H__

View File

@ -57,7 +57,7 @@ double get_time()
gettimeofday(&start, 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

View File

@ -7,9 +7,12 @@
// defines instead of typedefs so we can #undef conflicting decls
#define ulong unsigned long
#define uint unsigned int
// Workaround: GCC won't parse constructor-casts with multi-word types, while
// visual studio will. Define uint/long to a namespaced one-word typedef.
typedef unsigned long PS_ulong;
typedef unsigned int PS_uint;
#define ulong PS_ulong
#define uint PS_uint
#define i8 int8_t
#define i16 int16_t

View File

@ -83,7 +83,7 @@ int CStr::ToInt() 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
@ -93,7 +93,7 @@ long CStr::ToLong() 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;
*this=(char *)buffer;
return strend+1;
}
}

View File

@ -27,4 +27,4 @@ char *EncryptData(char *Data, long DataLength, char *Key, long KeyLength);
// Simple Decryption function
char *DecryptData(char *Data, long DataLength, char *Key, long KeyLength);
#endif
#endif

View File

@ -40,4 +40,4 @@ private:
std::vector<u8> m_Data;
};
#endif
#endif

View File

@ -53,4 +53,4 @@ private:
u32 m_Version;
};
#endif
#endif

View File

@ -152,4 +152,4 @@ private:
};
#endif
#endif

View File

@ -57,4 +57,4 @@ inline bool ErrorMechanism_Error();
#define GetError() GError.ErrorMechanism_GetError()
#endif
#endif

View File

@ -61,4 +61,4 @@ class Singleton
template <typename T>
T* Singleton<T>::ms_singleton = 0;
#endif
#endif

View File

@ -96,4 +96,4 @@ public:
}
};
#endif
#endif