qzdoom-gpl/src/compatibility.h
Randy Heit 93202a5488 - Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
  for being able to use strict aliasing rules? I dunno. It's still slower
  than a VC++ build.
  
  I did run into two cases where TAutoSegIterator caused intractable problems
  with breaking strict aliasing rules, so I removed the templating from it,
  and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
  (in particular, dobject.h when not compiling with VC++).


SVN r1743 (trunk)
2009-08-02 03:38:57 +00:00

41 lines
759 B
C

#ifndef COMPATIBILITY_H
#define COMPATIBILITY_H
#include "doomtype.h"
#include "tarray.h"
#include "p_setup.h"
union FMD5Holder
{
BYTE Bytes[16];
DWORD DWords[4];
hash_t Hash;
};
struct FCompatValues
{
int CompatFlags;
int BCompatFlags;
};
struct FMD5HashTraits
{
hash_t Hash(const FMD5Holder key)
{
return key.Hash;
}
int Compare(const FMD5Holder left, const FMD5Holder right)
{
return left.DWords[0] != right.DWords[0] ||
left.DWords[1] != right.DWords[1] ||
left.DWords[2] != right.DWords[2] ||
left.DWords[3] != right.DWords[3];
}
};
extern TMap<FMD5Holder, FCompatValues, FMD5HashTraits> BCompatMap;
void ParseCompatibility();
void CheckCompatibility(MapData *map);
#endif