2018-02-20 18:55:24 +01:00
|
|
|
// Current libev version: 4.24
|
|
|
|
|
|
2024-05-17 11:10:17 +02:00
|
|
|
#define _LIBEV
|
- Addressed another batch of warnings produced by the MSVC compiler and static analysis tools. In addition to more of the same kind of warnings as in the previous commit, this also includes corrections for signed/unsigned comparisons, non-virtual destructors, non-explicit constructors, missing copy constructors, float comparisons, empty switches and const-correctness. Due to the nature of the changes involved (e.g. changed method signatures), there is a slight chance that there are some unwanted side-effects. On the bright side though, the following issues have been identified and fixed as a direct result of the warning clean-up:
> DEFMSG_NPC_PET_WAGE_COST not showing the hire cost.
> CItem::Use_SpyGlass not searching the entire area for land and just checking one title.
> CWorldThread::m_FreeOffset being initialised with -1 which would result in either an access violation when used to lookup against m_FreeUIDs, or even disable the use of m_FreeUIDs altogether and only use the slower free uid lookup.
> Unicode text not being adjusted properly by SuppressCapitals setting, since COUNTOF() was being used on a pointer and returning the wrong value.
> Possible memory leak due to PacketHouseDesign's destructor not necessarily being invoked.
> Missing copy constructor and assignment operator on CResourceDef lead to the reference count for some resources becoming inaccurate when they are ever used since the compiler-generated constructor+operator would not update the reference count.
- Expanded _NEWGUILDSYSTEM checks so that methods used in the 'old' guild system are completely removed rather than just their contents being cut out.
- Related to the CResourceDef issue, added copy constructors and assignment operators to almost any class which would accept them. These are marked as private and without a body so that the compiler will throw an error if used, to prevent accidental copying and assignment. If these are ever needed for real then a body will need to be created.
- Removed AbstractSphereThread::allocateString(void) as it would not have worked correctly due to the temporary TemporaryString object's destructor marking the allocated string as 'unused' (the result being something similar to Str_GetTemp).
- Removed the 'using' directive for the std namespace since it is causing problems between our definition of 'abs' and 'std::abs' when building with GCC. Everything is already properly qualified anyway so the statement is not needed.
2011-01-25 22:18:13 +00:00
|
|
|
|
2024-10-03 13:31:36 +02:00
|
|
|
// Clang with MSVC backend on Windows defines _MSC_VER! (But also __clang__)
|
|
|
|
|
#ifndef MSVC_COMPILER
|
|
|
|
|
# if defined(_MSC_VER) && !defined(__clang__)
|
|
|
|
|
# define MSVC_COMPILER 1
|
|
|
|
|
# endif
|
|
|
|
|
#endif
|
|
|
|
|
|
- Addressed another batch of warnings produced by the MSVC compiler and static analysis tools. In addition to more of the same kind of warnings as in the previous commit, this also includes corrections for signed/unsigned comparisons, non-virtual destructors, non-explicit constructors, missing copy constructors, float comparisons, empty switches and const-correctness. Due to the nature of the changes involved (e.g. changed method signatures), there is a slight chance that there are some unwanted side-effects. On the bright side though, the following issues have been identified and fixed as a direct result of the warning clean-up:
> DEFMSG_NPC_PET_WAGE_COST not showing the hire cost.
> CItem::Use_SpyGlass not searching the entire area for land and just checking one title.
> CWorldThread::m_FreeOffset being initialised with -1 which would result in either an access violation when used to lookup against m_FreeUIDs, or even disable the use of m_FreeUIDs altogether and only use the slower free uid lookup.
> Unicode text not being adjusted properly by SuppressCapitals setting, since COUNTOF() was being used on a pointer and returning the wrong value.
> Possible memory leak due to PacketHouseDesign's destructor not necessarily being invoked.
> Missing copy constructor and assignment operator on CResourceDef lead to the reference count for some resources becoming inaccurate when they are ever used since the compiler-generated constructor+operator would not update the reference count.
- Expanded _NEWGUILDSYSTEM checks so that methods used in the 'old' guild system are completely removed rather than just their contents being cut out.
- Related to the CResourceDef issue, added copy constructors and assignment operators to almost any class which would accept them. These are marked as private and without a body so that the compiler will throw an error if used, to prevent accidental copying and assignment. If these are ever needed for real then a body will need to be created.
- Removed AbstractSphereThread::allocateString(void) as it would not have worked correctly due to the temporary TemporaryString object's destructor marking the allocated string as 'unused' (the result being something similar to Str_GetTemp).
- Removed the 'using' directive for the std namespace since it is causing problems between our definition of 'abs' and 'std::abs' when building with GCC. Everything is already properly qualified anyway so the statement is not needed.
2011-01-25 22:18:13 +00:00
|
|
|
// libev produces many warnings which isn't really appropriate for us to
|
|
|
|
|
// address since it is 3rd party code that could be overwritten at any time
|
|
|
|
|
// with a new version
|
2024-10-03 13:31:36 +02:00
|
|
|
#ifdef MSVC_COMPILER
|
2018-02-20 18:55:24 +01:00
|
|
|
#pragma warning(push)
|
|
|
|
|
#pragma warning(disable:4013 4068 4100 4101 4127 4133 4189 4244 4245 4456 4457 4706 4996)
|
|
|
|
|
#else
|
2024-10-03 13:31:36 +02:00
|
|
|
//#define _POSIX_C_SOURCE 1
|
|
|
|
|
//#define _POSIX_SOURCE
|
2024-05-17 11:10:17 +02:00
|
|
|
|
2018-02-20 18:55:24 +01:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wcomment"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wparentheses"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
2023-04-30 19:32:00 +02:00
|
|
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
2018-02-20 18:55:24 +01:00
|
|
|
#pragma GCC diagnostic ignored "-Wunused-value"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-result"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
|
|
|
|
|
|
2023-11-16 21:25:56 +01:00
|
|
|
#if !defined(__clang__)
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wold-style-declaration"
|
2023-11-18 16:43:22 +01:00
|
|
|
#elif defined(__clang__)
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wextern-initializer"
|
2023-11-16 21:25:56 +01:00
|
|
|
#endif
|
|
|
|
|
|
2018-02-20 18:55:24 +01:00
|
|
|
#ifdef __MINGW__
|
|
|
|
|
#include <time.h>
|
|
|
|
|
struct timespec
|
|
|
|
|
{
|
|
|
|
|
time_t tv_sec;
|
|
|
|
|
long int tv_nsec;
|
|
|
|
|
};
|
|
|
|
|
#endif // __MINGW__
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-03-04 02:12:31 +01:00
|
|
|
//#define EV_STANDALONE 1
|
|
|
|
|
//config.h for ev.c is generated by cmake
|
2024-05-17 11:10:17 +02:00
|
|
|
#include "libev/ev.c"
|
2018-02-20 18:55:24 +01:00
|
|
|
|
2024-10-03 13:31:36 +02:00
|
|
|
#ifdef MSVC_COMPILER
|
2018-02-20 18:55:24 +01:00
|
|
|
#pragma warning(pop)
|
|
|
|
|
#else
|
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-05-17 11:10:17 +02:00
|
|
|
//#endif // _LIBEV
|